If I’m using shadow.loader
do I still need to use cljs.loader/set-loaded!
in my modules?
@steedman87 no.
@thheller Should I be using (loaded? "module-name")
to avoid loading modules more than once?
depends on what you are doing. I'd suggest using shadow.lazy
for everything. much simpler interface. either directly or with a wrapper as described here https://code.thheller.com/blog/shadow-cljs/2019/03/03/code-splitting-clojurescript.html
Oh, i wasn’t aware of shadow.lazy
, I’ll take a look at the article. Thanks for the pointer.
Is shadow.lazy
documented somewhere? I don’t see it mentioned on the Users Guide
https://clojureverse.org/t/shadow-lazy-convenience-wrapper-for-shadow-loader-cljs-loader/3841
hi, I’m having a little trouble using shadow-cljs with cursive in intellij. It looks like this. Somehow all the macros innate in clojure is colored gray and doesn’t support autocomplete. Has anybody experienced something similar to this?
I made a reagent project with lein new reagent-frontend myproject.
and have been following this instruction. https://ghufran.posthaven.com/setting-up-a-reagent-clojurescript-project-with-shadow-cljs-and-cursive
did you create the pom.xml and use that to create the project?
actually, I did lein new reagent-frontend first, then created pom.xml afterwards
should the order matter?
I don't know what lein new reagent-frontend
generates
the order doesn't matter, as long as the relevant files are correct
cursive not recognizing stuff is a sign that dependencies aren't properly configured
so either you didn't use shadow-cljs pom
to generate it or created the project via project.clj (from lein) but didn't configure the shadow-cljs dependency there
thanks, anyhow it works now. I erased the whole project, and started out with shadow-cljs init and shadow-cljs pom, then copy&pasted everything back from the reagent template.
Long shot. But any idea how one would do this manual loading of the monaco-editor
into a chrome extension?
https://github.com/suren-atoyan/monaco-loader#config
Just read the "Paths, Paths, Paths" article on the "From the Shadows" blog. Really useful!! Question: is :dev-http {3000 "public"}
the same as :builds {:app {:devtools {:http-root "public" :http-port 3000}}}
?
@grounded_sage I'd guess you set the paths and you are good to go?
@dmaltbie yes, the second desugars into the :dev-http
. the http stuff in :devtools
has been deprecated for a couple years now, not going to remove it but it is the old style
Yes, I have both in my .edn file. I'll remove the devtools stuff. Works fine with both, though.
yea it looks straight forward but I think I'm missing something with the paths
to be honest I think the editor folder is not being loaded into the extension and I'm not sure why
did you copy it properly? shadow-cljs won't copy dynamically loaded stuff like that
Only seeing js files that I have called out to in the html. But the rest isn't there :thinking_face:
I got this script in my package.json cp -R node_modules/monaco-editor/** shells/chrome/lib/monaco-editor
😅
sorry can't help you much. the devtools should give you errors and stuff if it fails to load things
or maybe the monaco loader does
Yea I'll keep scratching around and see if I can get it working.
Tried :web_accessible_resources ["lib/*"]
but that doesn't seem to do anything for me