Fork me on GitHub
#shadow-cljs
<
2017-10-19
>
thheller08:10:49

@mhuebert I just pushed [email protected] which adds a new :devtools {:async-require true} option. it will load files using window.fetch in :dev mode

mhuebert08:10:14

with 2.0.26, after cache is hot, yarn run watch with Maria’s 3 builds takes 1.62 seconds 🙂

thheller08:10:19

in my test build this cuts page load time dramatically. ~1sec -> 500ms

thheller08:10:20

but its async, so it might not work for all setups

mhuebert08:10:28

:release for all 3 takes 11s.

mhuebert08:10:11

async-require - does this only affect :dev mode?

mhuebert08:10:31

so not for release?

thheller08:10:38

don’t need it for release

mhuebert08:10:54

oh right this is for those situations where one is loading 700 files

thheller08:10:09

yeah, the closure debug loader usually injects a bunch of script tags

thheller08:10:18

which is not very fast

thheller08:10:30

especially at that number of files

thheller08:10:07

I did some experiments with this a while ago, your build seems like it might work with it

thheller08:10:54

can also do <script src="/js/compiled/shadow-trusted.js" type="text/javascript" defer></script> then, note the defer or async

mhuebert08:10:33

toggling the devtools async-require doesn’t seem to make much of a difference in my normal setup, but maybe with the virtualbox setup

thheller08:10:59

really? I would have expected a big difference at 700 files

thheller08:10:08

hmm doesn’t seem to work well in firefox

thheller09:10:09

geez firefox is slow loading :none builds

thheller09:10:04

but also way faster with the fixed async-require

thheller09:10:32

next big perf win in dev will probably be ssl+http2 support for the dev server

mhuebert09:10:24

http2 in dev, yeah

mhuebert09:10:25

the simplicity of this is nice:

lein new re-view my-great-app;
cd my-great-app;
lein figwheel;

mhuebert09:10:23

I think the closest shadow equivalent I can think of is:

lein new re-view my-great-app;
cd my-great-app;
yarn install;
yarn run shadow-cljs npm-deps;
yarn run shadow-cljs watch browser;

mhuebert09:10:57

I put the first 2 yarn things into a deps command, and the last into watch, so

yarn run deps;
yarn run watch;

mhuebert10:10:07

which is not bad

mhuebert10:10:15

but requires yarn, I couldn’t get it to work with npm

thheller10:10:27

the npm-deps will be called automatically soon

thheller10:10:39

just needs more testing

thheller10:10:10

also given the JS heavy side of things

mhuebert10:10:13

ok. calling npm install or yarn install directly is ok i think as the first step (to install shadow-cljs). but the npm-deps part is important because the template shouldn’t have to keep all its transitive deps in package.json.

thheller10:10:11

we could also start building templates the yarn way

thheller10:10:17

yarn create re-view

mhuebert10:10:38

oh, didn’t know about that

mhuebert10:10:07

that looks promising

thheller10:10:44

didn’t look too closely into the template stuff yet, maybe just start with a few quickstart repos that you just clone

mhuebert10:10:27

does shadow have any other dependencies, related to java/lein/maven/etc

mhuebert10:10:34

things that wouldn’t be on everyone’s computer

thheller12:10:02

npm (or yarn)

thheller12:10:08

java8 minimum, java9 might have issues