Clojurians
#lumo
<
2018-04-15
>

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

jiyinyiyong06:04:56

=>> node out/main.js
/Users/chen/repo/gist/lumo-api/out/main.js:1
(function (exports, require, module, __filename, __dirname) { goog.addDependency("base.js", ['goog'], []);
                                                              ^

ReferenceError: goog is not defined
    at Object.<anonymous> (/Users/chen/repo/gist/lumo-api/out/main.js:1:63)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)
    at Function.Module._load (module.js:507:3)
    at Function.Module.runMain (module.js:703:10)
    at startup (bootstrap_node.js:193:16)
    at bootstrap_node.js:660:3
=>> lumo build.cljs
Assert failed: :nodejs target not compatible with :whitespace optimizations
(not (and (= target :nodejs) (= optimizations :whitespace)))
	 (Object.lumo$closure$check_node_target)
	 Function.lumo.closure.build.cljs$core$IFn$_invoke$arity$3 (evalmachine.<anonymous>:4430:14)
	 Function.lumo.build.api.build.cljs$core$IFn$_invoke$arity$3 (evalmachine.<anonymous>:594:31)
	 Function.lumo.build.api.build.cljs$core$IFn$_invoke$arity$2 (evalmachine.<anonymous>:524:29)
	 lumo$build$api$build (evalmachine.<anonymous>:510:29)
	 (evalmachine.<anonymous>:2:22)
	 ContextifyScript.Script.runInThisContext (vm.cljs:50:33)
	 Object.runInThisContext (vm.cljs:152:38)
	 (Object._t)
	 (Object.lumo.repl.caching_node_eval)

=>> lumo build.cljs

jiyinyiyong06:04:11

compiling ClojureScript code with Lumo is not good experience

jiyinyiyong06:04:37

and the last command just hangs. probably it's because it's slow.

jiyinyiyong06:04:05

I don't know how to use it...

jiyinyiyong06:04:47

src/app/main.cljs

(println "Hello world!")
build.cljs
(require 'lumo.build.api)

(lumo.build.api/build "src" {:output-to "out/main.js"
                             :optimizations :simple
                             :target :nodejs})

jiyinyiyong06:04:55

maybe I'm wrong.

jiyinyiyong06:04:41

I thought I could add an example that beginners can compile ClojureScript code to Node.js and run node out/main.js in a few steps. Turned out not as simple as I thought.

dehli12:04:25

You can compile it using clojure just as easily. That's what I'm doing and it's working well

richiardiandrea15:04:48

@jiyinyiyong the GCC compiler for js is not as fast as the Java one for sure and there are lot of things that might go wrong. I am compiling with JVM at the moment as well