Route virtualized-lists feature flags through react-private-interface - #57940
Open
giaBaoJS wants to merge 1 commit into
Open
Route virtualized-lists feature flags through react-private-interface#57940giaBaoJS wants to merge 1 commit into
giaBaoJS wants to merge 1 commit into
Conversation
Member
|
Great spot! We'll need to solve this slightly differently however, I think by adding this API to import {ReactNativeFeatureFlags} from 'react-native/react-private-interface';Patch here: https://gist.github.com/huntie/0523e2dd114dacf904d28211ad6b67be. Can you apply/retitle this PR to match? :) |
giaBaoJS
force-pushed
the
fix-57933-virtualized-lists-exports
branch
from
August 18, 2026 15:14
7cfe4fb to
3c68fe8
Compare
huntie
reviewed
Aug 18, 2026
| }); | ||
| }); | ||
|
|
||
| // Files matching these patterns are excluded from every published package via |
Member
There was a problem hiding this comment.
Can we drop or separate out the changes from this file?
At minimum, we've reimplemented ESLint and should instead reuse it — should be a case of enabling the react-native/no-deep-imports rule directly on the virtualized-lists codebase. (But also, we're probably fine without adding new checks.)
This file contains hidden or 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
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:
Fixes #57933.
@react-native/virtualized-listsis published separately and used to importReactNativeFeatureFlagsthrough the unexported pathreact-native/src/private/featureflags/ReactNativeFeatureFlags. Metro therefore warned and fell back to file-based resolution whenever an app rendered a virtualized list.Following the maintainer's suggested direction, this PR now:
ReactNativeFeatureFlagsfrom the existing private package boundary,react-native/react-private-interface;VirtualizedList.jsandVirtualizeUtils.js) through that boundary; andThis avoids exposing any new
src/private/*subpath while preserving the existing feature-flag singleton.The four similar imports in
@react-native/jest-presetremain out of scope because they are allimport typeand are erased before resolution.Changelog:
[GENERAL] [FIXED] - Fix the Metro package-exports warning caused by
@react-native/virtualized-listsimporting an unexported React Native subpath.Test Plan:
The regression test is intentionally independent of Jest's patched resolver: it reads the package exports map directly and checks runtime imports shipped by published workspace packages.
Counterfactual with the final test kept but only the two
virtualized-listsimports reverted:Restoring the private-interface imports makes the same test pass.
After rebasing onto current
main: