-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
Stop exporting dev-only methods in production builds #32200
base: main
Are you sure you want to change the base?
Conversation
Comparing: ae9017c...ddfb804 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show |
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.
Copy of index.stable.js
+ act
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.
Copy of index.fb.js
+ act
+ captureOwnerStack
@@ -571,7 +571,7 @@ function shouldSkipBundle(bundle, bundleType) { | |||
return false; | |||
} | |||
|
|||
function resolveEntryFork(resolvedEntry, isFBBundle) { | |||
function resolveEntryFork(resolvedEntry, isFBBundle, isDev) { |
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.
Third arg was always passed but not utilized until now.
730b540
to
6a60f6d
Compare
@@ -779,13 +779,5 @@ function runActTests(render, unmount, rerender) { | |||
}); | |||
} | |||
}); | |||
describe('throw in prod mode', () => { |
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.
Replaced by the test in packages/react-reconciler/src/__tests__/ReactIsomorphicAct-test.js
. This is testing React.act
not react-dom/test-utils
Summary
Affects OSS and FB builds.
The development entrypoints were setup in #29923 but they were always used i.e. they effectively replaced the standard entrypoints. Now we only use the
.development.js
entrypoints for dev builds.It's technically a bug fix though it might be too invasive to do now for
act
. We can definitely do it forcaptureOwnerStack
though.How did you test this change?
yarn build react/index --type NODE_PROD,NODE_ENV
no longer containsexports.act
andexports.captureOwnerStack
in~/cjs/react.production.js
while~/cjs/react.development.js
still has these exportscc @sebmarkbage