Comments (6)
(We’re talking about React ≥ 0.14 of course)
from react-resolver.
@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.
[…] 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.
I guess I just don't actually know how they do it. Setting this for v3 in the meantime.
from react-resolver.
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.
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)
- React.renderToStaticMarkup -> ReactDOMServer.renderToStaticMarkup HOT 2
- Can I use this without server rendering? HOT 3
- Add ability to cache resolved props HOT 9
- Using HOC breaks HMR
- Minimum universal react API HOT 1
- test
- Support variable? HOT 3
- Unhandled rejections server side HOT 1
- @context steals data from this.context HOT 6
- Allow factory to decide which props to re-use? HOT 5
- Documentation links are broken HOT 4
- Using same component on different routes HOT 3
- Using @client and @resolve on the same class causes @resolve to be called twice HOT 1
- Some way of manipulating data before passing it to component HOT 2
- Breakage with React 16: PropTypes no longer exported by React HOT 1
- "[email protected]" has incorrect peer dependency "react@^0.14.6 || ^15.0.0-0" HOT 5
- Need hydrate static method in the Resolver class for server side rendering HOT 2
- Fix compatibility with Babel 6
- Resolve multiple props with one callback HOT 5
- Initial Data from Django using React Resolver HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-resolver.