shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
thheller 2021-07-04T06:38:32.417500Z

@pez it does not. the classpath does not decide what ends up in the build. only your :require does. what isn't required isn't included. see https://code.thheller.com/blog/shadow-cljs/2018/02/08/problem-solved-source-paths.html

pez 2021-07-04T06:53:02.418500Z

That's awesome. And a great article explaining it! Thanks!

hadils 2021-07-04T14:58:36.422400Z

Hi! I have a problem. I had a shdaow-cljs app that was working, but now the watch function is broken. I am troubleshooting the problem and I found that the websocket connection to localhost:9630 is getting back "access denied" in proper transit format. The result is that the website is showing stale information. Restarting the app and reloading the webpage has no effect. I checked the dependencies and I think they are correct. Any suggestions for how to resolve this? Thanks!

thheller 2021-07-04T14:59:46.422800Z

I really gotta expand that error message ...

thheller 2021-07-04T15:00:20.423600Z

common problem #1: changing :output-dir OR :modules but not updating your HTML to actually load those files and thus loading the old files

thheller 2021-07-04T15:00:51.424400Z

#2: having two instances of shadow-cljs running in the same project and both running watch competing with each other

thheller 2021-07-04T15:01:39.425Z

#3: less common but when using :devtools-url not properly proxying requests?

thheller 2021-07-04T15:03:06.426100Z

or what also might happen if you have 2 projects both using shadow-cljs, they'll start on port 9630 and then port 9631. there might be cases where the watch from project a isn't actually running but the files still try to connect although 9630 now belong to another project. doens't seemt to be your case though since you said watch is running

hadils 2021-07-04T15:03:35.427100Z

I am not using devtools-url. Let me check #1.

hadils 2021-07-04T15:06:03.427800Z

I don't have two proejcts with shadow-cljs.

hadils 2021-07-04T15:06:07.428Z

Wait...

thheller 2021-07-04T15:06:24.428200Z

also try http://localhost:9630/api/project-info

thheller 2021-07-04T15:06:32.428500Z

make sure the server is actually what you think it is

hadils 2021-07-04T15:34:23.430Z

I rebooted. No other shadow-cljs processes running. The link above checks out as my project. I don't know why I'm getting access denied from the websocket reply.

thheller 2021-07-04T15:35:24.430400Z

did you verify you are loading the correct files? delete them to be sure

hadils 2021-07-04T15:35:58.431200Z

Hmmm, let me check

thheller 2021-07-04T15:36:01.431300Z

could also be some sort of cache? maybe you have a service worker installed that caches too aggressively?

hadils 2021-07-04T15:36:42.431500Z

Ah. Let me check...

hadils 2021-07-04T15:43:32.432Z

The service-worker was the problem! Thanks, @thheller!

hadils 2021-07-04T16:31:02.432900Z

A naive point of view: it doesn't seem like hot code reloading works properly with service-workers. I am sure that I don't have it configured properly...

hadils 2021-07-04T16:40:20.433400Z

I take that back. I had installed my pwa which was causing the problem.

hadils 2021-07-04T20:00:06.434700Z

Hi again. Can web workers have a different output-dir than the other modules? I would like to use the modules feature to generate my service worker...

thheller 2021-07-04T20:06:05.435Z

a service worker should really be a separate build

thheller 2021-07-04T20:06:20.435400Z

makes absolutely no sense to combine it

thheller 2021-07-04T20:07:28.436Z

IMHO I wouldn't even write a service worker in CLJS. probably just use something like https://developers.google.com/web/tools/workbox to generate it

hadils 2021-07-04T20:30:46.436500Z

Ok. Thanks @thheller!

hadils 2021-07-04T21:41:14.437200Z

BTW, @thheller, This is an excellent library you have developed. I am really impressed.

😎 1