Fork me on GitHub
#lumo
<
2018-03-29
>
Jon02:03:52

first prototype on home page, still thinking about what to show http://lumo-cljs.org/

Jon02:03:02

is this logo the final one? I need to update the logo in the page, looks a bit strange

Jon02:03:21

it's not exactly squared.

Jon02:03:28

probably we need to adjust the font size of "LUMO" to make look more consistent.

Jon02:03:10

not even aligned to each other

richiardiandrea03:03:08

the website looks neat 😄 are you hosting it? 😄

Jon05:03:24

yeah, on my server, on Aliyun

hlolli09:03:14

I still haven't received a LUMO sticker, Antiono had them, but haven't bumped into him for more than a year

danielo51510:03:01

Hello, is people around here?

danielo51510:03:04

How can I use source-map support with lumo =

hlolli11:03:35

@rdanielo

(require 'lumo.build.api)

(lumo.build.api/build
         "samples/hello"
         {:optimizations :none
         :output-to "samples/out/hello.js"
         :output-dir "samples/out"
         :cache-analysis true
         :source-map true
         :verbose true
         :watch-fn
         (fn []
             (println "Success!"))})
example

danielo51511:03:58

That should be a build script right ?

hlolli11:03:00

yes, it could be a build script that you call with lumo

hlolli11:03:25

you can change build with watch and use the same parameters

danielo51511:03:09

Have you tried lumo-project?

danielo51511:03:26

I want to avoid build scripts, I'll prefer a build tool

danielo51511:03:37

I never make it work though

hlolli13:03:03

no, never tried lumo-project, since year I use lumo directly without tools, there are some tools that come and go, still open terretory for improvement and innovation.

hlolli13:03:42

not counting inf-clojure that I use for editing

danielo51513:03:00

inf-clojure?

danielo51513:03:23

How do you use lumo? I want to use it for compiling down no node scripts

richiardiandrea15:03:39

@rdanielo I have a repo that I use for sending lumo repro but you can explore it for some inspiration: https://github.com/arichiardi/lumo-repros/tree/master/scripts/lumo

richiardiandrea15:03:01

There are a bunch of scripts for compiling in there

danielo51515:03:16

People usually talk about JS fatigue, but I am finding so many cljs options to compile that I am very overwhelmed. So far I tried: lein, boot, lumo, shadow-cljs, clj + cljs.main .... And I can't understand the differences apart from startup time and the inability to use core.async on some of them

richiardiandrea15:03:28

If I remember correctly there was a problem with Google Closure Compiler (I patched it, will be in the next release) so for source maps we need to wait

richiardiandrea15:03:18

@rdanielo If you are learning the language, I would go for lein or boot, they are the most seasoned

richiardiandrea15:03:37

Also keeping in mind that we don't have the same number of contributors the Js has so docs / tooling is a bit less oiled

richiardiandrea15:03:20

Having said that once you are over the initial impact you will see only benefits to Cljs

richiardiandrea15:03:36

I use lumo + node every single day at work so there are some quirks but it is pretty smooth overall

danielo51515:03:58

Thanks for your kind words @richiardiandrea

danielo51515:03:24

I am a person that wants to test everything and see what it is better,t he problem is that I am never sure about what it's better

danielo51515:03:07

I was using lein, but the REPL is soooooo slow, and re-building is slow, and testing functions is slow. So slow that makes hard thinking about what I am trying to test

danielo51515:03:13

That's why I'm interested on lumo

danielo51515:03:05

By the way, using your build script I get the following error when running it:

danielo51515:03:10

ReferenceError: goog is not defined

danielo51515:03:18

May be because I set source-maps to true ?

danielo51515:03:07

Forget about it, it was my fault

danielo51515:03:15

My previous build script was wrong

hlolli15:03:08

@rdanielo in lein's defence, it's only slow to start, after that it's faster than lumo, because of the java engine. But you're right, the startup time keeps annoying me still to this day.

richiardiandrea15:03:46

It is good to test everything, I am like you, but when I need to get things done ...and to avoid frustration with tooling, something you have to compromise

danielo51515:03:00

Absolutely. I've been playing with tools for 2 days

richiardiandrea15:03:21

Lumo had many quirks at the beginning the the two people here plus most importantly Antonio helped fixing

richiardiandrea15:03:41

At the cost of being less productive at work 😃

danielo51515:03:56

Hello @hlolli there should be something bad about my configuration because the repl is itself slow

danielo51515:03:07

Evaluating any snippet of code on the REPL is slow as hell

hlolli15:03:25

what editor are you useing, or are ypu directly in the terminal?

danielo51515:03:50

I'm on mac, using iterm2 and zsh

danielo51515:03:21

wich uses figwheel

danielo51515:03:06

Using shadow cljs I am getting one single file which is about 850k while using lumo I am getting an entire folder full of JS which weights 3Mb

hlolli16:03:46

I think useing figwheel for node doesn't make sense, the only thing you get is probably the compilation reload which you'd get from cljs.build/watch in clojure or lumo. figwheel makes sense when developing react apps for the browser, didn't know this was even possible, maybe I'm being too negative about this combination, tough I love figwheel in the right combination. You can always use cljsbuild in leiningen and get watch function from there, then you have the dev enironment better configured, https://github.com/emezeske/lein-cljsbuild

hlolli16:03:39

and shadow-cljs is my favorite these days. The headache it saves boils usually down to the last step, advanced compilation, shadow automates and debugs that step amazingly well. And since recently, very well documented.

danielo51516:03:10

Yes, seems to be very straightforward and cool to use. It is a bit hard to find the examples, but they are very good

hlolli16:03:59

good point, it lacks examples, tutorials and tips/tricks blog posts. But much is coming out in last few weeks, very vibrant developments, and #shadow-cljs channel is good for any questions

danielo51516:03:44

I do really want the hot-reload experience. On one of the first templates I was using watch, because it had no figwheel , but I had no REPL

danielo51516:03:02

I really want REPL driven development, which is all people talk about on the clj conferences

hlolli16:03:36

hmm you can get that with lumo if you start socket server with a watch build script, then send code over the socket to eval and the build watcher that builds on save. I'd say the hot reload and repl driven development should be more clearly seperated buzzwords, if clojure speakers are guilty of throwing out buzzwords in conference talks.

hlolli16:03:45

I'd rather recommend shadow-cljs or lein-cljsbuild, to use the nrepl. I don't want to see any newcommer burn out too early 🙂

danielo51516:03:36

Thanks to this guide I get repl + hot-reload with shadow-cljs

danielo51516:03:54

It was pretty easy and fast, compared to the other approaches

danielo51516:03:54

However is a bit weird to have to run a watch build in one term and a repl on a different one. Ideally I want it just on one single operation

hlolli16:03:57

nice, good luck on your journey, no js fatigue here, we all have our original black(red/white/brown..etc...) colored hair on our heads 😄

danielo51516:03:43

Any fast way to load all the functions on a namespace and reload them ? I don't want to type require everytime

hlolli16:03:59

good question, clojurescript has nothing like clojure's :use. It sucks in many cases. It's kinda enforced good practice. But if you :require [ns :as n] then you can access all of it with n/function, also makes the code very readable. But yeh, still think this option to require all functions should be there, is sadly not.

hlolli16:03:57

and reading other peoples code, you just see symbol, and ask where did it come from, and almost no way to tell just by reading the file.

danielo51516:03:40

Coming from the JS world I prefer to see explicit/namespaced imports

danielo51516:03:09

However, when I am on a repl, I just want to test the functions on certain file... well, I don't want to write the require and namespace functions everytime

hlolli16:03:33

you can do (in-ns 'my.ns) and then they are all locally scoped

danielo51516:03:52

That sounds fine, I'll check

hlolli16:03:19

but you may need to require the file just to load the contents of the file into the repl

hlolli16:03:52

by doing (require 'my.ns) before (in-ns 'my-ns), you're not really requireing it to use it, just to load it

hlolli16:03:31

tough you theoratically could use fully qualified namespace to call the functions from there, but it's bad practice 🙂

danielo51516:03:49

It worked fine

danielo51516:03:04

I'm missing the tab-completion, but works very good

danielo51516:03:37

Another related question, Is this line (set! *main-cli-fn* -main) required with shadow-cljs ? Seems that it is specified on the edn file therefore not required on the file

hlolli16:03:07

I've never used this, but you could ask on #shadow-cljs

danielo51516:03:24

Hahahah, i've been jumping between slack channels for a while now

danielo51516:03:41

shadow-cljs is the tool with batteries included that I have been looking for. Seems to have the best of bootstrapped cljs tools and jvm based ones

danielo51516:03:08

It starts reasonably fast, repl is fast, config is minimal...

danielo51516:03:17

very amazing

hlolli16:03:48

well, ok, that's bit typical, I'd say socially on clojurians slack, talking about topic which is off the channel's topic triggers some people. Sometimes for good reason, sometimes just to be captain obvious.

danielo51516:03:11

The only downside is their webpage, seems to be focused on browser environments or browser targeted apps, while this is not true

hlolli16:03:47

yes, the main developers of shadow-cljs are mostly developing for the browser, I already made one app for node, and their two node build options :node-library and :npm-module work fine. For myself, I use it when I want to use cider (emacs plugin for clojure development) with node development.

danielo51516:03:38

Well, I am using a different target :node-script

danielo51516:03:45

Which works fine too