Fork me on GitHub
#shadow-cljs
<
2018-04-29
>
steveb8n06:04:06

@thheller I learned something interesting using Stu today. Using a minified d3.js makes no difference to overall artifact size. Does this make sense? And is it d3 specific or is this generally true for npm deps?

mjmeintjes06:04:03

Just saw that you added "Conditional Reading" (not sure when that was added) - that is a really useful feature, and will make node/browser code much easier, thanks.

mjmeintjes06:04:30

My unrelated question: is it possible to manually trigger hot code reloading, and stop the automatic load on file save?

thheller07:04:04

@tony.kay will use last-index-of in next release.

thheller07:04:25

@steveb8n everything from node_modules is minimized by Closure :simple optimizations yes. It sometimes even makes already minified stuff smaller but going out of your way to specifically select minified builds is not required no.

thheller07:04:32

the bundle process has a bit of overhead per file though. so getting something minified over lots of files is better but not really required. overhead is small and might get smaller over time since I didn't try to optimize the overhead at all yet

steveb8n07:04:02

that’s good to know. I didn’t realise that :simple provided so much value

steveb8n07:04:38

I’ll probably revert that minified change in that case. provides no extra value

thheller07:04:26

@mjmeintjes yes it is possible. how would you want to trigger the reload though? (shadow/watch :app {:autobuild false}) will disable the automatic reloading.

mjmeintjes08:04:34

Not really sure what the best solution would be, but I thought about triggering reloading from repl if that was possible.

thheller08:04:49

yep, just added API fns for that

thheller08:04:19

(shadow/watch-compile-all!) to trigger a recompile on all running watches

thheller08:04:30

(shadow/watch-compile! :app) for a single build

thheller08:04:25

looking into one other thing and will make a release then

mjmeintjes08:04:33

Excellent, thanks!

mjmeintjes08:04:57

Another thing: I've been testing out the new cider version's integration with shadow-cljs, and it mostly works great. Using their function cider-create-sibling-cljs-repl, I can easily create a javascript shadow-cljs repl. This works, but the only problem is that The only slight "snag" I've run into is that shadow-cljs exits with [:no-client :devcards "Make sure your JS environment has loaded your compiled ClojureScript code."] if I try to create the repl before first loading the web page. But, of course I can't, because cider-create-sibling-cljs-repl also starts the watch and compiles the code (it runs (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :%s) (shadow/nrepl-select :%s))). Is there a way to disable the initial check for connected JS environment?

mjmeintjes08:04:13

I can create an issue if that is too complicated to discuss here.

thheller08:04:22

I fixed that in a recent version

thheller08:04:51

I thought the check would make things more user friendly. turns out it did the opposite 😉

mjmeintjes08:04:56

Great - very likely that I'm running a few versions behind - you seem to move very fast.

mjmeintjes08:04:45

I must add that with the new cider improvements integrating shadow-cljs, the development story of ClojureScript is becoming really great. Thanks for all the work! 👍

thheller09:04:26

@mjmeintjes pushed [email protected]. if you start using the triggered compile I'd love some feedback about that. I have often though about using that myself since file watching seems to do a lot of unnecessary compiles. just to lazy to set it up.

mjmeintjes11:04:06

I'm testing out the triggered compile now. I works great, the only problem I've found is that if I trigger a recompile, and nothing has changed, then the hud reloading image does not go away. I've opened up an issue for this.

gnl15:04:01

That's brilliant, was thinking just yesterday that this would be great to have and now here it is. \o/