Skip to content

Commit

Permalink
Fix #577: support default + refer
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Nov 19, 2024
1 parent 19c9b8f commit efaccd0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

[Squint](https://github.com/squint-cljs/squint): Light-weight ClojureScript dialect

## v0.8.125 (2024-11-19)

- Fix [#577](https://github.com/squint-cljs/squint/issues/577): support `$default` + `:refer`

## v0.8.124 (2024-11-08)

- Add `delay`
Expand Down
7 changes: 7 additions & 0 deletions test/squint/compiler_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,13 @@
(str/trim (squint/compile-string "(ns foo (:require [\"some-js-lib\" :refer [atom]])) atom" {:repl true}))
"foo.atom;")))

(deftest default-require-test
(let [js (squint/compile-string "(ns foo (:require [\"some-js-lib$default\" :as a :refer [atom]])) atom")]
(is (str/includes? js "import default$1 from 'some-js-lib'"))
(is (str/includes? js "const { atom } = default$1;")))
(let [js (squint/compile-string "(ns foo (:require [\"some-js-lib$default\" :as a :refer [atom]])) atom" {:repl true})]
(is (str/includes? js "var { atom } = (await import ('some-js-lib')).default;"))))

(deftest ns-test-async
(t/async done
(let [js (squint/compile-string "(ns foo (:require [clojure.string :as str])) (str 1 2 3 (str/join \",\" [1 2 3]))" {:repl true
Expand Down

0 comments on commit efaccd0

Please sign in to comment.