We need to talk about Redux and "SSR". Just saw second (large, commercial) site sending > 100/500K (zipped/unzipped) of HTML payload *this week*. When it takes 3-5x the size of a PNG screenshot of your AFT content to "inline" your "critical" HTML/JS/CSS, something's broken.
-
Show this thread
-
Replying to @slightlylate
Hi, Do you know much of this is the DOM-serialized Redux state? In my production apps, it easily takes up to ~100kb alone.
1 reply 0 retweets 0 likes -
-
Replying to @slightlylate
FWIW, I too think the cost of React/Redux SSR is an under-addressed issue. Would love any leads on how to fix this the right way.
1 reply 0 retweets 0 likes -
Replying to @tpillard
A quick fix would be to put a Proxy in front of server-side Redux store and only serialize what actually got used to generate markup. But I question the need for nearly any/all of this cruft. Why are we doubling up this payload? Nearly all this data is already in the DOM.
3 replies 0 retweets 6 likes -
Replying to @slightlylate @tpillard
Do you know any such proxy that can be used to purge unnecessary Redux tree automatically? Does it require any patterns of use with Redux? I’m worried that it is heavily tied into how the rest of the app is constructed to build upon initial state.
1 reply 0 retweets 0 likes
I haven't prototyped this but basically you'd need to be able to handle accesses for faults in an async way; ala:https://github.com/reduxjs/redux/tree/master/examples/async …
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.