figwheel-main

figwheel-main http://figwheel.org
Vitor Barbosa 2020-03-11T10:54:31.073500Z

@mike858 I found a nice solution:

lein 'trampoline' 'run' '-m' 'figwheel.main' '-co' 'dev.cljs.edn' '-fwo' 'figwheel-main.edn:figwheel-main.developer-config.edn' '-c' '-r'

Vitor Barbosa 2020-03-11T10:55:59.073700Z

Here figwheel-main.developer-config.edn is git ignored and can have configuration variables specific for each dev

Vitor Barbosa 2020-03-11T10:56:57.073900Z

I put this in a makefile so we can just run make run and it will read from figwheel-main.edn and figwheel-main.developer-config.edn and merge the configs from left to right

Vitor Barbosa 2020-03-11T10:58:26.074100Z

Here is the relevant part from figwheel --help

-fwo, --fw-opts edn          Options to configure figwheel.main, can be an EDN 
                              string or system-dependent path-separated list of 
                              EDN files / classpath resources. Options will be 
                              merged left to right.

2020-03-11T12:19:37.074500Z

posting here since it's maybe more relevant, I was asking a question on #clojurescript https://clojurians.slack.com/archives/C03S1L9DN/p1583926342011900

2020-03-11T12:20:09.075200Z

so how do people in general deal with the fact that during local dev if you have lots of js libraries it loads the browser needs to load a gazillion files?

2020-03-11T12:20:40.076100Z

shadow-cljs apparently still merges them all into one by default, can I get the same behaviour somehow or at least make sure they are all cached somehow?

pyrmont 2020-03-11T12:27:14.077100Z

Is it a big problem? Even if they're merged, the amount of data is the same. Is the HTTP overhead considerable for local dev?

2020-03-11T13:10:24.077600Z

well I see 2400 different requersts for small JS files in one project

2020-03-11T13:10:31.077900Z

which takes forever every time I load the page

2020-03-11T13:10:57.078900Z

I have to investigate why so much

2020-03-11T13:11:37.079600Z

is not a big project, but anyway at least they should all be cached and just return a 304

2020-03-11T13:13:11.080700Z

in prod is just 25 requests just because of the various. analytics, and it takes infinitively less time to load

pez 2020-03-11T13:21:51.082800Z

I do not have that problem in my half-big project...

2020-03-11T13:23:15.083300Z

do you use the figwheel ring server or your own?

pez 2020-03-11T13:29:31.084300Z

Just figwheel's. Is that why I don't have the problem, you think?

2020-03-11T14:15:59.084700Z

maybe

2020-03-11T14:16:03.084900Z

I'll try

2020-03-11T14:28:27.085700Z

mm no it still does lots of requests, but looks like 428 instead of 2400

2020-03-11T14:28:42.086200Z

so it is still better with the figwheel ring server for some reason

pez 2020-03-11T14:30:00.086900Z

Maybe that's what I have. Will check the project tomorrow and see.

2020-03-11T14:32:07.087800Z

yeah well it's still 428 requests that should return 304 instead of 200 tbf

pyrmont 2020-03-11T15:04:57.088400Z

Nice!

pez 2020-03-11T16:07:13.089100Z

So it is loading the page that is the problem, not hot reload?

pez 2020-03-11T16:09:57.090200Z

b/c I get 388 requests when I load the page. I use server side rendering so it never feels very slow.