Fork me on GitHub
#shadow-cljs
<
2022-08-09
>
Chase00:08:11

So on deployment sites like and other heroku alternatives, they offer a free static site deployment. So what I was doing is compiling my shadow-cljs project in release mode on my computer and then pushing that whole project to github where it automatically gets deployed for me. So now I get to use their free deployment tier with no "sleep" mode like I have when deploying my full stack apps. Since I'm not including a Dockerfile to install java and compile it on their machines they are counting it as just a "static site." Does that sound reasonable or am I missing some obvious downside here?

Chase16:08:53

Thanks for sharing. I do a similar set up for my full stack apps: https://github.com/Chase-Lambert/clojure-app-template but in this case, I don't want the deployment steps to include java/Docker at all so that I can take advantage of these heroku style static site free deployments (with no "sleep" downtime). It seems to be working great after a couple of tweaks.

souenzzo16:08:39

I didn't know about this "static site" thing seems that PHP has this advantage. I will try to use this some day

souenzzo16:08:40

anyway, this is seems to be the path: • create the js bundle • create the index.html • pretend to use PHP

Chase00:08:22

2nd question, when looking at the network tab of my deployed pages/apps I'm noticing that it is downloading the main.js file as I expected but it's also downloading a react_devtools_backend.js file that is 578 kb. Is that too be expected (I'm thinking that's react itself so required) or is that an artifact from my development builds? If the latter, how do I remove that before uploading to github in the method I mentioned in my first question?

Chase00:08:58

Is that something that would be included in this cljs-runtime folder I'm seeing in resources/public/js and can I throw that in my .gitignore file when pushing to github? I'll try that and see what happens.

Chase00:08:18

Well I removed the cljs-runtime folder in the release deployment and it still works so I assume it's not needed. But it's still downloading the react_devtools_backend.js file which is killing my lighthouse performance score (getting a 62 with a simple "Hello World") but I hear that might be an overrated benchmark anyways I guess.

alex01:08:36

I believe React devtools will load up react_devtools_backend.js i.e. it only gets loaded when you open up devtools + have React devtools installed

Chase01:08:17

You nailed it. I forgot about that and it turns out I had turned it on for incognito mode too which I used to not have just for this reason. The performance score shot up to a 99 as I expected. Thank you!

thheller06:08:30

yes, the cljs-runtime dir is not needed for release builds.

thheller06:08:55

react_devtools_backend.js is indeed from the chrome extension and not something shadow-cljs bundles/produces

thheller07:08:09

also don't forget to create a build report to see what is in your main.js https://shadow-cljs.github.io/docs/UsersGuide.html#build-report

Chase16:08:04

Thanks for the clarifications. I will check that out.

lilactown16:08:46

does shadow-cljs support java 1.8?

thheller18:08:13

@lilactown no, not anymore. technically it does but the closure compiler recently moved to java 11 so shadow-cljs inherits that

lilactown18:08:10

yeah noticing that. ok thanks