Clojurians
#lumo
<
2018-01-20
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

cjsauer02:01:38

Is it possible to compile modules consumable from JS in lumo? Something like how shadow-cljs does it: https://shadow-cljs.github.io/docs/UsersGuide.html#target-node-library

richiardiandrea02:01:48

@cjsauer lumo runs within node so it shares all the module dependency mechanisms of node. This means you just require a module that you previously installed with npm and it just works. The syntax for requiring is the same as cljs: either in a :require or by using js/require (former is cooler :smile:)

cjsauer16:01:04

@richiardiandrea appreciate the reply. What about the other way around? Is it possible to compile cljs into a JS module, and then import it like so from JS:

import myCljsModule from './path/to/compile/module.js';
shadow-cljs does it like so: https://shadow-cljs.github.io/docs/UsersGuide.html#target-npm-module But I'm curious to see if I can get off the JVM entirely...

cjsauer16:01:02

My whole company is pretty JS heavy, so convincing them to switch the entire ecosystem has proven difficult. Instead, I think it'd be cool to treat cljs kind of like coffeescript, where it exists right along side the standard JS build tools (webpack, etc)

richiardiandrea16:01:10

@cjsauer yes that is doable as well, lumo also has some convention when importing other cljs npm modules. It uses the directories key of package.json for the source folder. It is still a bit experimental though