News for hackers. Stuff that matters.
Re:Cherry: ClojureScript to ES6 Compiler by Mikeb85 on Tuesday November 01, 2022 @03:24PM (#33426145)
> Genuine question: Why ES6?

Because CommonJS is dead and only continues to be supported because of all the old NodeJS stuff written in it.

The whole point of ClojureScript is to target the browser since Clojure itself targets the backened; well every browser supports ES6.

Re:Cherry: ClojureScript to ES6 Compiler by leidenfrost on Tuesday November 01, 2022 @03:33PM (#33426273)
That's true.

Maybe not CommonJS but a version of JS compatible with LTS Node. That way you can develop with ClojureJS also on the Back End.

Re:Cherry: ClojureScript to ES6 Compiler by askonomm on Tuesday November 01, 2022 @03:42PM (#33426418)
You can already develop with ClojureScript on the back-end. A popular ClojureScript compiler, Shadow-CLJS (https://github.com/thheller/shadow-cljs) has a target for Node among many others.
Re:Cherry: ClojureScript to ES6 Compiler by wiredearp on Tuesday November 01, 2022 @03:55PM (#33426603)
ES6 is compatible with Node out of the box.

You can `import` and `export` just like in the browser (and in TypeScript) as long as your files come with the `.mjs` extension. Cherry adds this extension by default, so I imagine it comes with the server in mind.

You can also keep the `.js` extension and configure this behavior in the `package.json` to run the same files both client- and serverside.

Some libraries still expect to run as CommonJS, but then you might find an "es" version if you poke around in their repositories.

Re:Cherry: ClojureScript to ES6 Compiler by kitten_mittens_ on Tuesday November 01, 2022 @04:48PM (#33427279)
The LTS version of node is now 18, which supports its special flavor of ESM.