This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-09
Channels
- # announcements (1)
- # arachne (1)
- # beginners (34)
- # boot (5)
- # calva (68)
- # cider (34)
- # cljs-dev (1)
- # clojure (36)
- # clojure-italy (8)
- # clojure-spec (16)
- # clojure-uk (58)
- # clojurescript (29)
- # cursive (2)
- # datascript (9)
- # datomic (3)
- # emacs (10)
- # figwheel (1)
- # figwheel-main (11)
- # fulcro (33)
- # luminus (5)
- # mount (2)
- # nrepl (42)
- # off-topic (3)
- # other-languages (2)
- # parinfer (3)
- # perun (4)
- # prelude (3)
- # re-frame (6)
- # reagent (5)
- # shadow-cljs (23)
- # sql (37)
- # testing (1)
@currentoor at compile time no. at runtime you can check cljs.core/*target*
(will be nodejs
) for node targets
you could in theory check that at compile time by checking the compiler env but thats not really recommended
@jstaab you don't seem to be using :npm-module
? a dev build generates many files and cannot be loaded by webpack unless you use :npm-module
Would anyone be interested in a new feature that could reduce the startup time of shadow-cljs by about 50% but would require running a separate command that can take a minute or so to run whenever the classpath changes?
I kinda decided that its not worth the effort but all the code is pretty much finished
I don't restart shadow-cljs often enough so startup time doesn't matter much to me but others may feel different
(this would be achieved by generating an AppCDS archive as described here https://mjg123.github.io/2017/10/04/AppCDS-and-Clojure.html)
unfortunately this cannot be pre-generated or so and cannot be shared amount projects since the classpath must match
@thheller that would be a net gain for me, but might cause some friction for first time adopters if first-run was excessively slow. It would only serve to amplify startup time complaints I'd imagine. By the way, I do love the client-server architecture; that's so much the way to go. As for your suggestion above, I'll try npm-module. I had moved away from that to browser for some reason; I can't remember what problems I'd had.
wondering if anyone might have some insight. My real goal is to use oauthjs
but this has a dependency on querystring. So in a blank project, npm i querystring
and then in an ns form (:require ["querystring" :as qs])
yields:
[:app] Build failure:
The required JS dependency "querystring" is not available, it was required by "beta/main.cljs".
Searched in:/home/dan/projects/clojure/beta/node_modules
You probably need to run:
npm install querystring
but
[dan@fedora beta]$ tree -L 1 node_modules/
node_modules/
āāā querystring
(this is the symptom i observe when trying to consume oauthjs but a smallest reproduction)
I was able to follow those steps and had no trouble. How are you setting up shadow-cljs? The only thing I can think of is the js-provider options: https://shadow-cljs.github.io/docs/UsersGuide.html#js-provider
{:source-paths ["src"]
:dependencies []
:builds {:app {:output-dir "target/"
:asset-path "."
:target :browser
:modules {:main {:init-fn beta.main/main!}}
:devtools {:after-load beta.main/reload!
:http-root "target"
:http-port 8080}}}}
this is how i'm setting it up. have i missed something?Hmm same node and shadow on my end. What happens if you require from node? e.g. node -e 'console.log(require("querystring"))'
IIRC querystring
is one of those packages that needs a browser polyfill which gets installed when you install shadow-cljs
in your project
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/build/npm.clj#L306 via https://github.com/webpack/node-libs-browser