Git Product home page Git Product logo

Comments (5)

peterbe avatar peterbe commented on August 18, 2024

By the way, because of repetition, related_content compresses better. Gzipped:

related_content                  1108    34%
prose                             892    28%
contributors                      416    13%
browser_compatibility             283     8%
examples                          250     7%
interactive_example_url            83     2%
mdn_url                            78     2%
title                              51     1%
attributes                         22     0%

from yari.

peterbe avatar peterbe commented on August 18, 2024

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.

from yari.

peterbe avatar peterbe commented on August 18, 2024

A horribly rough draft is: https://github.com/peterbe/stumptown-renderer/tree/hydrate-based-on-dom
It removes the need to include the state serialized. But it breaks hydration.

from yari.

peterbe avatar peterbe commented on August 18, 2024

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 onClicks within the Document will not work. And it can't because we never give the React-in-the-browser a chance to build up its own virtual DOM.

from yari.

peterbe avatar peterbe commented on August 18, 2024

Perhaps, it's a better idea to break apart index.json into index.json and related_content.json and then lazy-load the sidebar with XHR after initial load. Not great either.

from yari.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.