-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
[Flight] Expand the fixture to use require.extensions #20209
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
facebook-github-bot
added
CLA Signed
React Core Team
Opened by a member of the React Core Team
labels
Nov 10, 2020
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit a11ad02:
|
gaearon
approved these changes
Nov 10, 2020
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.
cute
rickhanlonii
approved these changes
Nov 10, 2020
Use .server convention. /server/index.js should really change too so it can be compiled but for now we treat it as bootstrapping code outside the compiled code. Move App.server. It's part of the application code rather than the infra. Add hybrid component used in both server/client and an extra component shared by multiple entry points.
The simplest server doesn't need AOT compilation. Instead we can just configure require.extensions. This is probably not the best idea to use in prod but is enough to show the set up.
sebmarkbage
force-pushed
the
flightfixture
branch
from
November 10, 2020 03:40
0aa011e
to
a11ad02
Compare
koto
pushed a commit
to koto/react
that referenced
this pull request
Jun 15, 2021
* Expand fixture Use .server convention. /server/index.js should really change too so it can be compiled but for now we treat it as bootstrapping code outside the compiled code. Move App.server. It's part of the application code rather than the infra. Add hybrid component used in both server/client and an extra component shared by multiple entry points. * Use require.extensions to replace .client imports The simplest server doesn't need AOT compilation. Instead we can just configure require.extensions. This is probably not the best idea to use in prod but is enough to show the set up.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This expands the fixture a bit with some more interesting cases like modules shared between multiple entry points and hybrid modules.
Notably, as configured, the Container.js file ends up getting sent twice always. Which is not a great heuristic.
This also use require.extensions to replace .client imports. The simplest server doesn't need AOT compilation. Instead we can just configure require.extensions. This is probably not the best idea to use in a full framework but is enough to show the set up.
We should really set up a Webpack build for the server but it's kind of PITA so didn't bother yet.