wip [skip ci]
This commit is contained in:
parent
2b2dc2de89
commit
19fe9152e7
3
deps.edn
3
deps.edn
|
@ -3,8 +3,9 @@
|
||||||
:deps
|
:deps
|
||||||
{org.clojure/clojure {:mvn/version "1.10.3"}
|
{org.clojure/clojure {:mvn/version "1.10.3"}
|
||||||
org.babashka/sci #_{:mvn/version "0.3.5"}
|
org.babashka/sci #_{:mvn/version "0.3.5"}
|
||||||
{:git/url "https://github.com/babashka/sci"
|
#_{:git/url "https://github.com/babashka/sci"
|
||||||
:git/sha "b95519dc283bebafa3dcce01c3e9eaaa568d0fcb"}
|
:git/sha "b95519dc283bebafa3dcce01c3e9eaaa568d0fcb"}
|
||||||
|
{:local/root "../babashka/sci"}
|
||||||
reagent/reagent {:mvn/version "1.1.0"}
|
reagent/reagent {:mvn/version "1.1.0"}
|
||||||
cljsjs/react {:mvn/version "17.0.2-0"}
|
cljsjs/react {:mvn/version "17.0.2-0"}
|
||||||
cljsjs/react-dom {:mvn/version "17.0.2-0"}
|
cljsjs/react-dom {:mvn/version "17.0.2-0"}
|
||||||
|
|
|
@ -51,6 +51,10 @@
|
||||||
(.highlightElement js/hljs code))))
|
(.highlightElement js/hljs code))))
|
||||||
(.send req)))
|
(.send req)))
|
||||||
|
|
||||||
|
(set! (.-eval_input js/window) (fn []
|
||||||
|
(let [value (.-value (js/document.getElementById "myInput"))]
|
||||||
|
(js/scittle.core.eval_string value))))
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="cljs/script.cljs" type="application/x-scittle"></script>
|
<script src="cljs/script.cljs" type="application/x-scittle"></script>
|
||||||
|
@ -118,6 +122,12 @@
|
||||||
Click me!
|
Click me!
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<a name="eval"></a>
|
||||||
|
<h2><a href="#eval">Evaluate</a></h2>
|
||||||
|
<textarea id="myInput" type="textarea">(ns foo (:require [bar]))
|
||||||
|
</textarea>
|
||||||
|
<button onclick="eval_input()">Eval!</button>
|
||||||
|
|
||||||
<a name="repl"></a>
|
<a name="repl"></a>
|
||||||
<h2><a href="#nrepl">REPL</a></h2>
|
<h2><a href="#nrepl">REPL</a></h2>
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,13 @@
|
||||||
(def !sci-ctx (atom (sci/init {:namespaces namespaces
|
(def !sci-ctx (atom (sci/init {:namespaces namespaces
|
||||||
:classes {'js js/window
|
:classes {'js js/window
|
||||||
:allow :all}
|
:allow :all}
|
||||||
:disable-arity-checks true})))
|
:disable-arity-checks true
|
||||||
|
:async-load-fn (fn [{:keys [libname ctx opts]}]
|
||||||
|
(-> (js* (str "import('" libname "')"))
|
||||||
|
(.then (fn [mod]
|
||||||
|
(sci/add-class! ctx (:as opts) mod)))
|
||||||
|
(.then (fn [_]
|
||||||
|
{:handled true}))))})))
|
||||||
|
|
||||||
(def !last-ns (volatile! @sci/ns))
|
(def !last-ns (volatile! @sci/ns))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue