-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Updating forking implementation to match against more general fork implementations #27205
Conversation
251aa28
to
43afdd6
Compare
…t found. for instance `File.dom` can match when using renderer `"dom-node"` if `File.dom-node` does not exist. This change also splits the browser and node builds for react-server-dom-esm into two separate renderers. There is not a `"dom-browser-esm"` renderer. This change should alter no semantics. It does however set us up to support more complex and varied renderer configs in future updates and generally lowers the effort to spin up additional configs.
export * from 'react-client/src/ReactFlightClientConfigBrowser'; | ||
export * from 'react-server-dom-esm/src/ReactFlightClientConfigESMBundler'; | ||
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM'; | ||
export const usedWithSSR = false; |
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.
for the browser build usedWithSSR
should have always been false, but now that we can separate these renderers we can slightly optimize the build with this config difference
@@ -7,7 +7,6 @@ | |||
* @flow | |||
*/ | |||
|
|||
// This should really have a Node and a Browser fork but to avoid too many configs we limit this to build the same for both |
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.
dom-browser-esm now exists
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.
all dom based ReactFiberConfigs have been consolidated in ReactFiberConfig.dom.js
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.
same impl as ReactFizzConfig.dom
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.
not webpack specific so renaming .dom-edge
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.
same impl as ReactFizzConfig.dom-node
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.
Git is showing this as a rename but really we deleted the dom-node-webpack to pickup the dom-node version and we added dom-browser-esm for that new renderer
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.
stream configs don't depend on webpack vs esm. using dom-node
to generalize
console.error( | ||
chalk.red(`There was an error preparing plugins for entry "${entry}"`) | ||
); |
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.
This is helpful when a build fails in CI. currently you cannot tell which one failed, just the ones that succeeded before it
return new Error( | ||
`Expected not to use ReactFlightServerConfig with "${entry}" entry point ` + | ||
'in ./scripts/shared/inlinedHostConfigs.js. Update the renderer config to ' + | ||
'activate flight suppport and add a matching fork implementation for ReactFlightServerConfig.' | ||
); |
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.
previously this would return a fork to a non-existent file such as ReactFlightServerConfig.dom-fb.js
but since that file was never referenced there was no error. To mimic this we return an error here when we don't fine a file as long as the bundle declares that it does not implement Flight.
### React upstream changes - facebook/react#27265 - facebook/react#27259 - facebook/react#27264 - facebook/react#27257 - facebook/react#27258 - facebook/react#27187 - facebook/react#27243 - facebook/react#27205 - facebook/react#27220 - facebook/react#27238 - facebook/react#27234 - facebook/react#27224 - facebook/react#27223 - facebook/react#27222 This will help unblock #53906
…plementations (facebook#27205) Search for more generic fork files if an exact match does not exist. If `forks/MyFile.dom.js` exists but `forks/MyFile.dom-node.js` does not then use it when trying to resolve forks for the `"dom-node"` renderer in flow, tests, and build consolidate certain fork files that were identical and make semantic sense to be generalized add `dom-browser-esm` bundle and use it for `react-server-dom-esm/client.browser` build
…plementations (#27205) Search for more generic fork files if an exact match does not exist. If `forks/MyFile.dom.js` exists but `forks/MyFile.dom-node.js` does not then use it when trying to resolve forks for the `"dom-node"` renderer in flow, tests, and build consolidate certain fork files that were identical and make semantic sense to be generalized add `dom-browser-esm` bundle and use it for `react-server-dom-esm/client.browser` build DiffTrain build for commit 5623f2a.
Search for more generic fork files if an exact match does not exist. If
forks/MyFile.dom.js
exists butforks/MyFile.dom-node.js
does not then use it when trying to resolve forks for the"dom-node"
renderer in flow, tests, and buildconsolidate certain fork files that were identical and make semantic sense to be generalized
add
dom-browser-esm
bundle and use it forreact-server-dom-esm/client.browser
build