cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
plexus 2020-08-14T08:53:30.034500Z

still something not quite right with :npm-deps and :install-deps. What would be the intended behavior if :npm-deps false :install-deps true? install only upstream, or install nothing?

thheller 2020-08-14T10:08:56.035100Z

I thought :install-deps is gone and instead now a separate command? cljs.main --install-deps or so?

plexus 2020-08-14T10:35:22.035500Z

it's still there https://clojurescript.org/reference/compiler-options#install-deps , should it be marked as deprecated in the docs?

thheller 2020-08-14T10:36:27.035900Z

hmm no clue. maybe both still work.

dnolen 2020-08-14T12:13:57.036100Z

@plexus install nothing

dnolen 2020-08-14T12:14:19.036500Z

erm actually no

dnolen 2020-08-14T12:15:12.037200Z

@plexus I would say you have to install upstream because otherwise your dependencies aren't going to work

plexus 2020-08-14T12:15:42.037600Z

ok, so :npm-deps false should be treated the same as :npm-deps nil?

dnolen 2020-08-14T12:16:21.038200Z

yeah I don't think :npm-deps false-y is that meaningful anymore

plexus 2020-08-14T12:17:13.038900Z

the docs say it defaults to false but I believe it defaults to nil / absent so I guess that's really the same thing

dnolen 2020-08-14T12:17:53.039800Z

fortunately the docs aren't overly specific

plexus 2020-08-14T12:18:02.040100Z

whereas :npm-deps {} == :npm-deps true? i.e. use the node_modules that is there

dnolen 2020-08-14T12:18:09.040300Z

I think we should just edit it to clarify that it doesn't affect upstream deps

plexus 2020-08-14T12:18:29.040800Z

yeah those docs could definitely use some clarification... I'll have a look at that

dnolen 2020-08-14T12:18:40.041100Z

I think once we allowed upstream deps

dnolen 2020-08-14T12:18:57.041600Z

:npm-deps being a global control over that stopped being desirable

dnolen 2020-08-14T12:19:21.042100Z

again I think the docs aren't particularly clear about the behavior so I don't think we're painted into a corner

plexus 2020-08-14T12:26:23.043100Z

the thing is that if false = nil and true = {}, then we can normalize :npm-deps that way, so we don't have to check for nil/boolean/map everywhere it's used

dnolen 2020-08-14T12:31:28.043600Z

sure, that would remove unnecessary complexity from the code, happy to see that done

1
dnolen 2020-08-14T18:41:08.045Z

@dpsutton I finally got to take a look at 3620, sorry for delay that's one a bit of brain twister so I kept putting it off

dpsutton 2020-08-14T18:41:40.046Z

no worries. i understand how things go in spurts. i am in no way demanding your time šŸ™‚

dnolen 2020-08-14T18:41:43.046100Z

the first question I have is whether you considered not tagging and detecting whether you effectively have an and or or

dnolen 2020-08-14T18:42:15.046700Z

not a trick question - just wondering if you thought about it

dpsutton 2020-08-14T18:43:07.047200Z

i understand. and no i did not think about that approach

dpsutton 2020-08-14T18:44:14.048Z

i suppose that would benefit by making this optimization more general

dnolen 2020-08-14T18:51:05.048500Z

yeah I'm think we should do it that way

dnolen 2020-08-14T18:51:25.048900Z

it's not as hard as it sounds I think

dnolen 2020-08-14T18:51:35.049200Z

because and / or always look the same

dnolen 2020-08-14T18:52:20.050Z

let* a value which much be a simple type - and if

dnolen 2020-08-14T18:52:47.050500Z

because passes go inside out

dnolen 2020-08-14T18:53:03.050900Z

you don't have to do much, either you can fold in the children into the test or you can't

dnolen 2020-08-14T18:53:41.051500Z

in the case of and you'll find the thing you can fold in the true branch

dnolen 2020-08-14T18:54:19.051900Z

in the case of or, in the else branch

dnolen 2020-08-14T18:54:59.052800Z

(if and# and# and#) is actually a terminal case

dnolen 2020-08-14T18:55:09.053200Z

you can collapse it to and#

dnolen 2020-08-14T18:55:16.053500Z

but then the parent can collapse that

dnolen 2020-08-14T18:55:22.053700Z

and then the parent can collapse that, etc.

dpsutton 2020-08-14T18:55:44.054100Z

been a bit since i looked at it. are the ast passes a prewalk or postwalk?

dnolen 2020-08-14T18:56:13.054400Z

pretty sure postwalk, so this would work

dnolen 2020-08-14T19:20:05.054900Z

@dpsutton also if you're busy now that I've spent some time thinking about it I could give it a go over the weekend

dnolen 2020-08-14T19:20:32.055500Z

but also happy to let you take it!

dpsutton 2020-08-14T19:40:07.055900Z

Iā€™m on vacation so give it a crack.

dpsutton 2020-08-14T19:40:32.056800Z

If you have an itch to livestream or record it I think that would be amazing. Big ask though :)

dnolen 2020-08-14T19:55:53.057Z

not a bad idea

šŸ¦œ 4