Fork me on GitHub
#shadow-cljs
<
2021-05-22
>
knubie11:05:47

If I’m using shadow.loader do I still need to use cljs.loader/set-loaded! in my modules?

knubie14:05:30

@thheller Should I be using (loaded? "module-name") to avoid loading modules more than once?

thheller14:05:17

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

knubie14:05:46

Oh, i wasn’t aware of shadow.lazy, I’ll take a look at the article. Thanks for the pointer.

knubie14:05:17

Is shadow.lazy documented somewhere? I don’t see it mentioned on the Users Guide

tlonist14:05:24

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?

tlonist14:05:44

I made a reagent project with lein new reagent-frontend myproject.

thheller14:05:51

did you create the pom.xml and use that to create the project?

tlonist14:05:33

actually, I did lein new reagent-frontend first, then created pom.xml afterwards

tlonist14:05:33

should the order matter?

thheller14:05:34

I don't know what lein new reagent-frontend generates

thheller14:05:28

the order doesn't matter, as long as the relevant files are correct

thheller14:05:42

cursive not recognizing stuff is a sign that dependencies aren't properly configured

thheller14:05:24

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

👍 3
👏 3
tlonist14:05:31

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.

grounded_sage20:05:25

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

Dan Maltbie20:05:34

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}}} ?

thheller20:05:55

@grounded_sage I'd guess you set the paths and you are good to go?

grounded_sage20:05:27

yea it looks straight forward but I think I'm missing something with the paths

grounded_sage20:05:43

to be honest I think the editor folder is not being loaded into the extension and I'm not sure why

thheller20:05:28

did you copy it properly? shadow-cljs won't copy dynamically loaded stuff like that

grounded_sage20:05:50

Only seeing js files that I have called out to in the html. But the rest isn't there :thinking_face:

grounded_sage20:05:51

I got this script in my package.json cp -R node_modules/monaco-editor/** shells/chrome/lib/monaco-editor 😅

thheller20:05:34

sorry can't help you much. the devtools should give you errors and stuff if it fails to load things

thheller20:05:43

or maybe the monaco loader does

grounded_sage21:05:24

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

thheller20:05:30

@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

Dan Maltbie20:05:00

Yes, I have both in my .edn file. I'll remove the devtools stuff. Works fine with both, though.