Fork me on GitHub
#cljs-dev
<
2016-11-10
>
mhuebert13:11:35

Hi all, I’ve spent a couple days working on packaging dependencies for use with the self-hosted compiler in browser environments. I’m not sure what else is being done here, or what an ideal approach would look like, but I’ve got a few things working: Examples - https://cljs-live.firebaseapp.com/ Source - https://github.com/mhuebert/cljs-live

richiardiandrea15:11:08

@mhuebert some time ago I also wrote a boot task for collecting source files and move them to a path, ready for self-host *load-fn*: https://github.com/Lambda-X/boot-pack-source

jrheard17:11:43

@viebel will probably be super interested in these messages

Yehonathan Sharvit17:11:36

@jrheard thanks. I’m looking at it

Yehonathan Sharvit17:11:12

@mhuebert did you try to use your packages inside klipse with the external-libs url parameter

mhuebert17:11:41

@viebel nope, but i’ll have a look!

Yehonathan Sharvit17:11:44

https security issues

mhuebert17:11:18

hmm, what does it say?

Yehonathan Sharvit17:11:12

Sorry. It works. It’s just that I’m on a very slow connection

mhuebert17:11:26

ah. and the payloads are big.

Yehonathan Sharvit17:11:51

yeah self-hosted cljs cannot be advanced compiled 😞

mhuebert18:11:56

have you noticed any differences between (ns my-ns.core (:require …)) vs. (require ‘[..])? Some of my examples don’t work unless I use the (ns..) form and i’m not sure why

mhuebert18:11:25

unfortunately you can’t reproduce it exactly on that webpage, because so long as any (ns ..) form has been loaded, there is no problem. But both the goog.events and quil examples fail if they are run before a ns form.

mhuebert18:11:00

anyway I just thought there might be a known difference. i’ll track it down

mhuebert18:11:32

it was something about supplying a quoted symbol as the :ns option to the compiler

Yehonathan Sharvit18:11:10

@mhuebert can you come to the #klipse channel?

anmonteiro22:11:31

@dnolen have you ever tried loading foreign libraries with Self-hosted CLJS + Node.js?

anmonteiro22:11:52

I found something which I'm not sure it's a bug in the compiler or not.

anmonteiro22:11:34

so because foreign-libs (in CLJSJS, at least) are packaged as UMD modules, requiring them in Node.js (where module is present) won't actually side-effect the global scope

anmonteiro22:11:07

so to make it work currently I have to:

(with-redefs [js/module js/undefined]
      (js/eval source))

dnolen22:11:36

right you have to replicate what we do for ClojureScript Node.js REPLs

anmonteiro22:11:52

oh, where can I find that code?

anmonteiro22:11:02

not a bug in the CLJS compiler then 🙂

dnolen22:11:18

bootstrap_node.js

dnolen22:11:13

has to load before anything else

dnolen22:11:35

many annoyances of Node.js are circumvented here

dnolen22:11:41

including reloading of libs

anmonteiro22:11:08

oh there you go

anmonteiro22:11:23

you also set module to undefined

anmonteiro22:11:12

@dnolen is this bootstrap_node.js only run for REPLs or appended to :target :nodejs builds too?

dnolen22:11:57

you need it regardless if you’re not building a single file

anmonteiro22:11:59

oh right, I'm building with :simple so that's why I'm not seeing it

anmonteiro22:11:38

hrm seems my problem is a bit different though

anmonteiro22:11:14

I think I just need to do this when requiring foreign-libs

anmonteiro22:11:25

I can't think of anything else for which this is needed

richiardiandrea23:11:28

So (lazy question) @anmonteiro is lumo a self hosted repl or fully fledged? Good job, I tried it and it is fast!

anmonteiro23:11:53

@richiardiandrea what's your difference between self hosted and fully fledged? 🙂

richiardiandrea23:11:00

Mmm maybe I am wrong and not up to date then 😄

anmonteiro23:11:54

not your problem, it's just I don't understand what you're asking

richiardiandrea23:11:59

Actually if there is parity, especially in macro management, it should not matter

richiardiandrea23:11:19

Fully fledged in my mind still needs java

anmonteiro23:11:57

oh no, it's self-hosted then

anmonteiro23:11:07

there's no Java involved

richiardiandrea23:11:28

Awesome, are you using inf-clojurebwith that?

anmonteiro23:11:42

not yet, but I plan to add support for a socket REPL

anmonteiro23:11:27

anyway, let's move this somewhere else, folks might not be interested in Lumo talk in this channel 🙂

richiardiandrea23:11:35

Yep cool i'll check there I did not notice I received a notification in my email, thanks!