Fork me on GitHub
#re-frame
<
2023-12-21
>
Idan Melamed18:12:43

Hi, happy holidays. I'm trying to deploy a re-frame app to Netlify, but they only support https://docs.netlify.com/configure-builds/available-software-at-build-time/. Any suggestions? Where do you host your re-frame apps?

p-himik18:12:44

Doesn't seem to be relevant to re-frame at all?

Idan Melamed18:12:30

I'm getting

this version of the Java Runtime only recognizes class file versions up to 52.0
And there's no way to change the Java version.

p-himik18:12:18

Right, but it's not about re-frame at all.

Idan Melamed18:12:13

Where should I take this? #C6N245JGG ?

p-himik18:12:11

FWIW, I just build my apps locally and then deploy the resulting artifacts. > Where should I take this? #C6N245JGG ? I really doubt shadow-cljs has anything to do with it either. It looks like one of the built-time dependencies that the build process tries to load is either a Java-based JAR or an AOT'ed Clojure JAR that has been compiled with a javac version from JDK that's newer than 8.

p-himik18:12:32

The full error text should contain the name of the class that's the issue. Seems that Google Closure Compiler requires JDK >= 11, so you're out of luck.

p-himik18:12:50

The easiest and simplest solution is to avoid building stuff remotely altogether. I have started building locally years ago, and it's been a bliss compared to all the crap people have to deal with when building remotely on a third-party platform they have little control over, such as Heroku or Netlify.

Idan Melamed18:12:37

Yeah, that's a good advice, thanks. Where do you host your artifacts?

p-himik18:12:06

Depends on the project, and that doesn't really matter in this case.

Nundrum18:12:18

Looks like there has been some talk about the Netlify Java version. And they suggest some workarounds. https://answers.netlify.com/t/java-11-support/67078/3

p-himik18:12:30

Even if there's a workaround, I still would recommend against that approach. :)

p-himik18:12:19

IMO the best approach currently is to either use some service to upload the "raw" artifacts themselves if you only need to host some frontend (i.e. put index.html and some JS/CSS/other assets to some remote location), or use a service that can accept deploys via OCI container images (Docker, Podman, whatever). It'll take you less than a day to learn most of what you need to learn to use containers to your advantage, if you don't already know how to use them. And it'll be an infinitely flexible breeze from there, without any garbage like Heroku buildpacks.

Idan Melamed18:12:12

I found that I can build locally, and use the Netlify CLI to push the artifacts. Thanks for the help.

Idan Melamed18:12:12

What did you end up doing, downgrading shadow-clj?

Jacob Emcken18:12:10

At first yes... then I looked into how I could install Java everytime: https://gist.github.com/jacobemcken/86bf32af31b386457209e736ffdbfd73 I download Java (to cache) and install it. On the next run I check the cache and install it again (basically unzip). So it doesn't add too much overhead. I also found a way to make sure that Maven cache is maintained (which it for some reason isn't - and Netlify support didn't want to look further into it). Because I was seeing the same jar files being downloaded on every build. let me know if you are able to use something from the gist.

Jacob Emcken18:12:21

my goal was to be able to run the same release command locally as on Netlify. I should probably have added some kind of md5sum check or similar of the downloaded file... but I have abandoned the project, so I never got around to do that.

Idan Melamed19:12:28

Oh, that's a great idea! Thanks.