This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-09
Channels
- # announcements (1)
- # atlanta-clojurians (1)
- # beginners (198)
- # calva (4)
- # cider (16)
- # clara (8)
- # cljs-dev (14)
- # cljsrn (4)
- # clojure (204)
- # clojure-europe (3)
- # clojure-gamedev (2)
- # clojure-italy (8)
- # clojure-nl (17)
- # clojure-poland (3)
- # clojure-russia (20)
- # clojure-spec (32)
- # clojure-uk (45)
- # clojurescript (59)
- # community-development (1)
- # core-async (25)
- # cursive (20)
- # datomic (47)
- # emacs (7)
- # fulcro (8)
- # iot (1)
- # iotivity (2)
- # jobs (1)
- # jobs-discuss (8)
- # juxt (11)
- # luminus (5)
- # nrepl (4)
- # off-topic (136)
- # onyx (24)
- # other-lisps (1)
- # parinfer (74)
- # pedestal (1)
- # planck (3)
- # portkey (67)
- # random (1)
- # re-frame (28)
- # reagent (11)
- # reitit (9)
- # remote-jobs (3)
- # ring-swagger (2)
- # rum (3)
- # shadow-cljs (96)
- # slack-help (3)
- # spacemacs (6)
- # tools-deps (3)
- # unrepl (1)
- # vim (4)
If I want to create an npm module users can install as a CLI and just use, which shadow-cljs build target should I use?
@jayzawrotny https://shadow-cljs.github.io/docs/UsersGuide.html#target-node-script or :npm-module
depending on your needs. :node-script
is simpler and probably what you want.
What's the best way to read an EDN file in ClojureScript given that slurp
is unavailable?
I realized I was being silly here because I was trying to hide a public key from the repo thinking it was a secret key. I'm still curious though should the need arise what to do here.
If it is amenable to compile time, you could do it with a macro. (Avoid doing that in a library, because it is incompatible with :aot-cache
, but it should be OK in application code.)
Good Day everyone. Just recently the latest version of Nonforum was released. It's built on ClojureScript with Rum, Sente, and Accountant, and a little bit of Clojure to have a server. Check it out! it's a fresh start so all the cool aliases are still available. https://www.nonforum.com
I use that project.clj below then run lein repl
and I get a fatal error:
Exception in thread "main" java.lang.ExceptionInInitializerError
at clojure.main.<clinit>(main.java:20)
Caused by: Syntax error compiling at (org/httpkit/server.clj:1:1).
at clojure.lang.Compiler.load(Compiler.java:7647)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:463)
at clojure.lang.RT.load(RT.java:428)
at clojure.core$load$fn__6824.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6765.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:1789)
at figwheel_sidecar.components.figwheel_server$eval18541$loading__6706__auto____18542.invoke(figwheel_server.clj:1)
at figwheel_sidecar.components.figwheel_server$eval18541.invokeStatic(figwheel_server.clj:1)
at figwheel_sidecar.components.figwheel_server$eval18541.invoke(figwheel_server.clj:1)
any insight as to why it’s combusting?I can't say why it's not working, but I can recommend using shadow-cljs since you are using npm packages
I’m working on a lein-template that provides both a figwheel and a shadow-cljs variation so unfortunately I gotta do the leg work and learn it.
Here you can find full example how to use figwheel-main + cljs + npm dependencies https://github.com/kwladyka/form-validator-cljs/tree/doc
Oh and everything besides of solution with shadow-cljs and figwheel-main suc** IMO 🙂
Have fun
@jayzawrotny you've got some fundamental incompatibilities in your project.clj due to a migration from tools.nrepl -> nrepl/nrepl. Some things that stick out: i think your figwheel sidecar is very outdated. I think its up to 0.5.17 now? com.cemerick/piggieback 0.2.2 should be cider/piggieback 0.3.10 (possibly 11?) and the nrepl middleware to wrap cljs repl should use cider.piggieback/wrap-cljs-repl. Also, since you are specifying 2.8.3 for lein, any dependency that uses tools.nrepl will likely poison your setup
Thanks, this is the thorough ass kicking I needed! What should I be specifying for lein, 2.0.0?
it's kinda annoying right now because some low level stuff has been migrated out of core-contrib and there's a bit of churn right now
and chas stepped away from clojure so nrepl and cider orgs inherited the piggieback and nrepl repos
the docstring for sort-by
in clojure includes "guaranteed to be stable" and this is absent from clojurescript. I suppose this is intentionally absent and I should not rely on this property? *clojurescript-version* => "1.9.946"
i suppose this is telling:
;; matching Clojure's stable sort, though docs don't promise it
Is there an equivalent to https://clojuredocs.org for CLJS?
http://cljs.github.io/api/ is what I use
I’m having an issue where nothing in my externs file is being reflected in my advanced compilation build. Is there a place to start to try to debug that? Adding an obviously non-existent file to my :externs
vector in the compiler options doesn’t generate a warning, for example.
are you using lein/cljsbuild?
One quick thing to check is add :verbose
to see if your compiler options are being used at all (https://clojurescript.org/reference/compiler-options#verbose)
Cool, trying that
Yeah, looks like the compiler options are being picked up, and my externs file is included in that vector.
@joshmiller did you hand write the externs?
Ok, I’ll look into that. These are hand-written for a first-party JS dependency, so I might have screwed that up.
@joshmiller are you aware that we can generate externs automatically for you now?
Vaguely, so I can give that a shot as well.
One-line reproduce.
clj -Srepro -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0"} org.clojure/clojurescript {:mvn/version "1.10.439"}}}' -m cljs.main --repl-env node -e '(defmacro myloop [bindings & body] `(loop ~bindings ~@body)) (myloop [] (recur))'