I came across the JS Modules (Alpha) and gave following the implementation a go.
After an hour of getting Error: Cannot find module '@cljs-oss/module-deps' or the script not running due to the module not being provided (no matter what I do), I don’t want to sink any more time into before see if others have had luck following the guide.
If you have any suggestions or a repo to share with a working example, it would be much appreciated.
You must like pain. Most people use shadow-cljs or figwheel, at least for development.
I’d say all of the described stuff in that post should be considered dead and unsupported. And more importantly you most likely don’t need any of it anyways. Say you want to write some JS code and use it from CLJS.
Assuming your source path includes src/main and your CLJS namespace is demo.app. So you’d have a src/main/demo/app.cljs. You can create a src/main/demo/foo.js file.
In that file write
goog.module("demo.foo");
exports.foo = function(x) { return x + 1; };
Thats it. Doesn’t require any configuration. shadow-cljs has extended support for using ESM/CommonJS code directly, but goog.module should work everywhere without extra config.
As for the transform stuff I’d keep that out of the CLJS tooling completely.
I concur, have used shadow-cljs personally and professionally. As an aside, appreciate the work and time you’ve put into shadow-cljs and for taking the time to respond to my query!