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
Though I find the point valid, the proxy thing naively seems overcomplicated to me. Also, one might argue that, following your thoughts, in most cases, we’re actually *tripling* the payload because most of this is initial state, which is also in the JS bundle.
1 reply 0 retweets 0 likes -
Replying to @tpillard @slightlylate
Isn’t the Redux state supposed to be the single source of truth though ? I mean, isn’t it the whole point to stop inferring state from the DOM?
1 reply 0 retweets 0 likes -
Replying to @tpillard
I was just discussing the inline'd data. The JS payloads that go along with these experiences deserve their own ran...er...discussion.
1 reply 1 retweet 1 like -
Replying to @slightlylate
I think we’re on the page :)
I would like to try and come up with some practical ways to mitigate these issues for existing production apps though.
If I manage to, may I send them your way for critical thinking?2 replies 0 retweets 1 like
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.

