-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
related_content is heavy in JSON #66
Comments
By the way, because of repetition, related_content compresses better. Gzipped:
|
One interesting solution is to not hydrate with content from a serialized string. Then you get the best of both worlds. You get no re-render on the client-side and you don't have to include all the heavy state in a serialized JSON string. |
A horribly rough draft is: https://github.com/peterbe/stumptown-renderer/tree/hydrate-based-on-dom |
A flaw that can't be escaped is that if you follow that idea it means you simply don't get the event handlers. I.e. all |
Perhaps, it's a better idea to break apart |
In the renderer, we include all the "state" necessary to render a page. It's encoded as JSON into the HTML file. That's so React can hydrate.
Also, if you click on an internal link, in the sidebar for example, it will only need to download the
index.json
file which is a lot smaller.That JSON is getting pretty big and I think there's room for improvement/optimizations.
I analyzed the sizes of sub-keys in the
client/build/docs/Web/HTML/Element/**/*.json
files and concluded this:E.g. a json like this
This all gets gzipped and stuff but let's get performance as a primary thought now rather than an afterthought. But, let's also not prematurely optimize.
The text was updated successfully, but these errors were encountered: