ericclemmons / react-resolver

Async rendering & data-fetching for universal React applications.
https://ericclemmons.github.io/react-resolver
Other
1.65k stars 52 forks source link

React v0.14 #81

Closed ericclemmons closed 8 years ago

ericclemmons commented 9 years ago

It's coming!

http://facebook.github.io/react/blog/2015/09/10/react-v0.14-rc1.html

Plus, this will improve the API for rendering. Luckily, the code already has @TODO messages for where the replacements need to happen.

ericclemmons commented 9 years ago

This API needs to happen sooner than later.

RickWong commented 9 years ago

Hey, I've upgraded Transmit to support React 0.14. It was really really easy (supporting React Router 1.0 was actually more complex). You just have to remember to require react-dom/server for server-side rendering. Speaking of which, why don't you use renderToString instead of renderToStaticMarkup?

ericclemmons commented 9 years ago

That's good to hear!

I know it works with React v0.14, but I was going to change the API so that you supply the renderer you want to use (native, v0.13, v0.14, that terminal one, whatever).

https://github.com/ericclemmons/react-resolver/blob/master/examples/react-v0.14/src/app.js#L39

What part are you referring to with renderToStaticMarkup?

RickWong commented 9 years ago

I was referring to: https://github.com/ericclemmons/react-resolver/blob/1cf78025f1d3a17f23ce1ad86f0b657a508c122c/src/Resolver.js#L50

But I see what you did there. Resolver's first render uses renderToStaticMarkup for better performance, right?

ericclemmons commented 9 years ago

Right, that's the gist. I dunno which is more performant (I assumed having no react-id would be better, but maybe there's a cleanup on the markup afterwards?).

But yes, the gist is that a static render is done recursively until the tree completes rendering.

RickWong commented 9 years ago

Clever! :) I think I'll have to "bring that over"...

ericclemmons commented 9 years ago

Sure, steal away! I'm always disappointed that async rendering somehow doesn't "click" with people O_o

ratson commented 8 years ago

Apart from the annoying React.render deprecation warning, are there any side effects using v2 with React v0.14?

ericclemmons commented 8 years ago

No, it actually works much more reliably thanks to how context was fixed in React v0.14! In fact, I'm making API changes today (Mac willing!) for official support, now that 0.14 has been out for a while and I have it in production.

On Sun, Dec 13, 2015 at 5:33 AM ratson notifications@github.com wrote:

Apart from the annoying React.render deprecation warning, are there any side effects using v2 with React v0.14?

— Reply to this email directly or view it on GitHub https://github.com/ericclemmons/react-resolver/issues/81#issuecomment-164248782 .

  • Eric Clemmons
ericclemmons commented 8 years ago

Been on an open-source spree lately. I was going to change the API to do something like React.renderWith(ReactDOM.render), but I'd rather just have a peerDependency on react-dom.

pwmckenna commented 8 years ago

v3.0.0 was just released with peer dependencies on react and react-dom v0.14. @ratson, you shouldn't see any more of the deprecation warnings.

pwmckenna commented 8 years ago

@ericclemmons huge thanks for letting me hop in and help get this out. hopefully the upgrade is smooth for everyone (just pushed v3 to prod here at work and everything's looking great). I'll be keeping an ear out for problems, so please comment with any issues you run into.

ericclemmons commented 8 years ago

@pwmckenna :clap:

Thanks so much for the help!