Hey, I prepared a docker images with lumo + boot, npm (yarn). So one does not need to mess up his computer with boot or npm to be able to try lumo with eg. “node-fetch” or “promesa” dependencies. 🙂 https://github.com/honzabrecka/lumo-docker
is there any documentation for using npm modules from lumo? I saw the demo in the talk I believe, but can’t find anything on it in the repo?
@borkdude not that I know of, but it is basically transparent to you, you install the JavaScript npm dep using yarn or npm and require it using standard cljs syntax. Lumo being in Node knows what to find and where to find it.
ah
(js/require "dep")
@borkdude Or create deps.cljs with :npm-deps map and require them as cljs ones.
yarn add sharp
lumo
(require '[sharp :as s])
(-> "test.jpg" s (.resize 100 100) (.toFile "output.jpg"))
worksjust via the ‘normal’ cljs require 🙂
The new lumo supports ns require @dominicm Antonio fixed it :)
Yep
awesome
Lumo at the moment is the closest to the JS workflow
That's quite awesome indeed
Btw Lumo 1.8.0-beta is just out
I've prepared a blog post that I'm publishing in a litttle while because this is a significant release
@borkdude to blow your mind a little bit more, this works too:
(require 'foo)
(foo/bar)
For things where you'd usually do (.bar foo)
(Where foo
is a Node module!)
woaaaah
This is 1.7+
ah, amazing, that would make working with d3 a lot better for example… if only this was supported in clojurescript itself… or is it?
It is :-)
Module processing / npm module support
😲
so cljsjs will kind of become obsolete this way maybe?
no, you still need externs in advanced compilation
Aka CLJS is not an island and the post I wrote for the CLJS blog in July: https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules
CLJSJS would be mostly for externs
Will*
ah yes
This is getting serious attention from the CLJS team
We have even gone further and put together patches in Google Closure
It's also what I'm going to be speaking about at the Conj
Looking forward to the talk!
Wish I could make it to the conj
Nice work on the new Lumo version @anmonteiro. Does this mean that the JS compile cache Lumo produces can be optimised further (google Closure style)?
@jonpither not yet
this is actually CLJS project compilation
Invalid :refer, var lumo.build.api/watch does not exist
looks like watching is implemented, is there a different, preferred way to do this? or just not exposed yet?
@bspaulding not yet there
ah, dig. :thumbsup:
use build
for now
it’s planned and I’m working on it
i saw https://github.com/anmonteiro/lumo/blob/937ee923acb05e88c48e0e3291a35d2a1d7f8be4/src/cljs/bundled/lumo/closure.cljs#L2351 and had hope 🙂
well it’s commented out
cool, thanks! this proj is awesome, btw. love it
ahh, ok. sorry for newb qs. haven’t seen #_(
yet
np!