Skip to content

Complete deep import warning coverage - #58250

Open
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/complete-deep-import-warnings
Open

Complete deep import warning coverage#58250
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/complete-deep-import-warnings

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary:

The development-only deep-import warning plugin covers static imports, CommonJS requires, and named re-exports, but has three inconsistent boundaries:

  • export * from "react-native/deep" bypasses the warning even though a named re-export warns.
  • literal dynamic import("react-native/deep") bypasses the same package-boundary diagnostic.
  • a local function or parameter named require is mistaken for the free CommonJS loader and produces a false warning.

Share one recorder across both export declaration forms, recognize Babel literal dynamic-import callees, and require require to be unbound before treating it as CommonJS. A combined scope regression proves dynamic import still warns inside a function where the sibling local require is shadowed.

Changelog:

[GENERAL] [FIXED] - Complete and scope React Native deep-import development warnings.

Test Plan:

  • Added focused regressions for export-all, literal dynamic import, and shadowed require behavior; each failed against pristine main.
  • Full preset Jest passes: 4/4 suites, 113/113 tests, 16 snapshots.
  • Fresh Flow check reports 0 errors.
  • Targeted no-ignore ESLint, Prettier, and git diff --check pass.

This only corrects development diagnostics; runtime and release output are unchanged. No UI change.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 30, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant