Fork me on GitHub
#cljs-dev
<
2018-02-04
>
richiardiandrea03:02:07

I have another question, it seems like I have embedded source maps in my files...is ClojureScript able to consume embedded ones out of the box? They are produced by self-host (of course 😄).

//# sourceURL=ep_cloud/event_store/stm.js?rel=1517713267835
//# sourceMappingURL=data:application/json;base64,
If not, would it be complicated to add support?

mfikes14:02:18

@richiardiandrea In Planck, I have been ignoring the embedded source maps. Regardless, FWIW, source mapping is implemented in Planck with what is available in ClojureScript. For example

cljs.user=> (ffirst 1)
1 is not ISeqable
	cljs.core/seq (cljs/core.cljs:4415:17)
	cljs.core/first (cljs/core.cljs:4434:22)
	cljs.core/ffirst (cljs/core.cljs:5860:39)

richiardiandrea16:02:00

Uhm i will check Planck's code, thanks! The thing is that self host produces embedded only for things that are not core. The smaps for core are normal if you bundle them. So there is still some missing piece ?

mfikes16:02:04

There could be some improvements. I likely implemented Planck with what is available.

richiardiandrea18:02:14

Ok I checked and it seems like Planck creates and dumps its own source maps...`lumo` does not do that and let the self host machinery produce embedded ones

richiardiandrea18:02:16

A part from that, it is consumption that does not work, because embedded and file are different and source-map-support (JS lib used in cljs) needs some switch for embedded

mfikes18:02:46

@richiardiandrea Perhaps an improvement would be to somehow have source maps also provided in the callback, rather than only appended to the JS (or some more fine-grained control). If you add :source-map true, they will be appended but can also be fished out from under the :source-maps key of the state, which is the bit that could perhaps more simply be included in the callback.

richiardiandrea19:02:40

yep that could work indeed, I just thought that inline maps would be supported ootb by cljs core because they are emitted directly instead of normal ones by cljs.js ...I am playing with source-map-support right now to see if I can get a quick win

richiardiandrea22:02:04

@U04VDQDDY sorry for the ping, but do you remember you did something special for source maps under :source-maps? I don't really see them there

richiardiandrea22:02:34

ok I take it back, i seem to see them