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

Revert the outer module object to an object #26093

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Feb 2, 2023

This is because Webpack has a typeof ... === 'object' before its esm compat test.

This is unfortunate because it means we can't have a nice error in CJS when someone does this:

const fn = require('client-fn');
fn();

I also fixed some checks in the validator that read off the client ref. It shouldn't do those checks against a client ref, since those now throw.

This is because Webpack has a typeof ... === 'object' before its esm compat
test.

This is unfortunate because it means we can't have a nice error in CJS when
someone does this:

const fn = require('client-fn');
fn();

I also fixed some checks in the validator that read off the client ref. It
shouldn't do those checks against a client ref, since those now throw.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 2, 2023
@react-sizebot
Copy link

Comparing: 9d111ff...dfef627

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 = 154.84 kB 154.84 kB = 49.12 kB 49.12 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 156.85 kB 156.85 kB = 49.78 kB 49.78 kB
facebook-www/ReactDOM-prod.classic.js = 533.79 kB 533.79 kB = 95.06 kB 95.06 kB
facebook-www/ReactDOM-prod.modern.js = 518.81 kB 518.81 kB = 92.82 kB 92.82 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js = 10.24 kB 9.47 kB = 2.51 kB 2.48 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js = 10.24 kB 9.47 kB = 2.51 kB 2.48 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js = 10.24 kB 9.47 kB = 2.51 kB 2.48 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-react-native/react/cjs/JSXDEVRuntime-dev.js +0.55% 36.87 kB 37.07 kB +0.36% 10.60 kB 10.64 kB
facebook-react-native/react/cjs/JSXRuntime-dev.js +0.54% 37.47 kB 37.67 kB +0.35% 10.77 kB 10.81 kB
oss-experimental/react/cjs/react-jsx-dev-runtime.development.js +0.46% 42.65 kB 42.85 kB +0.33% 12.48 kB 12.52 kB
oss-stable-semver/react/cjs/react-jsx-dev-runtime.development.js +0.46% 42.68 kB 42.88 kB +0.33% 12.49 kB 12.53 kB
oss-stable/react/cjs/react-jsx-dev-runtime.development.js +0.46% 42.68 kB 42.88 kB +0.33% 12.49 kB 12.53 kB
oss-experimental/react/cjs/react-jsx-runtime.development.js +0.46% 43.25 kB 43.45 kB +0.33% 12.66 kB 12.70 kB
oss-stable-semver/react/cjs/react-jsx-runtime.development.js +0.46% 43.28 kB 43.48 kB +0.34% 12.67 kB 12.71 kB
oss-stable/react/cjs/react-jsx-runtime.development.js +0.46% 43.28 kB 43.48 kB +0.34% 12.67 kB 12.71 kB
facebook-www/JSXDEVRuntime-dev.modern.js +0.43% 46.21 kB 46.41 kB +0.27% 13.07 kB 13.11 kB
facebook-www/JSXDEVRuntime-dev.classic.js +0.43% 46.21 kB 46.41 kB +0.26% 13.08 kB 13.11 kB
facebook-react-native/react/cjs/React-dev.js +0.34% 118.14 kB 118.54 kB +0.23% 31.16 kB 31.24 kB
facebook-www/React-dev.modern.js +0.31% 127.61 kB 128.01 kB +0.21% 33.77 kB 33.84 kB
facebook-www/React-dev.classic.js +0.31% 128.71 kB 129.11 kB +0.23% 34.01 kB 34.09 kB
oss-stable-semver/react/cjs/react.shared-subset.development.js +0.24% 83.71 kB 83.91 kB +0.13% 23.23 kB 23.26 kB
oss-stable/react/cjs/react.shared-subset.development.js +0.24% 83.73 kB 83.93 kB +0.13% 23.25 kB 23.28 kB
oss-experimental/react/cjs/react.shared-subset.development.js +0.23% 85.13 kB 85.33 kB +0.14% 23.65 kB 23.68 kB
oss-stable-semver/react/cjs/react.development.js +0.20% 99.04 kB 99.24 kB +0.13% 26.77 kB 26.80 kB
oss-stable/react/cjs/react.development.js +0.20% 99.06 kB 99.26 kB +0.12% 26.79 kB 26.82 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js = 10.24 kB 9.47 kB = 2.51 kB 2.48 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js = 10.24 kB 9.47 kB = 2.51 kB 2.48 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js = 10.24 kB 9.47 kB = 2.51 kB 2.48 kB

Generated by 🚫 dangerJS against dfef627

@sebmarkbage sebmarkbage merged commit 922dd7b into facebook:main Feb 2, 2023
github-actions bot pushed a commit that referenced this pull request Feb 2, 2023
This is because Webpack has a `typeof ... === 'object'` before its esm
compat test.

This is unfortunate because it means we can't have a nice error in CJS
when someone does this:

```
const fn = require('client-fn');
fn();
```

I also fixed some checks in the validator that read off the client ref.
It shouldn't do those checks against a client ref, since those now
throw.

DiffTrain build for [922dd7b](922dd7b)
[View git log for this commit](https://github.com/facebook/react/commits/922dd7ba50f69f1f969c5809eb57104768716c89)
huozhi added a commit to vercel/next.js that referenced this pull request Feb 7, 2023
x-ref: facebook/react#26059
x-ref: facebook/react#26083
x-ref: facebook/react#26093
x-ref: facebook/react#26083
Closes NEXT-445

* Remove extra `await`
* Check if a component result is client reference, then we access for
other exports
jankaifer pushed a commit to jankaifer/next.js that referenced this pull request Feb 14, 2023
x-ref: facebook/react#26059
x-ref: facebook/react#26083
x-ref: facebook/react#26093
x-ref: facebook/react#26083
Closes NEXT-445

* Remove extra `await`
* Check if a component result is client reference, then we access for
other exports
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Feb 15, 2023
Summary:
This sync includes the following changes:
- **[86c8c8db7](facebook/react@86c8c8db7 )**: test: Don't retry flushActWork if flushUntilNextPaint threw ([#26121](facebook/react#26121)) //<Sebastian Silbermann>//
- **[64acd3918](facebook/react@64acd3918 )**: remove unguarded getRootNode call ([#26152](facebook/react#26152)) //<Josh Story>//
- **[71cace4d3](facebook/react@71cace4d3 )**: Migrate testRunner from jasmine2 to jest-circus ([#26144](facebook/react#26144)) //<Ming Ye>//
- **[c8510227c](facebook/react@c8510227c )**: Treat displayName as undefined ([#26148](facebook/react#26148)) //<Sebastian Markbåge>//
- **[55542bc73](facebook/react@55542bc73 )**: Update jest printBasicPrototype config ([#26142](facebook/react#26142)) //<Ming Ye>//
- **[6396b6641](facebook/react@6396b6641 )**: Model Float on Hoistables semantics ([#26106](facebook/react#26106)) //<Josh Story>//
- **[ef9f6e77b](facebook/react@ef9f6e77b )**: Enable passing Server References from Server to Client ([#26124](facebook/react#26124)) //<Sebastian Markbåge>//
- **[35698311d](facebook/react@35698311d )**: Update jest escapeString config ([#26140](facebook/react#26140)) //<Ming Ye>//
- **[6ddcbd4f9](facebook/react@6ddcbd4f9 )**: [flow] enable LTI inference mode ([#26104](facebook/react#26104)) //<Jan Kassens>//
- **[53b1f69ba](facebook/react@53b1f69ba )**: Implement unstable_getBoundingClientRect in RN Fabric refs ([#26137](facebook/react#26137)) //<Rubén Norte>//
- **[594093496](facebook/react@594093496 )**: Update to Jest 29 ([#26088](facebook/react#26088)) //<Ming Ye>//
- **[28fcae062](facebook/react@28fcae062 )**: Add support for SVG `transformOrigin` prop ([#26130](facebook/react#26130)) //<Aravind D>//
- **[3ff1540e9](facebook/react@3ff1540e9 )**: Prefer JSX in ReactNoop assertions (to combat out-of-memory test runs) ([#26127](facebook/react#26127)) //<Sebastian Silbermann>//
- **[01a0c4e12](facebook/react@01a0c4e12 )**: Add Edge Server Builds for workerd / edge-light ([#26116](facebook/react#26116)) //<Sebastian Markbåge>//
- **[f0cf832e1](facebook/react@f0cf832e1 )**: Update Flight Fixture to "use client" instead of .client.js ([#26118](facebook/react#26118)) //<Sebastian Markbåge>//
- **[03a216070](facebook/react@03a216070 )**: Rename "dom" fork to "dom-node" and "bun" fork to "dom-bun" ([#26117](facebook/react#26117)) //<Sebastian Markbåge>//
- **[4bf2113a1](facebook/react@4bf2113a1 )**: Revert "Move the Webpack manifest config to one level deeper ([#26083](facebook/react#26083))"  ([#26111](facebook/react#26111)) //<Sebastian Markbåge>//
- **[2ef24145e](facebook/react@2ef24145e )**: [flow] upgrade to 0.199.0 ([#26096](facebook/react#26096)) //<Jan Kassens>//
- **[922dd7ba5](facebook/react@922dd7ba5 )**: Revert the outer module object to an object ([#26093](facebook/react#26093)) //<Sebastian Markbåge>//
- **[9d111ffdf](facebook/react@9d111ffdf )**: Serialize Promises through Flight ([#26086](facebook/react#26086)) //<Sebastian Markbåge>//
- **[0ba4698c7](facebook/react@0ba4698c7 )**: Fix async test in React reconciler ([#26087](facebook/react#26087)) //<Ming Ye>//
- **[8c234c0de](facebook/react@8c234c0de )**: Move the Webpack manifest config to one level deeper ([#26083](facebook/react#26083)) //<Sebastian Markbåge>//
- **[977bccd24](facebook/react@977bccd24 )**: Refactor Flight Encoding ([#26082](facebook/react#26082)) //<Sebastian Markbåge>//
- **[d7bb524ad](facebook/react@d7bb524ad )**: [cleanup] Remove unused package jest-mock-scheduler ([#26084](facebook/react#26084)) //<Ming Ye>//
- **[6b3083266](facebook/react@6b3083266 )**: Upgrade prettier ([#26081](facebook/react#26081)) //<Jan Kassens>//
- **[1f5ce59dd](facebook/react@1f5ce59dd )**: [cleanup] fully roll out warnAboutSpreadingKeyToJSX ([#26080](facebook/react#26080)) //<Jan Kassens>//

Changelog:
[General][Changed] - React Native sync for revisions 48b687f...fccf3a9

jest_e2e[run_all_tests]

Reviewed By: rubennorte

Differential Revision: D43305607

fbshipit-source-id: 8da7567ca2a182f4be27788935c2da30a731f83b
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
This sync includes the following changes:
- **[86c8c8db7](facebook/react@86c8c8db7 )**: test: Don't retry flushActWork if flushUntilNextPaint threw ([facebook#26121](facebook/react#26121)) //<Sebastian Silbermann>//
- **[64acd3918](facebook/react@64acd3918 )**: remove unguarded getRootNode call ([facebook#26152](facebook/react#26152)) //<Josh Story>//
- **[71cace4d3](facebook/react@71cace4d3 )**: Migrate testRunner from jasmine2 to jest-circus ([facebook#26144](facebook/react#26144)) //<Ming Ye>//
- **[c8510227c](facebook/react@c8510227c )**: Treat displayName as undefined ([facebook#26148](facebook/react#26148)) //<Sebastian Markbåge>//
- **[55542bc73](facebook/react@55542bc73 )**: Update jest printBasicPrototype config ([facebook#26142](facebook/react#26142)) //<Ming Ye>//
- **[6396b6641](facebook/react@6396b6641 )**: Model Float on Hoistables semantics ([facebook#26106](facebook/react#26106)) //<Josh Story>//
- **[ef9f6e77b](facebook/react@ef9f6e77b )**: Enable passing Server References from Server to Client ([facebook#26124](facebook/react#26124)) //<Sebastian Markbåge>//
- **[35698311d](facebook/react@35698311d )**: Update jest escapeString config ([facebook#26140](facebook/react#26140)) //<Ming Ye>//
- **[6ddcbd4f9](facebook/react@6ddcbd4f9 )**: [flow] enable LTI inference mode ([facebook#26104](facebook/react#26104)) //<Jan Kassens>//
- **[53b1f69ba](facebook/react@53b1f69ba )**: Implement unstable_getBoundingClientRect in RN Fabric refs ([facebook#26137](facebook/react#26137)) //<Rubén Norte>//
- **[594093496](facebook/react@594093496 )**: Update to Jest 29 ([facebook#26088](facebook/react#26088)) //<Ming Ye>//
- **[28fcae062](facebook/react@28fcae062 )**: Add support for SVG `transformOrigin` prop ([facebook#26130](facebook/react#26130)) //<Aravind D>//
- **[3ff1540e9](facebook/react@3ff1540e9 )**: Prefer JSX in ReactNoop assertions (to combat out-of-memory test runs) ([facebook#26127](facebook/react#26127)) //<Sebastian Silbermann>//
- **[01a0c4e12](facebook/react@01a0c4e12 )**: Add Edge Server Builds for workerd / edge-light ([facebook#26116](facebook/react#26116)) //<Sebastian Markbåge>//
- **[f0cf832e1](facebook/react@f0cf832e1 )**: Update Flight Fixture to "use client" instead of .client.js ([facebook#26118](facebook/react#26118)) //<Sebastian Markbåge>//
- **[03a216070](facebook/react@03a216070 )**: Rename "dom" fork to "dom-node" and "bun" fork to "dom-bun" ([facebook#26117](facebook/react#26117)) //<Sebastian Markbåge>//
- **[4bf2113a1](facebook/react@4bf2113a1 )**: Revert "Move the Webpack manifest config to one level deeper ([facebook#26083](facebook/react#26083))"  ([facebook#26111](facebook/react#26111)) //<Sebastian Markbåge>//
- **[2ef24145e](facebook/react@2ef24145e )**: [flow] upgrade to 0.199.0 ([facebook#26096](facebook/react#26096)) //<Jan Kassens>//
- **[922dd7ba5](facebook/react@922dd7ba5 )**: Revert the outer module object to an object ([facebook#26093](facebook/react#26093)) //<Sebastian Markbåge>//
- **[9d111ffdf](facebook/react@9d111ffdf )**: Serialize Promises through Flight ([facebook#26086](facebook/react#26086)) //<Sebastian Markbåge>//
- **[0ba4698c7](facebook/react@0ba4698c7 )**: Fix async test in React reconciler ([facebook#26087](facebook/react#26087)) //<Ming Ye>//
- **[8c234c0de](facebook/react@8c234c0de )**: Move the Webpack manifest config to one level deeper ([facebook#26083](facebook/react#26083)) //<Sebastian Markbåge>//
- **[977bccd24](facebook/react@977bccd24 )**: Refactor Flight Encoding ([facebook#26082](facebook/react#26082)) //<Sebastian Markbåge>//
- **[d7bb524ad](facebook/react@d7bb524ad )**: [cleanup] Remove unused package jest-mock-scheduler ([facebook#26084](facebook/react#26084)) //<Ming Ye>//
- **[6b3083266](facebook/react@6b3083266 )**: Upgrade prettier ([facebook#26081](facebook/react#26081)) //<Jan Kassens>//
- **[1f5ce59dd](facebook/react@1f5ce59dd )**: [cleanup] fully roll out warnAboutSpreadingKeyToJSX ([facebook#26080](facebook/react#26080)) //<Jan Kassens>//

Changelog:
[General][Changed] - React Native sync for revisions 48b687f...fccf3a9

jest_e2e[run_all_tests]

Reviewed By: rubennorte

Differential Revision: D43305607

fbshipit-source-id: 8da7567ca2a182f4be27788935c2da30a731f83b
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