shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
knubie 2021-05-22T11:50:47.058900Z

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

thheller 2021-05-22T14:11:31.059100Z

@steedman87 no.

1👍
knubie 2021-05-22T14:12:30.059700Z

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

thheller 2021-05-22T14:14:17.060400Z

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

knubie 2021-05-22T14:15:46.061Z

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

knubie 2021-05-22T14:19:17.061500Z

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

2021-05-22T14:39:24.063200Z

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?

2021-05-22T14:40:44.063500Z

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

2021-05-22T14:41:00.063700Z

and have been following this instruction. https://ghufran.posthaven.com/setting-up-a-reagent-clojurescript-project-with-shadow-cljs-and-cursive

thheller 2021-05-22T14:42:51.064Z

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

2021-05-22T14:43:33.064400Z

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

2021-05-22T14:44:33.064600Z

should the order matter?

thheller 2021-05-22T14:55:34.064800Z

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

thheller 2021-05-22T14:56:28.065Z

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

thheller 2021-05-22T14:56:42.065200Z

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

thheller 2021-05-22T14:57:24.065400Z

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

1👍1👏
2021-05-22T14:58:31.065600Z

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_sage 2021-05-22T20:27:25.067500Z

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 Maltbie 2021-05-22T20:37:34.071200Z

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

thheller 2021-05-22T20:37:55.071500Z

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

thheller 2021-05-22T20:38:30.072600Z

@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 Maltbie 2021-05-22T20:39:00.073Z

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

grounded_sage 2021-05-22T20:52:27.073200Z

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

grounded_sage 2021-05-22T20:54:43.073400Z

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

thheller 2021-05-22T20:55:28.073600Z

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

grounded_sage 2021-05-22T20:55:50.073800Z

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

grounded_sage 2021-05-22T20:56:51.074400Z

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

thheller 2021-05-22T20:57:34.074700Z

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

thheller 2021-05-22T20:57:43.074900Z

or maybe the monaco loader does

grounded_sage 2021-05-22T21:01:24.075100Z

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