-
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
[FeatureFlags] Enable useMemoCache for ReactTestRenderer #27677
Merged
mofeiZ
merged 1 commit into
facebook:main
from
mofeiZ:enable-use-memo-cache-test-renderer
Nov 10, 2023
Merged
[FeatureFlags] Enable useMemoCache for ReactTestRenderer #27677
mofeiZ
merged 1 commit into
facebook:main
from
mofeiZ:enable-use-memo-cache-test-renderer
Nov 10, 2023
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
Comparing: 7468903...b712190 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
|
josephsavona
approved these changes
Nov 10, 2023
github-actions bot
pushed a commit
that referenced
this pull request
Nov 10, 2023
## Summary Forget compiled code currently cannot be tested with ReactTestRender as `useMemoCache` is not being set on the dispatcher. This PR ensures that projects can execute unit tests with Forget compilation in the test build pipeline. ```js // source code function Component(props) { // ... } // transformed code, which also should be evaluated in unit tests function Component(props) { const $ = useMemoCache(...); // ... } ``` This PR enables the `enableUseMemoCacheHook` feature flag for all bundle variations of ReactTestRenderer. Forget *should* be the only caller of useMemoCache, so this should be a reversible change (in the event we need to change the implementation or api of the hook). ## How did you test this change? * Check that generated ReactTestRenderer bundles contain `useMemoCache`. * Synced to Meta and checked that unit tests that use Forget + @testing-library/react pass. I did not add new tests to check that useMemoCache can be called when using the test renderer as `useMemoCache` is not yet stable. Happy to add a test case here if that would be helpful to reviewers though (I'm guessing that would go in `packages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js` ) DiffTrain build for [6a7f3aa](6a7f3aa)
kodiakhq bot
pushed a commit
to vercel/next.js
that referenced
this pull request
Nov 15, 2023
### React upstream changes - facebook/react#27694 - facebook/react#27695 - facebook/react#27689 - facebook/react#27687 - facebook/react#27677 - facebook/react#27681
EdisonVan
pushed a commit
to EdisonVan/react
that referenced
this pull request
Apr 15, 2024
) ## Summary Forget compiled code currently cannot be tested with ReactTestRender as `useMemoCache` is not being set on the dispatcher. This PR ensures that projects can execute unit tests with Forget compilation in the test build pipeline. ```js // source code function Component(props) { // ... } // transformed code, which also should be evaluated in unit tests function Component(props) { const $ = useMemoCache(...); // ... } ``` This PR enables the `enableUseMemoCacheHook` feature flag for all bundle variations of ReactTestRenderer. Forget *should* be the only caller of useMemoCache, so this should be a reversible change (in the event we need to change the implementation or api of the hook). ## How did you test this change? * Check that generated ReactTestRenderer bundles contain `useMemoCache`. * Synced to Meta and checked that unit tests that use Forget + @testing-library/react pass. I did not add new tests to check that useMemoCache can be called when using the test renderer as `useMemoCache` is not yet stable. Happy to add a test case here if that would be helpful to reviewers though (I'm guessing that would go in `packages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js` )
bigfootjon
pushed a commit
that referenced
this pull request
Apr 18, 2024
## Summary Forget compiled code currently cannot be tested with ReactTestRender as `useMemoCache` is not being set on the dispatcher. This PR ensures that projects can execute unit tests with Forget compilation in the test build pipeline. ```js // source code function Component(props) { // ... } // transformed code, which also should be evaluated in unit tests function Component(props) { const $ = useMemoCache(...); // ... } ``` This PR enables the `enableUseMemoCacheHook` feature flag for all bundle variations of ReactTestRenderer. Forget *should* be the only caller of useMemoCache, so this should be a reversible change (in the event we need to change the implementation or api of the hook). ## How did you test this change? * Check that generated ReactTestRenderer bundles contain `useMemoCache`. * Synced to Meta and checked that unit tests that use Forget + @testing-library/react pass. I did not add new tests to check that useMemoCache can be called when using the test renderer as `useMemoCache` is not yet stable. Happy to add a test case here if that would be helpful to reviewers though (I'm guessing that would go in `packages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js` ) DiffTrain build for commit 6a7f3aa.
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.
Summary
Forget compiled code currently cannot be tested with ReactTestRender as
useMemoCache
is not being set on the dispatcher. This PR ensures that projects can execute unit tests with Forget compilation in the test build pipeline.This PR enables the
enableUseMemoCacheHook
feature flag for all bundle variations of ReactTestRenderer. Forget should be the only caller of useMemoCache, so this should be a reversible change (in the event we need to change the implementation or api of the hook).How did you test this change?
useMemoCache
.I did not add new tests to check that useMemoCache can be called when using the test renderer as
useMemoCache
is not yet stable. Happy to add a test case here if that would be helpful to reviewers though (I'm guessing that would go inpackages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js
)