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

[Flight] Expand the fixture to use require.extensions #20209

Merged
merged 2 commits into from
Nov 10, 2020

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Nov 10, 2020

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.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Nov 10, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented 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:

Sandbox Source
React Configuration

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cute

fixtures/flight/src/Counter.client.js Outdated Show resolved Hide resolved
fixtures/flight/src/ShowMore.client.js Outdated Show resolved Hide resolved
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.
@sizebot
Copy link

sizebot commented Nov 10, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against a11ad02

@sizebot
Copy link

sizebot commented Nov 10, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against a11ad02

@sebmarkbage sebmarkbage merged commit e855f91 into facebook:master Nov 10, 2020
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
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants