hi guys, is there any good example using lumo with Google Cloud Functions ? or can we compile cljs within lumo to js then run it with Google Cloud Functions ?
hey @nxq I created a home action using clojurescript hosted in aws lambda, unfortunately that code is private š
I used this library to do most of the wrapping https://github.com/nervous-systems/cljs-lambda, not sure if itāll be helpful
Thanks for your info. I will check it out.
I just setup a simple lumo build with (.log js/console āHiā) source file. It takes 70s to build on my 3-year-old i7 MBPro and if I change :optimizations to anything other than advanced it barfs a meaningless error. Any pointers?
what's the barf, are you using lumo.build-api/build
?
this works (fast) compil1.cljs
(ns compil1)
(println "hello world")
build.cljs
(require '[lumo.build.api :as b])
(b/build "./"
{:main 'compil1
:output-dir "out"
:optimizations :simple})
% lumo build.cljs
(require ā[lumo.build.api :as b]) (b/build āsrcā {:main ālumo1.core :output-to āmain.jsā :optimizations :none :target :nodejs})
(ns lumo1.core) (.log js/console āHiā)
try it on my computer...
this most likely means that the build didn't locate any file
It worked with :optimizations :advanced
If you call a 70s compile āworkedā
no, yes
you're right, I get the same
I had to move from src to same working directory too. Feels like the source file lookup is broken. But anmonteiro would know better.
70s is the time needed for advanced I guess, since it isn't using any cacheing. Lumo is usually slow to start the first time because of that.
I took the code sample from his blog as well: https://anmonteiro.com/2017/02/compiling-clojurescript-projects-without-the-jvm/
are you using lumo with node8.0.0?
Sorry, what do you mean by āfirst timeā? I donāt see anything resembling incremental compilation in a simple tool like Lumo.
Lumo uses its own Node version, no?
Yes, Iām using Node 8.0 otherwise.
it compiles node, you can see the version when you start lumo
The version in Lumo differs from my installed version
ok so it's the last release, I also see that this only happens with :optimizations :none, :whitespace and :simple work.
so yes, you want to create a ticket?
:whitespace didnāt work for me
yes, not for me either sorry
I'm running on node 8, latest master of lumo. So it's still a problem.
Hmm. I think the fanfare needs to die down a bit before Lumo is usable. Sorry.
I don't know where you got your high assumptions from.
https://anmonteiro.com/2017/05/on-lumos-growth-and-sustainability/
If you ask me, I don't see any fanfare because very few people are using lumo, especially not the build.api whereas jvm cljsbuild is much more battle tested and with figwheel development. The fact that it's so little used is one big factor why this has been overseen.
Well, thatās my point really. The Lumo REPL canāt use Clojure libs and I donāt see any advantage over lein-cljsbuild + nodemon as far as compilation speed goes.
yes, I would never use lumo to do frontend development at this point in time.
My mistake. I just saw the blog post and assumed Lumo had taken off.
@clojer I never said Lumo was ready for general usage, especially the build API
Lumo is great for scripting
If you read my blog post about compiling projects, you probably noticed: 1. It's an alpha feature 2. The slow compile times are coming from the Closure Compiler JS upstream
It's not related to first time or not
@clojer I really appreciate you trying out Lumo! But I don't think it's helpful to complain about goals that the project never had (being faster than the JVM to compile - simply because JVM CLJS will probably always be faster)
We're well aware there are issues, and every bit of help is necessary to fix them, be it reporting bugs, trying new features or even lending a helping hand and fixing them
@clojer why exactly canāt you use clojure libs? you mean jvm clojure libs?
Hey, any reason why the ZMQ npm module isn't loading? Here's my script: https://github.com/paullucas/lumo-misc/blob/master/zmq/zmq-test.cljs I'm getting the following error:
libstdc++.so.6: cannot open shared object file: No such file or directory
Object.Module._extensions..node (module.cljs:598:18)
Module.load (module.cljs:488:32)
tryModuleLoad (module.cljs:447:12)
Function.Module._load (module.cljs:439:3)
Module.require (module.cljs:498:17)
require (internal/module.cljs:20:19)
Object.<anonymous> (/home/plll/Code/lumo-misc/zmq/node_modules/zeromq/lib/index.cljs:6:11)
Module._compile (module.cljs:571:32)
Object.Module._extensions..js (module.cljs:580:10)
Module.load (module.cljs:488:32)
@paulll need more info about your setup
Linux?
Yup! NixOS.
Lumo version?
Lumo 1.5.0
ClojureScript 1.9.542
Node.js v7.10.0
hrm
so hereās what I think is happening: ZeroMQ has some native module and it canāt link against NixOSās weird paths
@paulll my theory will be wrong if youāre able to load the module in Node.js
Hmm, I am able to run it with Node. Ran the publisher example and it seems to work:
var zmq = require('zeromq')
, sock = zmq.socket('pub');
sock.bindSync('<tcp://127.0.0.1:3000>');
console.log('Publisher bound to port 3000');
setInterval(function(){
console.log('sending a multipart message envelope');
sock.send(['kitty cats', 'meow!']);
}, 500);
thatās weird
it might be related to https://github.com/anmonteiro/lumo/issues/163
but it could also be some Nix issue š