Fork me on GitHub
#shadow-cljs
<
2017-10-18
>
thheller07:10:19

hmm this is supposed to warn about conflicts but only if the versions differ

thheller07:10:26

right, forgot to compare versions šŸ˜›

thheller09:10:17

just published [email protected], wasnā€™t sure if I published the externs inference fix from yesterday already

Jon13:10:38

sometimes I just found warnings in existing projects,

Jon13:10:52

is shadow-cljs more strict to libraries?

mhuebert13:10:40

alrighty. Is there a way watch a :release? Iā€™m trying to debug keybindings stuff in a windows virtual machine. loading the page across this weird not-really-a-network-boundary is incredibly slow, 2.41 minutes to load the page with 700 requests. it would be faster to advance or simple compile and then have a much smaller bundle

thheller13:10:00

@jiyinyiyong thats based on the clojurescript version you are using. shadow-cljs always uses the latest while other tools might use older versions. uri? was added recently.

thheller13:10:32

@mhuebert haha doh, there is no watch for release no.

thheller13:10:50

I had a ā€œcompactā€ mode once, which was :none but one file

thheller13:10:06

removed that since it didnt seem to make sense šŸ˜›

thheller13:10:18

I want to reduce the number of requests though

mhuebert13:10:24

alright. i can just run releases and reload

thheller13:10:43

Iā€™ll probably bundle all packages together at one point

thheller13:10:53

so that ā€œreactā€ is one request not many

thheller13:10:09

but nothing available now

thheller14:10:30

@jiyinyiyong curious what made you report that error to cljs-ajax?

Jon15:10:24

I guessed if cljs-ajax changes the code, they may fix the warning.

Jon15:10:33

turned out not the case?

mhuebert18:10:25

am encountering a bug where sometimes my Keypress fork (which is referenced as a github commit hash) is being overwritten by the one from npm

mhuebert18:10:55

however, after reproducing once, I canā€™t again

mhuebert18:10:11

I think I will rename my fork so that it will never attempt to download from npm

thheller18:10:55

one thing that might be happening is a conflict

mhuebert18:10:13

there is that conflict where it thinks it has a conflict, but actually the versions are the same

mhuebert18:10:20

because of source-paths

thheller18:10:31

no I mean npm conflict

thheller18:10:51

shadow-cljs will ONLY look at node_modules/thing

thheller18:10:09

but sometimes npm installed things like node_module/thing-a/node_modules/thing-b

thheller18:10:27

because a node_modules/thing-bg already exists, just with a different version

thheller18:10:50

or npm handles installed from git differently? never did that before

mhuebert18:10:50

somehow the wrong files are being written to node_modules/thing during install

thheller18:10:45

I have no idea how to resolve npm conflicts

mhuebert18:10:13

i had a watch run, all good, correct files. when i made a release, the wrong version overwrote it

thheller18:10:17

hmm? I donā€™t ever touch node_modules

mhuebert18:10:38

during the installing npm deps?

mhuebert18:10:54

or thatā€™s cljs handling that

thheller18:10:05

ah ok you call npm-deps

thheller18:10:01

I added a fix this morning that does not attempt to install anything thats already listen in package.json

thheller18:10:09

maybe thats whats happening

thheller18:10:25

npm-deps just blindly called npm install

thheller18:10:33

but this was part of the 2.0.23 release

thheller18:10:37

are you using that?

mhuebert18:10:33

the time when this happened was actually the first build after i had run yarn upgrade shadow-cljs

thheller18:10:27

hmm when I run yarn I do not get the github version?

thheller18:10:28

[:deps-version-conflict "github:braintripping/Keypress#1442b0a" "braintripping/Keypress#1442b0a" #object[java.net.URL 0x5f9b22c1 "jar:file:/Users/zilence/.m2/repository/lark/tools/0.1.14/tools-0.1.14.jar!/deps.cljs"]]

thheller18:10:34

this is when I run shadow-cljs npm-deps

mhuebert18:10:37

is npm run the same as yarn run

thheller18:10:51

do you use npm or yarn?

thheller18:10:58

I think you are supposed to use npx over npm run

mhuebert18:10:10

well i was using yarn, but since cljs is always using npm, i think i should be consistent

thheller18:10:31

nono I just didnā€™t add yarn support yet

thheller18:10:37

I do use yarn as well

thheller18:10:48

[zilence@zpro ~/.m2/repository/lark/tools/0.1.14]$ cat deps.cljs
{:npm-deps {"keypress.js" "braintripping/Keypress#1442b0a"
            "codemirror"  "^5.30.0"}
 :externs  ["externs/lark.commands.ext.js"]}

thheller18:10:56

I think thats missing the github:?

mhuebert18:10:20

hm didnā€™t think it was necessary

mhuebert18:10:32

but iā€™ll add that

mhuebert18:10:49

more explicit, better anyway

thheller18:10:30

its just complaining about it because the version in package.json is different from the one in deps.cljs

thheller18:10:46

it will then attmpt to install that

thheller18:10:14

no wait .. I donā€™t understand my own code

thheller18:10:18

it will SKIP installing

thheller18:10:29

I have no idea how npm works ā€¦

thheller18:10:35

I just did what CLJS does

mhuebert18:10:45

in any case, Iā€™ve changed this to a scoped npm dep, so it cannot ever default to fetching something from npm

thheller18:10:59

probably a good idea yeah

mhuebert18:10:37

so right now you can run dev.maria.cloud and www.maria.cloud and compare shadow vs. old build

mhuebert18:10:06

the shadow build is a bit smaller and loads slightly faster on my machine, despite being many x more files (so i guess http2 is working!)

mhuebert18:10:23

while actually editing, the dev version is much faster but thats because i fixed some perf bugs

thheller18:10:50

yeah h2 is perfect for this

thheller18:10:15

how come https://dev.maria.cloud/ already does all the init stuff?

thheller18:10:30

it doesnā€™t appear to use the compiler?

thheller18:10:10

oh wait nvm. thats also the live frame

thheller18:10:10

1.3mb shadow vs 1.5mb

thheller18:10:18

seems like a win šŸ˜‰

thheller18:10:20

Iā€™ll see if I can find something that takes too long on slower devices

thheller18:10:19

4x cpu throttle perf seems much better

thheller18:10:39

takes 19sec for page to load

thheller18:10:23

shadow version 9sec

mhuebert18:10:39

that is a big diff.

mhuebert18:10:50

obviously this is still a massive bundle but no escaping that for now

thheller18:10:14

I can improve that part so it doesnā€™t render block

mhuebert18:10:24

1st time :release is about 1 minute, subsequents ~12sec, that is all 3 builds. that is __way____ faster than before.

mhuebert18:10:23

plus itā€™s doing all this bootstrap stuff on top.

mhuebert18:10:47

live reloading works better than before, that is also because my cljs-live goog.require hacks did not play well with figwheel

thheller18:10:17

hehe yeah I can imagine

thheller18:10:17

that tag is incorrect, ^boolean not ^:boolean

thheller18:10:00

just checking the render profile and it seems like re_view.render_loop.render_loop is actually called more than once per rAf

thheller19:10:29

no idea if its supposed to

thheller19:10:34

anyways, looks nice. donā€™t think I can do much more tuning of the bootstrap stuff

thheller19:10:40

a bit maybe but not much

mhuebert20:10:56

@thheller oh, thanks, it appears Iā€™ve made that ^boolean mistake a number of times in other code bases too

mhuebert20:10:36

i donā€™t think it should be called more than once per rAf

thheller20:10:02

woho .. I fixed the conditional requires react and apparently others do

thheller20:10:24

#{module$node_modules$object_assign$index
  module$node_modules$react$cjs$react_development shadow.js
  module$node_modules$fbjs$lib$invariant
  module$node_modules$fbjs$lib$emptyObject
  module$node_modules$prop_types$lib$ReactPropTypesSecret
  module$node_modules$fbjs$lib$emptyFunction
  module$node_modules$prop_types$checkPropTypes
  module$node_modules$fbjs$lib$warning}

thheller20:10:44

#{module$node_modules$object_assign$index
  module$node_modules$react$cjs$react_production_min shadow.js
  module$node_modules$fbjs$lib$invariant
  module$node_modules$fbjs$lib$emptyObject
  module$node_modules$fbjs$lib$emptyFunction}

thheller20:10:48

dev vs production

thheller20:10:13

that looks way better

thheller20:10:01

should make packages a bit smaller and doesnā€™t require the custom react :resolve anymore

thheller22:10:46

@mhuebert [email protected] should speed up your builds considerably since babel transformed files are now properly cached