Fork me on GitHub
#cljs-dev
<
2019-05-06
>
lread22:05:28

So I bet this has been raised a hundred times. Sorry! But when I build ./script/build clojurescript, I notice that it modifies src/main/cljs/cljs/core.cljs and src/main/cljs/cljs/core.cljs with version numbers. When creating my patches I have been careful not to include the generated version numbers, which I assume is the correct thing to do. Have cljs team considered isolating version number generation to their own dedicated src or resource file(s)?

dnolen23:05:18

@lee undesirable

lread23:05:50

that’s not what my wife says

dnolen23:05:13

while it's annoying for us a bit

dnolen23:05:31

doing something else is even more fiddly, we'd have to modify building etc etc.

dnolen23:05:26

also would need to change REPLs to look for this

dnolen23:05:42

also would be a breaking change, or some kind of var hack otherwise

lread23:05:43

so, would you me open to me adding a note to https://clojurescript.org/community/building on this?

dnolen23:05:03

that would be nice, yeah

lread23:05:15

ok will do

lread23:05:31

might avoid someone asking about this the 101st time!

dnolen23:05:44

@lee I guess another option would be to build in a different temporary directory?

dnolen23:05:30

should probably look at how Clojure does this?

lread23:05:55

I’ll put it on my todos to have a peek.

thheller23:05:54

@dnolen any thoughts on emitting JS const/let in the CLJS Compiler (instead of var)? https://dev.clojure.org/jira/browse/CLJS-3077

dnolen23:05:20

@thheller I saw that, but what's the actual benefit?

thheller23:05:35

less code for modern browsers

dnolen23:05:10

like code size? but what are the savings?

thheller23:05:49

I didn't test that yet. Just wanted to hear your comments first.

thheller23:05:22

if you are not considering using const/let then I wouldn't try

thheller23:05:57

I just want to get rid of all those function wrappers since they do add up quite a bit

dnolen23:05:16

use to let to get the semantics

dnolen23:05:20

and let Closure sort it out

dnolen23:05:01

sure that's interesting!

dnolen23:05:14

would be nice to see some metrics before/after but yeah I like the idea

thheller23:05:13

sweet. I'll get on that then

thheller23:05:50

I verified that the closure compiler actually generates those wrappers if needed

dnolen23:05:20

makes sense

dnolen23:05:32

would be massive simplification really

dnolen23:05:53

we have a lot of ugly code to capture arguments

dnolen23:05:23

@thheller you might want to make a series of smaller tickets otherwise this one could get out of hand

dnolen23:05:34

since really if the first pass look promising we should just do this everywhere

dnolen23:05:37

and dump our stuff

dnolen23:05:20

@thheller one case that comes to mind is fn args

dnolen23:05:27

since those are mutable

thheller23:05:30

nice thing is that with the proper language out the wrapper just aren't there

dnolen23:05:34

you would need to immediately bind those no?

thheller23:05:35

since let deals with it

thheller23:05:12

yeah mean for fn/recur?

dnolen23:05:38

I mean (fn [a b] ...)

dnolen23:05:47

you want a and b to be const

dnolen23:05:52

yeah for the recur case

dnolen23:05:07

but we use CLJS let anyway

thheller23:05:11

recur pulls them into a let yeah

dnolen23:05:33

yeah seems promising

👍 4
lread23:05:39

Ok, I’ve finally submitted a patch for https://dev.clojure.org/jira/browse/CLJS-3074 and took the liberty of assigning to @mfikes. Should I be assigning to you guys? Or is that kind of rude?

mfikes23:05:28

@lee Assigning is cool—I take it as a signal that it’s ready for review

lread23:05:10

Cool, thanks @mfikes! Yep, ready for a review.