Fork me on GitHub
#re-frame
<
2019-07-14
>
grounded_sage16:07:45

Has anyone had experience with re-frame 10x app-db dropdown not working. I can’t inspect the app-db

jahson16:07:20

Look at the console. If there is no errors, you might try to reset the values stored in session / app storage etc.

dpsutton16:07:48

@grounded_sage there’s info on that in the readme. You need to clear it out of app storage as mentioned above

grounded_sage16:07:00

Ah! Thanks I will try that. I was doing the clear cache and hard reset but didn’t realise it was going into the app storage. I’m following re-frame course and there was no mention of it. I thought I could do it without going through the readme

dpsutton16:07:42

Yeah it was bizarre to me. Kinda funny to see such a weird bug just kinda documented :)

grounded_sage16:07:28

Yea definitely tripped me up. Service workers and all these new browser features add a lot more unexpected behaviours.

genekim17:07:25

Hello, all! Quick question? How long does it usually take for your browser to load in all the JavaScript files in dev mode (no Google Closure optimization) for your re-frame single-page apps? For over a year, I’ve been living with 1.5 - 2 minutes on my 12" MacBook (although it’s at least 2x faster on my MacBook Pro.) Is this typical? I’ve long suspected there’s something wrong with my backend Ring/Jetty server setup,.. I can see it loading only about 4-5 files per second… (I always thought local web servers should be much faster than what I’m seeing.) Thank you!

jahson17:07:54

I have a 15" mbp 2017, in dev mode for our project there are 496 requests loading about an 17 Mib in 20 secs. DOMContentLoaded fires at 9.25s, the load is at 9.33.

jahson17:07:55

That's with cache disabled.

jahson17:07:23

You could also have some network throttling enabled in devtools.

jahson17:07:55

My timings above is for FF Developer Edition, the Chrome works faster, about 4s for all.

genekim18:07:45

@jahson Such a great way to measure performance! Thank you! On this slow MacBook, 340 reqs, 12.7MB, 2.4 minutes! (DOMContentLoad and Load is 2.1 min.) What is the remaining time? (2.4 min - 2.1 min = .3 min) (I think the max CPU wattage on MacBook is 8W. The most noticeable perf diff vs. MBP is full reload of ClojureScript app, like when I’m changing routes in secretary… Would switching to reitit for routing reduce need for require app restarts?)

valtteri18:07:56

545 reqs, 4.1MB transferred, 18.2MB resources, 4.38s

valtteri18:07:23

I think there's something messed up with your setup :thinking_face:

valtteri18:07:34

You could try to profile it with Performance tab in Chrome? It'll show where the time is spent

valtteri18:07:05

Could it be possible that you're doing this to all your static assets in dev-mode? https://ring-clojure.github.io/ring/ring.middleware.reload.html

genekim18:07:46

@valtteri OMG! 🤯 Wow. I moved the wrap-reload above the wrap-public, and got a 2x speedup! 339 requests, 12.7MB resources, 1.1 min DOMContentLoaded THANK YOU!!!!

valtteri18:07:34

Just a lucky guess. 😉 I'm glad it helped!

valtteri18:07:26

Still 1.1min sounds sloooooooow

valtteri18:07:22

There's probably still something unnecessary going on

valtteri18:07:22

But I have to go now.. Hopefully you'll find the causes

genekim18:07:21

Thanks again @valtteri! I’m sure there’s something middleware related… Would you mind sharing what your backend middleware setup is? Here’s mine: >>> (-> routes ; what the routes handler sees (println-middleware) (wrap-session) (wrap-params) ; (wrap-restful-format) ; (wrap-keyword-params) (wrap-json-params) (wrap-reload) (wrap-resource “public”))

valtteri18:07:12

I'm using reitit and applying middleware per route https://github.com/lipas-liikuntapaikat/lipas/blob/master/webapp/src/clj/lipas/backend/handler.clj and I'm using nginx for static assets.

Ahmed Hassan06:07:43

are you using ngnix for dev?

valtteri17:07:13

I'm using pretty much the same stack for dev and prod. So yes.

valtteri18:07:49

But now I really need to go. 🙂 I can try to help you tomorrow if you haven't figured it out yet.

jahson20:07:47

@genekim you could try to disable all middlewares, except wrap-resource and then enable them one by one and see the difference. Also you could make a screenshot of your developer tools Network tab or save a HAR (https://toolbox.googleapps.com/apps/har_analyzer/?lang=en).