Fork me on GitHub
#shadow-cljs
<
2020-06-06
>
David Pham09:06:52

How can you achieve the same thing with node is script? That is compiling all dependencies into a single is file when you want to release the script?

thheller09:06:28

I recommend post-processing the file with https://github.com/vercel/ncc

thheller09:06:48

shadow-cljs can also do that on its own but its less reliable and requires more configuration

jjttjj16:06:04

@thheller you responded when this was brought up recently in another channel: andare (self host compatible core.async: https://github.com/mfikes/andare), doesn't work with shadow due to this function https://github.com/thheller/shadow/blob/master/src/main/shadow/util.clj#L29, specifically the :require on [cljs.core.async.impl.ioc-macros :as ioc] which isn't in andare. Was wondering now if you'd consider removing it or gutting it of the internal async stuff. I've removed it locally and have had no problems running my regular shadow workflows, for what that's worth. Andare's implementation is probably not ideal but seems like the best way to accomplish getting core.async on self-hosted cljs for now. You might have a better sense if anyone is using that go! macro though.

thheller17:06:17

I can remove it ... created it a long time ago and there's even a ticket for it but doubtful anything will ever happen about it

👍 4
thheller17:06:01

not that important anyways. core.async was a bad fit for want I wanted it for anyways 😛

jjttjj17:06:24

Awesome, thanks!

thheller17:06:20

gone in [thheller/shadow-client "1.3.3"]

parrot 4
thheller17:06:32

probably will make a new shadow-cljs release a bit later too

thheller17:06:06

still feels kinda dangerous to just replace a fairly integral dependency like core.async but I guess andare probably just leaves the clojure.core.async stuff alone and modifies only cljs.core.async

jjttjj17:06:11

Yes I believe there are no changes to the clojure part

jjttjj17:06:28

It's definitely a hack but it gets the job done for now

andrewboltachev16:06:06

@thheller just FYI: this is one minimal snippet I was able to produce on which GCC (`v20200504`) would fail:

function aa() {
    var a = {}, b = null;
    a.a = 1,
    b.a = 2,
    Object.defineProperties(a, b);
}
Latest master of GCC produces the same error (just double-checked that)

thheller17:06:35

@andrewboltachev odd code. did you report it?

andrewboltachev17:06:50

@thheller not yet actually. But this is my code. Actual one looks more like this: http://dpaste.com/1053C50#line-87

andrewboltachev17:06:21

which comes from that "turf jsts" module (it's min version, which I've beautified)

andrewboltachev17:06:34

the selected line confuses the GCC

andrewboltachev17:06:30

if replaced with sth = Object.defineProperties(Bi, Vi); it would pass

andrewboltachev17:06:37

what it's doing is about that: this Bi object just got an update with Object.defineProperties by adding some Vi properties to it. But the object isn't used anymore so it wants to optimize that extra work (calling Object.defineProperties) away

thheller17:06:50

hmm yeah no clue. the code looks valid to me so must be a bug in closure

thheller17:06:45

defineProperties has no return value I think. it just modifies the first argument in place

thheller17:06:02

so that should work fine

andrewboltachev17:06:24

but having that Bi (or a in my case) won't be used anymore

andrewboltachev17:06:36

won't it want to optimize it away?

thheller17:06:37

just include your shortened example and the original code in the report

thheller20:06:51

its usually a good idea to include a stacktrace of the actual crash. might want to add that.

thheller17:06:10

you can reproduce the error with the web interface which helps