Seriously tho; not the first time *this month* I've seen > 300K of inline'd `window.__INITIAL_STATE__` for a page whose contents isn't (and won't ever be) that large. THIS IS WHY WE INVENTED AJAX, YO.
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I'm guilty of this too (Sapper serializes preloaded data — equivalent to getInitialProps in Next.js — and includes it to avoid `preload` running on both server and client). Are you saying that it'd be better to fetch that same 300kb asyncly even if TTI suffers as a result?
-
Not exactly... This approach can be great in moderation; the problem is over-inclusion in the startup snapshot. Too much data, too little of it used. Delay load what isn't in the critical path.
- 10 more replies
New conversation -
-
-
Ouch, oh dear, people are stillness doing that? Sometimes it feels like I spent half my time at http://science.ai trying to push back on just that

-
Nobody actually looks at the output of their systems, it seems.
- 3 more replies
New conversation -
-
-
ah yes, I know just the thing, they need to put that state into a hidden text area and eval it! /me ducks
-
Comment block!
- 1 more reply
New conversation -
-
-
I badly want to see one of these JS frameworks take a "sever-side first" approach". Provide the same conveniences people like from React/Vue/etc but make SSR the default and ship only a thin layer of JS to the client.
-
I mean, that's what Nuxt does, it's just one command to set up... it has better lighthouse scores out of the gate than even Vue CLI pwa, last time I checked

- 4 more replies
New conversation -
-
-
you leave my var __INITIAL_STATE__ = {readyfns: []} </script></head> ... fetch(...)...then(state => readyfns.forEach(fn => fn(state))) </script> </body> alone! (really I just wanted to show an example alternative here for people who don't know of any)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.