Trying out https://clojurescript.org/guides/javascript-modules
Check out the comments in the code to see where my ignorance of ClojureScript is.
I think I installed all of these with brew
:
lein
rlwrap
lein trampoline run -m clojure.main watch.clj
node build/bundle
rlwrap lein trampoline run -m clojure.main repl.clj
I noticed that I get an error when doing:
(require '[fuck-javascript.hello :as hello] :reload)
; SyntaxError: Identifier 'sayHello$$module$src$fuck_javascript$hello' has already been declared
; at /Users/Eric/Projects/ericclemmons/fuck-javascript/.cljs_node_repl/src/fuck-javascript/hello.js:1:1
So no idea if I'm supposed to be doing something when the instructions say:
Reload your JavaScript module and try the new functionality:
Skipped the entire part about downloading:
curl -O https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.1/babel.min.js
Because, there are already existing Babel needs I'm aware of (e.g. decorators) that make this not applicable.
lein trampoline run -m clojure.main build.clj
node build/hello_cjs.js
Failed with:
Invariant Violation: EventPluginRegistry: Cannot inject event plugins that do not exist in the
plugin ordering, `ti`.
No warnings.
All done. š¤·