Skip to content
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

Node Fibers #7

Closed
nickdima opened this issue Apr 8, 2014 · 9 comments
Closed

Node Fibers #7

nickdima opened this issue Apr 8, 2014 · 9 comments

Comments

@nickdima
Copy link

nickdima commented Apr 8, 2014

Do you think it would be theoretically possible to implement renderComponentToStringWithAsyncState in a way that doens't use fibers?

@andreypopp
Copy link
Owner

Without changing React, no.

@andreypopp
Copy link
Owner

Well... it can be possible but that would require several iterations per render: render once, collect all async components, fetch state, re-render, ... repeate until no async components is left.

@nickdima
Copy link
Author

nickdima commented Apr 8, 2014

Got it! Thanks, that makes sense.

@wwwsevolod
Copy link

what about ES6 generators?

@andreypopp
Copy link
Owner

@wwwsevolod the same, React rendering doesn't yield.

@nickdima
Copy link
Author

@andreypopp by the way, do you see any downsides in using fibers for this?

@andreypopp
Copy link
Owner

@nickdima three things

  1. fibers are outside of node.js distribution and a lot of people consider it as "magic"
  2. react-async facilitates (because it makes it so easy) introducing stateful/async components deep inside component hierarchy
  3. supports only sequential (step by step) fetches

@nickdima
Copy link
Author

@wwwsevolod it's the other way around, it was async but now it isn't anymore. Also because it wasn't a real async implementation.

@wwwsevolod
Copy link

sorry, i misread this, deleted my message when understand this lol ;(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants