forked from squint-cljs/squint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
108 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,7 @@ | |
package-lock.json | ||
target | ||
node_modules | ||
.shadow-cljs | ||
lib | ||
report.html | ||
test/scratch.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './lib/cljs_core.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(ns core-vars) | ||
|
||
(def js-map (clj->js (assoc nil :foo :bar))) | ||
|
||
(js/console.log js-map) | ||
|
||
(def clj-map (assoc nil :foo (+ 1 2 3))) | ||
|
||
(js/console.log (get clj-map :foo)) ;; => 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { toJs, get, keyword, assoc } from 'cherry-cljs/cljs.core.js' | ||
|
||
const js_map = toJs(assoc(null, keyword("foo"), keyword("bar"))); | ||
console.log(js_map); | ||
const clj_map = assoc(null, keyword("foo"), (1 + 2 + 3)); | ||
console.log(get(clj_map, keyword("foo"))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(ns destructuring) | ||
|
||
;; TODO: | ||
(let [{:keys [a]} x] | ||
|
||
) | ||
|
||
;; This currently transpiles as: | ||
|
||
;; const {keys: [a]} = {a: 1}; | ||
|
||
;; What we probably want: | ||
|
||
;; const _temp_object = x // the enti | ||
;; const a = ... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(function () { | ||
const {keys: [a]} = {a: 1}; | ||
return (function () { | ||
return null; | ||
})(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
{ | ||
"dependencies": { | ||
"mori": "^0.3.2" | ||
} | ||
"type": "module", | ||
"name": "cherry-cljs", | ||
"sideEffects": false, | ||
"version": "0.0.0-alpha.4", | ||
"files": ["cljs.core.js", | ||
"lib/cljs_core.js"], | ||
"devDependencies": {"cherry-cljs": "."} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{:deps {:aliases [:cljs]} | ||
:builds | ||
{:cherry | ||
{:js-options {;; don't bundle any npm libs | ||
:js-provider :import} | ||
:compiler-options {:infer-externs :auto} | ||
:target :esm | ||
:runtime :node | ||
:output-dir "lib" | ||
:modules | ||
{:cljs_core {:exports {assoc cljs.core/assoc | ||
map cljs.core/map | ||
str cljs.core/str | ||
keyword cljs.core/keyword | ||
symbol cljs.core/symbol | ||
vector cljs.core/vector | ||
toJs cljs.core/clj->js | ||
toCljs cljs.core/js->clj | ||
dissoc cljs.core/dissoc | ||
conj cljs.core/conj | ||
get cljs.core/get}} | ||
#_#_:transpiler {}} | ||
:build-hooks [(shadow.cljs.build-report/hook | ||
{:output-to "report.html"})]}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters