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] createServerReference should export $$FORM_ACTION on the Server #26987

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

sebmarkbage
Copy link
Collaborator

Currently, only the browser build exposes the $$FORM_ACTION helper. It's used for creating progressive enhancement fro Server Actions imported from Client Components. This helper is only useful in SSR builds so it should be included in the Edge/Node builds of the client.

I also removed it from the browser build. We assume that only the Edge or Node builds of the client are used
together with SSR. On the client this feature is not needed so we can exclude the code. This might be a bit unnecessary because it's not that much code and in theory you might use SSR in a Service Worker or something where the Browser build would be used but currently we assume that build is only for the client. That's why it also don't take an option for reverse
look up of file names.

Currently, only the browser build exposes the $$FORM_ACTION helper.
This helper is only useful in SSR builds so it should be included in the
Edge/Node builds of the client.
We assume that only the Edge or Node builds of the client are used
together with SSR. On the client this feature is not needed so we can
exclude the code. This might be a bit unnecessary because it's not that
much code and in theory you might use SSR in a Service Worker or something
where the Browser build would be used but currently we assume that build is
only for the client. That's why it also don't take an option for reverse
look up of file names.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jun 21, 2023
@sebmarkbage sebmarkbage changed the title createServerReference should export $$FORM_ACTION on the Server [Flight] createServerReference should export $$FORM_ACTION on the Server Jun 21, 2023
@react-sizebot
Copy link

Comparing: 254cbdb...b6240b2

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 164.56 kB 164.56 kB = 51.83 kB 51.83 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 171.97 kB 171.97 kB = 54.06 kB 54.06 kB
facebook-www/ReactDOM-prod.classic.js = 571.74 kB 571.74 kB = 100.83 kB 100.83 kB
facebook-www/ReactDOM-prod.modern.js = 555.52 kB 555.52 kB = 98.02 kB 98.02 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.development.js = 56.70 kB 54.08 kB = 13.43 kB 12.75 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.development.js = 56.70 kB 54.08 kB = 13.43 kB 12.75 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.development.js = 56.70 kB 54.08 kB = 13.43 kB 12.75 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js = 53.31 kB 50.82 kB = 13.21 kB 12.55 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js = 53.31 kB 50.82 kB = 13.21 kB 12.55 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js = 53.31 kB 50.82 kB = 13.21 kB 12.55 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.production.min.js = 10.94 kB 10.15 kB = 4.37 kB 4.09 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.production.min.js = 10.94 kB 10.15 kB = 4.37 kB 4.09 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.production.min.js = 10.94 kB 10.15 kB = 4.37 kB 4.09 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.min.js = 10.68 kB 9.88 kB = 4.28 kB 3.99 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.min.js = 10.68 kB 9.88 kB = 4.28 kB 3.99 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.min.js = 10.68 kB 9.88 kB = 4.28 kB 3.99 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.min.js +1.54% 9.70 kB 9.85 kB +0.82% 3.90 kB 3.94 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.min.js +1.54% 9.70 kB 9.85 kB +0.82% 3.90 kB 3.94 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.min.js +1.54% 9.70 kB 9.85 kB +0.82% 3.90 kB 3.94 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +1.49% 10.02 kB 10.17 kB +0.79% 4.04 kB 4.07 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +1.49% 10.02 kB 10.17 kB +0.79% 4.04 kB 4.07 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +1.49% 10.02 kB 10.17 kB +0.79% 4.04 kB 4.07 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.min.js +1.43% 10.40 kB 10.55 kB +0.71% 4.23 kB 4.26 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.min.js +1.43% 10.40 kB 10.55 kB +0.71% 4.23 kB 4.26 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.min.js +1.43% 10.40 kB 10.55 kB +0.71% 4.23 kB 4.26 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.min.js +1.40% 10.66 kB 10.81 kB +0.65% 4.30 kB 4.33 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.min.js +1.40% 10.66 kB 10.81 kB +0.65% 4.30 kB 4.33 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.min.js +1.40% 10.66 kB 10.81 kB +0.65% 4.30 kB 4.33 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +1.07% 49.79 kB 50.32 kB +0.36% 12.38 kB 12.42 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +1.07% 49.79 kB 50.32 kB +0.36% 12.38 kB 12.42 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +1.07% 49.79 kB 50.32 kB +0.36% 12.38 kB 12.42 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +1.05% 50.69 kB 51.22 kB +0.37% 12.59 kB 12.64 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +1.05% 50.69 kB 51.22 kB +0.37% 12.59 kB 12.64 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +1.05% 50.69 kB 51.22 kB +0.37% 12.59 kB 12.64 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +1.02% 52.23 kB 52.76 kB +0.33% 13.05 kB 13.09 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +1.02% 52.23 kB 52.76 kB +0.33% 13.05 kB 13.09 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +1.02% 52.23 kB 52.76 kB +0.33% 13.05 kB 13.09 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +1.00% 52.95 kB 53.48 kB +0.30% 13.20 kB 13.24 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +1.00% 52.95 kB 53.48 kB +0.30% 13.20 kB 13.24 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +1.00% 52.95 kB 53.48 kB +0.30% 13.20 kB 13.24 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.development.js = 56.70 kB 54.08 kB = 13.43 kB 12.75 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.development.js = 56.70 kB 54.08 kB = 13.43 kB 12.75 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.development.js = 56.70 kB 54.08 kB = 13.43 kB 12.75 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js = 53.31 kB 50.82 kB = 13.21 kB 12.55 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js = 53.31 kB 50.82 kB = 13.21 kB 12.55 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js = 53.31 kB 50.82 kB = 13.21 kB 12.55 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.production.min.js = 10.94 kB 10.15 kB = 4.37 kB 4.09 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.production.min.js = 10.94 kB 10.15 kB = 4.37 kB 4.09 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.production.min.js = 10.94 kB 10.15 kB = 4.37 kB 4.09 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.min.js = 10.68 kB 9.88 kB = 4.28 kB 3.99 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.min.js = 10.68 kB 9.88 kB = 4.28 kB 3.99 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.min.js = 10.68 kB 9.88 kB = 4.28 kB 3.99 kB

Generated by 🚫 dangerJS against b6240b2

@sebmarkbage sebmarkbage merged commit 2153a29 into facebook:main Jun 28, 2023
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
…ver (facebook#26987)

Currently, only the browser build exposes the `$$FORM_ACTION` helper.
It's used for creating progressive enhancement fro Server Actions
imported from Client Components. This helper is only useful in SSR
builds so it should be included in the Edge/Node builds of the client.

I also removed it from the browser build. We assume that only the Edge
or Node builds of the client are used
together with SSR. On the client this feature is not needed so we can
exclude the code. This might be a bit unnecessary because it's not that
much code and in theory you might use SSR in a Service Worker or
something where the Browser build would be used but currently we assume
that build is only for the client. That's why it also don't take an
option for reverse
look up of file names.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
…ver (#26987)

Currently, only the browser build exposes the `$$FORM_ACTION` helper.
It's used for creating progressive enhancement fro Server Actions
imported from Client Components. This helper is only useful in SSR
builds so it should be included in the Edge/Node builds of the client.

I also removed it from the browser build. We assume that only the Edge
or Node builds of the client are used
together with SSR. On the client this feature is not needed so we can
exclude the code. This might be a bit unnecessary because it's not that
much code and in theory you might use SSR in a Service Worker or
something where the Browser build would be used but currently we assume
that build is only for the client. That's why it also don't take an
option for reverse
look up of file names.

DiffTrain build for commit 2153a29.
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.

4 participants