shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
lsenjov 2021-01-25T03:49:25.039400Z

You mean constantly running it as a server? Or running it on a server to output compiled js?

Mr. Savy 2021-01-25T04:14:33.039600Z

i'm not sure i understand the question, but I think the second one? I'm just trying to figure out how to run my release code on a server basically, and I think i'm going to need to use depstar to do it maybe.

aratare 2021-01-25T04:30:18.039800Z

So I assume you have a java server for the backend and shadow-cljs for the frontend?

aratare 2021-01-25T04:30:48.040Z

in that case you can just uberjar both of them and have the server serve the frontend

Mr. Savy 2021-01-25T05:23:38.040300Z

server is heroku, I think they have java buildscripts. i've been having trouble getting an uberjar set up correctly when i have tried!

aratare 2021-01-25T05:43:56.040800Z

I'd recommend trying to build it manually first before setting up heroku. Wrestling with building an uberjar and heroku at the same time sounds like a bad time.

aratare 2021-01-25T05:44:37.041Z

at least doing so would help you pinpoint where you're having trouble with bundling an uberjar

thheller 2021-01-25T09:14:57.044200Z

@ajsnow2012 there is no such thing as deploying a "shadow app as a jar". the output shadow-cljs produces is javascript which no presumption about which server you are going to use. shadow-cljs itself is never part of the server and shouldn't be. its job is just building the output and staying out of your production environment completely.

thheller 2021-01-25T09:15:57.045200Z

so anything that is capable of serving static files is fine. I don't know heroku but I'd assume there is something to do that

thheller 2021-01-25T09:16:31.046Z

I personally just build stuff locally and then copy the output to a static webserver

thheller 2021-01-25T09:17:04.046600Z

of course if you need anything server-side you can do that as well but shadow-cljs doesn't handle those parts. I use lein for that.

2021-01-25T10:46:35.047500Z

some of my coworkers got a delay on compiling since from saturday

2021-01-25T10:47:08.048400Z

and now when he tries to open the application, it never loads, only in incognito mode

2021-01-25T10:47:19.048700Z

anyone here had some issue like this?

2021-01-25T10:47:37.049200Z

I don't understand why he is having this issue

thheller 2021-01-25T10:47:45.049400Z

sounds like a cache issue? maybe a service worker?

2021-01-25T10:49:28.050100Z

he deleted npm_modules/, .shadow-cljs/

2021-01-25T10:49:34.050300Z

and installed it again

2021-01-25T10:49:50.050500Z

but it not worked

2021-01-25T10:50:03.050800Z

any thoughts on debugging this?

2021-01-25T10:51:13.051200Z

in "normal mode" he is having a 304

2021-01-25T10:51:26.051500Z

and in "incognito mode" he is having 200

thheller 2021-01-25T10:51:27.051700Z

sounds like a cache issue? maybe a service worker?

2021-01-25T10:51:44.052300Z

he does not have a cache in the browser

2021-01-25T10:52:01.052700Z

i don't know how to debug a "service worker" sorry

2021-01-25T10:52:09.053Z

😞

thheller 2021-01-25T10:52:09.053100Z

first confirm that non is active

2021-01-25T10:52:18.053300Z

where?

thheller 2021-01-25T10:52:40.053600Z

in chrome devtools under Application

2021-01-25T10:53:25.054200Z

thheller 2021-01-25T10:53:43.054800Z

304 is something the server sends so make sure you are using the correct server. it is not something the client can produce without a service worker.

thheller 2021-01-25T10:53:50.055Z

might be browser extension also

thheller 2021-01-25T10:55:01.055500Z

304 is fine but it does point to a cache issue

thheller 2021-01-25T10:55:15.055900Z

so maybe there is some old bad html cached somehow

thheller 2021-01-25T10:55:34.056200Z

I don't know what your actual issue is so I can't help much

thheller 2021-01-25T10:55:44.056400Z

> it never loads

thheller 2021-01-25T10:55:50.056600Z

is there an error in the console?

thheller 2021-01-25T10:55:54.056800Z

something must happen

2021-01-25T10:57:25.057300Z

no, only loads eternally

2021-01-25T10:57:27.057700Z

😞

2021-01-25T10:57:59.058300Z

strange that is happening for him and for another coworker but not with me

thheller 2021-01-25T10:58:44.058900Z

again. did you verify you are connecting to the correct server?

thheller 2021-01-25T10:58:54.059300Z

shut down shadow-cljs completely and open the page again

2021-01-25T10:58:59.059600Z

yeah,

2021-01-25T10:59:12.060Z

incognito goes well

thheller 2021-01-25T10:59:58.061Z

what server is this?

thheller 2021-01-25T11:00:31.061600Z

which shadow-cljs version is this?

2021-01-25T11:01:11.062400Z

he cleared the browser and the cache and everything and it went well

2021-01-25T11:01:29.062600Z

😞

2021-01-25T11:01:33.062800Z

2.11.14 => shadow-cljs

2021-01-25T11:02:15.063500Z

sorry to mess it but thanks anyway @thheller

2021-01-25T11:02:18.063700Z

🙂

simongray 2021-01-25T12:10:00.067200Z

Having trouble configuring a custom dev-http host. I have been using localhost:7000 so far to access my live-reloading page. I thought I might be able to better separate my different web projects (and their differing SSL requirements) by changing the default dev-http host, so I modified my shadow-cljs.edn to read:

simongray 2021-01-25T12:10:19.067600Z

:dev-http {7000 {:root "classpath:public"
                  :host "stucco"}}
rather than

simongray 2021-01-25T12:10:24.067800Z

:dev-http {7000 "classpath:public"}

simongray 2021-01-25T12:11:47.068600Z

but nothing is available at stucco:7000 . Am I misunderstanding something here? Do I need to configure something else for this to work?

thheller 2021-01-25T12:28:06.070Z

I'm guessing your dns doesn't resolve stucco to localhost

thheller 2021-01-25T12:28:17.070300Z

nothing to do with shadow-cljs, it can't configure your dns

thheller 2021-01-25T12:29:01.071Z

:host only does something if your machine has multiple ips so it knows which to pick but since it picks all by default that usually doesn't do anything

thheller 2021-01-25T12:29:30.071800Z

on macos I believe you can add stucco 127.0.0.1 so /etc/hosts

thheller 2021-01-25T12:29:42.072100Z

then it should be find with :dev-http {7000 "classpath:public"}

thheller 2021-01-25T12:29:53.072500Z

or I'm misunderstanding your problem if you already have that

thheller 2021-01-25T12:31:13.073400Z

http://foo.lvh.me:7000/ is typically useful too

thheller 2021-01-25T12:31:25.073900Z

that domain just points all subdomains to localhost by default

simongray 2021-01-25T13:01:27.074500Z

@thheller Thank you. That is probably it.