Skip to content

Commit 5594ed7

Browse files
authored
Bump squint to 0.4.81 (#46)
1 parent 694abc7 commit 5594ed7

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@lezer/highlight": "^1.0.0",
2424
"@lezer/lr": "^1.0.0",
2525
"@nextjournal/lezer-clojure": "1.0.0",
26-
"squint-cljs": "0.4.58",
26+
"squint-cljs": "0.4.81",
2727
"w3c-keyname": "^2.2.4"
2828
},
2929
"comments": {
@@ -40,6 +40,7 @@
4040
"devDependencies": {
4141
"@codemirror/lang-javascript": "^6.0.0",
4242
"@nextjournal/clojure-mode": "link:.",
43+
"@squint-cljs/macros": "0.1.0",
4344
"d3-require": "^1.2.4",
4445
"emoji-regex": "^10.0.0",
4546
"framer-motion": "^6.2.8",
@@ -54,8 +55,7 @@
5455
"react-dom": "^17.0.2",
5556
"rollup-plugin-analyzer": "^4.0.0",
5657
"shadow-cljs": "2.19.5",
57-
"vite": "^4.4.9",
58-
"@squint-cljs/macros": "0.1.0"
58+
"vite": "^4.4.9"
5959
},
6060
"exports": {
6161
".": "./dist/nextjournal/clojure_mode.mjs",

public/squint/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<script type="importmap">
6262
{
6363
"imports": {
64-
"squint-cljs/core.js": "https://unpkg.com/squint-cljs@0.4.57/core.js"
64+
"squint-cljs/core.js": "https://unpkg.com/squint-cljs@0.4.81/core.js"
6565
}
6666
}
6767
</script>

public/squint/js/demo.mjs

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { extension as eval_ext, cursor_node_string, top_level_string } from '@ne
33
import { EditorView, drawSelection, keymap } from '@codemirror/view';
44
import { EditorState } from '@codemirror/state';
55
import { syntaxHighlighting, defaultHighlightStyle, foldGutter } from '@codemirror/language';
6-
import { compileString } from 'squint-cljs';
6+
import { compileStringEx } from 'squint-cljs';
77

88
let theme = EditorView.theme({
99
".cm-content": {whitespace: "pre-wrap",
@@ -24,11 +24,12 @@ let theme = EditorView.theme({
2424
".cm-cursor": {visibility: "hidden"},
2525
"&.cm-focused .cm-cursor": {visibility: "visible"}
2626
});
27-
27+
let compilerState = null;
2828
let evalCode = async function (code) {
29-
let js = compileString(`(do ${code})`, {repl: true,
30-
context: 'return',
31-
"elide-exports": true})
29+
compilerState = compileStringEx(`(do ${code})`, {repl: true,
30+
context: 'return',
31+
"elide-exports": true}, compilerState)
32+
let js = compilerState.javascript;
3233
let result;
3334
try {
3435
result = {value: await eval(`(async function() { ${js} })()`)};

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1176,10 +1176,10 @@ source-map@^0.5.6:
11761176
resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz"
11771177
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
11781178

1179-
squint-cljs@0.4.58:
1180-
version "0.4.58"
1181-
resolved "https://registry.yarnpkg.com/squint-cljs/-/squint-cljs-0.4.58.tgz#9dde3c431661ffd8f2596ad397e3c657bf91ffe9"
1182-
integrity sha512-X/F8gQfemySHHP6+nuQKUc6s+/3bYYGbKyiJDRqtyzbOYH/AIwaJM3RCGF7gAu99jSCcLrSh6NjIuwDKQicMXg==
1179+
squint-cljs@0.4.81:
1180+
version "0.4.81"
1181+
resolved "https://registry.yarnpkg.com/squint-cljs/-/squint-cljs-0.4.81.tgz#b1926c112a5caa12ed4ecc6f9035827dc4270bb7"
1182+
integrity sha512-ffMxWbL901+xHMlaXeUavfrhK+uX7tsZYzF9/kxJYGZ6+KLOGy1Ke9+osbVNR+Vd/uszX6O/YcpNxCJzThgTUA==
11831183
dependencies:
11841184
chokidar "^3.5.3"
11851185

0 commit comments

Comments
 (0)