Giter Site home page Giter Site logo

Comments (6)

yuchi avatar yuchi commented on August 11, 2024

(We’re talking about React ≥ 0.14 of course)

from react-resolver.

ericclemmons avatar ericclemmons commented on August 11, 2024

@yuchi That's a good thought. I had similar thoughts along these lines, but still having issues with the v2 branch with v0.14 & React Router v1 (and the issues is most likely that).

TBH, I'm not 100% sure how well the Resolver will apply in those situations. Because React doesn't support async rendering, the current architecture has to recursively reveal the tree for dependencies to resolve.

It's something that'd just have to be tested with those alternatives and see how well it works (or doesn't) and go from there, since the React Native render lifecycle is entirely different than vanilla React.

from react-resolver.

yuchi avatar yuchi commented on August 11, 2024

[…] since the React Native render lifecycle is entirely different than vanilla React

React 0.14 is here to solve that. In fact react-titanium uses the vanilla React reconciliation through its own rendering. That‘s what react native will do too.

from react-resolver.

ericclemmons avatar ericclemmons commented on August 11, 2024

I guess I just don't actually know how they do it. Setting this for v3 in the meantime.

from react-resolver.

ericclemmons avatar ericclemmons commented on August 11, 2024

I was working on the v2 branch today & got React v0.14 working.

https://github.com/ericclemmons/react-resolver/tree/v2/examples/react-v0.14

I added some comments in 0a92e51, but I gotta figure out how this will work.

For example, this really only makes sense on the server-side when using require("react-dom/server").renderToString for universal rendering. React Native and everything else can actually just render like normal client-side code just like require("react-dom").render, since there's no need for bootstrapping.

from react-resolver.

ericclemmons avatar ericclemmons commented on August 11, 2024

My initial idea to handle this will be to introduce something like:

Resolver
  .resolveWith(renderToString, () => <Handler {...state} />)
  .then(({ markup, data }) => ...)
;

Similarly, the client could use:

Resolver.renderWith(render, () => <Handler {...state} />, node);

The problem with the client-side version is that it _currently relies on renderToString to recursively load the whole tree.

The alternative to this is to render into a hidden "portal" via render, let all the data accumulate, then re-render on last time to the actual target node.

from react-resolver.

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.