This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-06
Channels
- # announcements (5)
- # aws (28)
- # babashka (4)
- # beginners (163)
- # bristol-clojurians (2)
- # calva (4)
- # cider (18)
- # clj-kondo (30)
- # cljs-dev (28)
- # cljsrn (50)
- # clojure (96)
- # clojure-europe (25)
- # clojure-italy (6)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-sweden (7)
- # clojure-uk (32)
- # clojurescript (39)
- # conjure (74)
- # cursive (12)
- # events (1)
- # fulcro (32)
- # helix (71)
- # jackdaw (2)
- # leiningen (10)
- # off-topic (14)
- # pathom (59)
- # rdf (7)
- # re-frame (6)
- # reitit (28)
- # ring (7)
- # shadow-cljs (207)
- # slack-help (2)
- # spacemacs (3)
- # specter (7)
- # sql (12)
- # tools-deps (14)
- # xtdb (32)
Hi is anyone experienced with boot-shadow/shadow-cljs who could help.
Am changing from boot cljs to shadow for compilation, and have it successfully working via the command line.
I've installed boot-shadow v 2.8.107 and are running into an error when running boot shadow/release
.
No matching method sha1Hex found taking 1 args for class org.apache.commons.codec.digest.DigestUtils
This would appear to be related to the hashing function added in shadow-cljs v2.8.102.
Full error in attachment. Thank you.Hi ignore for now. I had a class path conflict with commons.codec
hello, I just started trying to use the web worker feature of shadow, but seems like shadow is trying to install devtools (fulcro inspect) in the worker
is that a way to make the preloads load only on the :main
module?
How are your modules set up? Do you have a shared module?
yeah:
{:target :browser
:output-dir "resources/public/js"
:asset-path "/js"
:compiler-options {:closure-defines {goog.LOCALE "en"}
:source-map true}
:devtools {:preloads [devtools.preload com.fulcrologic.fulcro.inspect.websocket-preload]
:http-root "resources/public"
:http-port 8120
:browser-inject :main}
:modules {:shared {:entries []}
:main {:init-fn myapp.webapp.main/init
:depends-on #{:shared}}
:worker {:init-fn myapp.webapp.worker/init
:depends-on #{:shared}
:web-worker true}}}
@U066U8JQJ just move the :preloads
into the :main
module. they can be specified per module.
nice 👍
hello, something driving me a bit nuts here, I started seeing this error in a project:
------ ERROR -------------------------------------------------------------------
File: jar:file:/Users/wilkerlucio/.m2/repository/com/wsscode/pathom/2.3.0-alpha6/pathom-2.3.0-alpha6.jar!/com/wsscode/pathom/trace.cljc:289:9
--------------------------------------------------------------------------------
286 | (let [trace* (or (::trace* env) (atom []))
287 | env' (assoc env ::trace* trace*)
288 | parser-trace (trace-enter env' {::event ::trace-plugin})]
289 | (let-chan [res (parser env' tx)]
---------------^----------------------------------------------------------------
Encountered error when macroexpanding clojure.core.async/go.
ClassCastException: class clojure.lang.Keyword cannot be cast to class clojure.lang.IObj (clojure.lang.Keyword and clojure.lang.IObj are in unnamed module of loader 'app')
I have another project in which the same code compiles fine, I have tried to mimic all the same deps between projects (core.async, shadow, cljs, clj), removed .shadow-cljs
every time between builds, but for some reason its just not working, any ideas what I may be missing here?I had the same with async-helpers 1.0.5. I rolled it back to 1.0.4 and that disappeared. Probably some version conflict?
you are right, and there was a core.async bump there, probably is it, gonna dig more on that
@U4EFBUCUE I found the bug on the library, was a mistaken change in a require from cljs.core.async
to clojure.core.async
in the com.wsscode.async-cljs.clj
file, version 1.0.6
released with the fix
Thanks, I'll check it out!
Hi folks - is there a way of using multiple lein profiles with shadow? e.g. a different profile per target?
Motivation: using https://github.com/weavejester/environ to manage some ‘static’ configuration rather than goog-define
ah of course, cool
I am using config-merge, but it’s not amazing for secrets
so this is in a node context - using config-merge for e.g. api keys builds them into the js file, so they kind of need to come from the environment. hence went to environ which I’m used to from clj
unless I am totally missing something
exactly
using environ for that, and was considering it for other things too, but I just won’t 😄
will keep it exclusively as local dev file vs prod env separation
thanks @thheller - had a really enjoyable time so far with shadow-cljs, very much appreciate your work
Honestly, not too often. If I am debugging my own app it hasn't been a problem to get emacs working. But since I have been using clj since about 2008, I sort of got used to not using a debugger very often with clojure. Even though there was technically debugging support quite early, java debuggers used to get freaked out a lot by locals clearing and other stuff so it never worked very well for me. And emacs had no clojure debugging support for quite a long time.
Like, just as an experiment, let me see if I can debug my own app ... it'll take at least a few mins.
Ok, for my own app it's trivial, I just need to launch it with the cider middleware with nrepl ... not 100% sure how to do that with shadow-cljs.
If I launch into an nrepl interactive session, I'm not totally sure how to replicate what shadow-cljs does when I tell it 'watch app bootstrap'
I am able to tell it to (compile :app) or (compile :bootstrap) but my breakpoints never get hit
just don't start with shadow-cljs watch app
because that will shutdown if you stop the watch
one tap is really all you need. the inspect you will let you drill down into everything else.
when the server is running open http://localhost:9630
So wait, when you say a shadow-cljs server
and a separate shadow-cljs watch app
, you mean 2 processes??
How does it work if I have 2 separate processes, since I want to see what is happening in the watching process?
OK my emacs nrepl connection doesn't work AT ALL without the middleware, so let's see if I can connect easily via clj or something.
Yeah, me neither. I just sent out the output of my init entry in defs, via private message.
If I can't figure out emacs I will eventually have IntelliJ so maybe I can bug you about how you would use that debugger, if I don't figure it out first.
@niwinz I think I found and fixed the ShadowJS warning issue. should be gone with next release.
In case anyone was following my error earlier, it turns out upgrading to the newest shadow-cljs and cljs seems to have made the error go away.
it seems like shadow-cljs make a much bigger bundle than what we had before with clj and figwheel, is there some fundamental differences? It is only a problem on a specific device where the bundle crashes the js engine 90% of the time
@yenda define "a much bigger bundle"? for release the build should be smaller, for development it will be much larger yes.
well technically the same but for development all files are combined into one, re-natal loads many small files dynamically
FWIW it would be trivial to provide a secondary approach like re-natal/krell do that only load a tiny js "loader" file on startup and that then loads everything else dynamically
I opted not to do that because of the async layer it introduces, ie. making "loading" async in dev but not in production
Hi Folks, I'm trying to use shadow-cljs to compile a reagent / re-frame app and shadow-cljs is telling me that required namespace react is not available
. I've seen the note about using shadow-cljsjs
and have added it to my shadow-cljs.edn dependencies map but that hasn't fixed the problem. What else do I need to do?
ah, no. That must be it <facepalm>. thx!
hello, I'm trying to make workspaces with web workers, but when I try to configure I get this error:
[:workspaces] Build failure:
Module Entry "devtools.preload" was moved out of module ":main".
It was moved to ":shared" and used by #{:shared :main}.
and this is the config I'm trying:
:workspaces {:target nubank.workspaces.shadow-cljs.target
:ns-regexp "-(test|cards)$"
:output-dir "resources/workspaces/js"
:asset-path "/js"
:compiler-options {:source-map true}
:modules {:shared {:entries []}
:main {:depends-on #{:shared}
:preloads [devtools.preload com.fulcrologic.fulcro.inspect.preload]}
:worker {:init-fn my-app/init
:depends-on #{:shared}
:web-worker true}}
:devtools {:http-resource-root "."
:http-root "resources/workspaces"
:http-port 8121
:browser-inject :main}}
but I'm confused about whats going on, the workspaces is using a target that I modified a bit to dont completly override :main :entries
so I can set preloads there
@thheller I tried messing with the target, if I remove that i complains on the same for the inject-repl-client
(defn resolve-cards-and-tests
[{::build/keys [mode config] :as state}]
(let [{:keys [ns-regexp] :or {ns-regexp "-(ws|test)$"}}
config
dynamically-resolved-namespaces
(find-namespaces-by-regexp state ns-regexp)]
(-> state
;; Add the mounter and all of the resolved cards/tests
(assoc-in [::modules/config :main :entries] (-> []
(into (get config :preloads []))
(into dynamically-resolved-namespaces)
(conj 'nubank.workspaces.shadow-cljs.mount)))
(cond->
(and (= :dev mode) (:worker-info state))
(update-in [::modules/config :main] browser/inject-repl-client state config)
(= :dev mode)
(-> (update-in [::modules/config :main] browser/inject-preloads state config)
(update-in [::modules/config :main] browser/inject-devtools-console state config)))
(modules/analyze))))
the cond->
part seems to be problem
yeah, removing that the compilatin works, altough it still installing the devtools twice (once on main, once on worker when it starts)
nah, you are right, confusion on my part, first time using web workers, so I guess its fine
yeah all code in :shared
will be loaded twice, that will include devtools.preload and whatever that does
I have a build hook that runs during the configuration step, when building a release it seems like the compile step happens in parallel, is that right?
or do you mean the compilation happens in parallel itself? that would be true for development too
the hook generates a new clojurescript file that some files in the project depend on, so during development the generated file is there before the compilation step, but in the release build the compile step fails because the generated file is not there yet
(when (= :dev (:shadow.build/mode build-state))
(fs-watch/start {}
(file-seq (io/file pages-directory))
["cljs" "cljc" "clj" "js"]
gen-routes-fn))
so basically you’re prescribing just a separate step that is bundled in the dev calls
I do feel like it would be really powerful to have a hook that can be called before shadow does anything, because ultimately it would be nice to open source this thing and that would make the install way easier
the issue why I'm advising against running this as a hook is that it starts a thread
@thheller I like to contribute to shadow docs, where does the source of it lives?
@U066U8JQJ looks like it's here https://github.com/shadow-cljs/shadow-cljs.github.io
thanks!