Clojurians
#lumo
<
2017-09-19
>

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

honzabrecka10:09:18

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. :slightly_smiling_face: https://github.com/honzabrecka/lumo-docker

borkdude14:09:52

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?

richiardiandrea14:09:15

@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.

dominicm14:09:02

(js/require "dep")

honzabrecka15:09:44

@borkdude Or create deps.cljs with :npm-deps map and require them as cljs ones.

borkdude15:09:42

yarn add sharp
lumo
(require '[sharp :as s])
(-> "test.jpg" s (.resize 100 100) (.toFile "output.jpg"))
works

borkdude15:09:04

just via the ‘normal’ cljs require :slightly_smiling_face:

richiardiandrea15:09:08

The new lumo supports ns require @dominicm Antonio fixed it :)

richiardiandrea15:09:38

Lumo at the moment is the closest to the JS workflow

richiardiandrea15:09:57

That's quite awesome indeed

anmonteiro15:09:14

Btw Lumo 1.8.0-beta is just out

anmonteiro15:09:52

I've prepared a blog post that I'm publishing in a litttle while because this is a significant release

anmonteiro16:09:57

@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)

anmonteiro16:09:22

(Where foo is a Node module!)

anmonteiro16:09:52

This is 1.7+

borkdude16:09:08

ah, amazing, that would make working with d3 a lot better for example… if only this was supported in clojurescript itself… or is it?

anmonteiro16:09:31

Module processing / npm module support

borkdude16:09:38

:astonished:

borkdude16:09:06

so cljsjs will kind of become obsolete this way maybe?

honzabrecka16:09:30

no, you still need externs in advanced compilation

anmonteiro16:09:45

CLJSJS would be mostly for externs

anmonteiro16:09:43

This is getting serious attention from the CLJS team

anmonteiro16:09:05

We have even gone further and put together patches in Google Closure

anmonteiro16:09:58

It's also what I'm going to be speaking about at the Conj

borkdude16:09:18

Looking forward to the talk!

dominicm16:09:04

Wish I could make it to the conj

jonpither19:09:58

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)?

anmonteiro19:09:53

@jonpither not yet

anmonteiro19:09:09

this is actually CLJS project compilation

bspaulding20:09:50

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?

anmonteiro20:09:41

@bspaulding not yet there

bspaulding20:09:49

ah, dig. :thumbsup:

anmonteiro20:09:59

use build for now

anmonteiro20:09:03

it’s planned and I’m working on it

anmonteiro20:09:23

well it’s commented out

bspaulding20:09:32

cool, thanks! this proj is awesome, btw. love it

bspaulding20:09:49

ahh, ok. sorry for newb qs. haven’t seen #_( yet