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
Add enableSuspenseServerRenderer feature flag #13573
Add enableSuspenseServerRenderer feature flag #13573
Conversation
@alexmckenley Hey Alex! @sebmarkbage is going to work with you on the new streaming server renderer. |
Details of bundled changes.Comparing: fb88fd9...99b6680 react-dom
schedule
Generated by 🚫 dangerJS |
@@ -911,6 +916,27 @@ class ReactDOMServerRenderer { | |||
this.stack.push(frame); | |||
return ''; | |||
} | |||
case REACT_PLACEHOLDER_TYPE: { | |||
if (enableSuspenseServerRenderer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's worth adding this to the existing renderer, even in this limited form. If we do, we should emit a warning so people know to migrate to the new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to only enable this flag in the FB build for now since we're already using placeholders.
30c1bb6
to
99b6680
Compare
Update: never mind, didn't realize you had discussed this with Sebastian already! |
@@ -16,6 +16,7 @@ export const { | |||
debugRenderPhaseSideEffects, | |||
debugRenderPhaseSideEffectsForStrictMode, | |||
enableGetDerivedStateFromCatch, | |||
enableSuspenseServerRenderer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we would export const enableSuspenseServerRenderer = true;
instead of this line. That way it should be enabled in www client but I don't know how we plan on using this file on the server in www. Perhaps we should configure the server build to just inline the feature flags in the build instead? Since this one is most meant for experiments based on GKs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning on controlling this in www like so: https://fburl.com/diff/i1l0949n.
let me know if you'd rather just hard-code the value here.
I've added a feature flag that will allow server rendering of placeholder components. This implementation will always render the fallback component when a Placeholder is encountered, but will be improved upon in the future.