Skip to content

Commit

Permalink
Bump squint to 0.4.81 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Dec 11, 2023
1 parent 694abc7 commit 5594ed7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@lezer/highlight": "^1.0.0",
"@lezer/lr": "^1.0.0",
"@nextjournal/lezer-clojure": "1.0.0",
"squint-cljs": "0.4.58",
"squint-cljs": "0.4.81",
"w3c-keyname": "^2.2.4"
},
"comments": {
Expand All @@ -40,6 +40,7 @@
"devDependencies": {
"@codemirror/lang-javascript": "^6.0.0",
"@nextjournal/clojure-mode": "link:.",
"@squint-cljs/macros": "0.1.0",
"d3-require": "^1.2.4",
"emoji-regex": "^10.0.0",
"framer-motion": "^6.2.8",
Expand All @@ -54,8 +55,7 @@
"react-dom": "^17.0.2",
"rollup-plugin-analyzer": "^4.0.0",
"shadow-cljs": "2.19.5",
"vite": "^4.4.9",
"@squint-cljs/macros": "0.1.0"
"vite": "^4.4.9"
},
"exports": {
".": "./dist/nextjournal/clojure_mode.mjs",
Expand Down
2 changes: 1 addition & 1 deletion public/squint/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<script type="importmap">
{
"imports": {
"squint-cljs/core.js": "https://unpkg.com/squint-cljs@0.4.57/core.js"
"squint-cljs/core.js": "https://unpkg.com/squint-cljs@0.4.81/core.js"
}
}
</script>
Expand Down
11 changes: 6 additions & 5 deletions public/squint/js/demo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { extension as eval_ext, cursor_node_string, top_level_string } from '@ne
import { EditorView, drawSelection, keymap } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { syntaxHighlighting, defaultHighlightStyle, foldGutter } from '@codemirror/language';
import { compileString } from 'squint-cljs';
import { compileStringEx } from 'squint-cljs';

let theme = EditorView.theme({
".cm-content": {whitespace: "pre-wrap",
Expand All @@ -24,11 +24,12 @@ let theme = EditorView.theme({
".cm-cursor": {visibility: "hidden"},
"&.cm-focused .cm-cursor": {visibility: "visible"}
});

let compilerState = null;
let evalCode = async function (code) {
let js = compileString(`(do ${code})`, {repl: true,
context: 'return',
"elide-exports": true})
compilerState = compileStringEx(`(do ${code})`, {repl: true,
context: 'return',
"elide-exports": true}, compilerState)
let js = compilerState.javascript;
let result;
try {
result = {value: await eval(`(async function() { ${js} })()`)};
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1176,10 +1176,10 @@ source-map@^0.5.6:
resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz"
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=

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

Expand Down

0 comments on commit 5594ed7

Please sign in to comment.