Fork me on GitHub
#cljs-dev
<
2017-07-21
>
thheller08:07:40

@mhuebert if you just want to know the macro namespaces the data should already be available, getting the dependencies of macro namespaces however is much trickier

thheller08:07:52

since clojure is much more dynamic than CLJS

mhuebert08:07:44

@thheller is that because of dynamic statements outside of (ns..) forms that wouldn’t be captured by traversing with a parse-ns-style function?

thheller08:07:04

load-file as well, or rather load

thheller08:07:32

tools.namespace has some things but they only work reliably when you actually load all namespaces

thheller08:07:14

ns in CLJS is never eval’d and only static information

thheller08:07:28

in CLJ it is actually a macro

thheller08:07:34

but you can get far enough with just parsing the ns

thheller08:07:40

it just won’t be complete

thheller08:07:13

but should be good enough since macro namespaces intended for CLJS don’t get very complex usually

thheller08:07:19

and don’t pull in too much CLJ code

thheller08:07:11

I can recommend using the clojure.core.specs.alpha specs to parse the ns form

thheller08:07:19

but tools.namespace really should have everything you need

mhuebert08:07:28

So I suppose when bundling for self-host, we’ll only need to worry about precompiling macros that work in cljs. We can use other (precompiled) dependencies that use Clojure-specific macros, but those macros don’t come along for the ride

thheller08:07:18

I have never actually used self-host, I don’t even know how the macros work there 😛

mhuebert08:07:07

there is some weirdness subtlety

mhuebert08:07:56

so if limiting to self-host-compatible macro files, then using cljs.analyzer to get the ast of the ns form should be ok (found that via analyzer.api/parse-ns)

thheller08:07:21

CLJ ns is a bit different and some things won’t be supported

thheller08:07:26

oh parse-ns might not work since it assumes to read from the file right?

thheller08:07:13

hmm yeah, it will read the file with :read-cond :cljs

mhuebert08:07:36

I’m not using parse-ns directly but pulled out the important parts

thheller14:07:31

is there an example repo that does :advanced compilation of react? (with all the required workarounds)

thheller15:07:11

hehe thx, I found that like 5min ago

thheller15:07:18

I remembered you did something like that

thheller15:07:43

why do you include ALL externs? it seems that only the plugins are required?

thheller15:07:58

or is there anything else I might be missing? only testing on a very basic example currently

Roman Liutikov15:07:42

I don't know if it's because Rum or Sablono is using some interop unsafely, but in case of this app it's not only event plugins

Roman Liutikov15:07:51

Too lazy to find out :)

anmonteiro17:07:46

wasn’t CLJS 6 yesterday?

anmonteiro17:07:55

this says 7/20/2011

moxaj18:07:11

the boostrap powershell script (and some others) is out of date, should I open a jira ticket for that, or pr?

mfikes18:07:05

@moxaj I’d recommend opening a JIRA, and if you’ve signed the CA, submit a patch that fixes them

mfikes18:07:35

Also, @moxaj you could add an analog of script/clean if you have one