Last 12 weeks ยท 70 commits
6 of 6 standards met
Summary When encounters a config that resolves to a (e.g. an async / a config function returning a promise) and at least one more config follows it, it hands off to with two defects: 1. Missing spread. takes a rest parameter, but the call passed as a single array argument. The remaining configs end up wrapped one level too deep, so they're merged as a bogus object (producing junk keys like ) instead of being applied as configs. 2. Dropped accumulator. (the base merged with every config to the left of the async one) was discarded โ the unresolved promise was passed as the base, so all prior merges were lost. The fix spreads the remaining configs into the rest parameter and folds into the resolved async config so both the accumulated state and the trailing overrides are preserved. Test plan The existing tests only cover sync configs, so this path was uncovered. Added a regression test (an async config function followed by a trailing override) asserting the base, the async config, and the trailing override all survive: Before: is (base dropped); trailing override mangled. After: all three configs merge correctly.
Summary hands custom a callback to look up a module's transitive dependencies. But it builds that callback as: is the function . This calls on the function itself and ignores โ it never invokes . Since the closure has arity 1, treats it as array-like via and returns . So any that uses this callback to compute / receives for every file it asks about. Fix Test plan Added a regression test that supplies a which calls the callback for and asserts it returns foo's transitive deps (, , ). Fails before (), passes after. Existing tests + snapshots unchanged (4 passed, 2 snapshots).
Summary When a manual-mock file with duplicates is removed, unconditionally reassigns the active mock to an arbitrary remaining duplicate: It never checks whether the removed file was the active mock (). When a non-active duplicate is removed and 3+ duplicates exist, returns the first-inserted path, silently changing which mock resolves โ even though the previously-active mock still exists on disk. The existing 2-duplicate "recovers from duplicates" test masks this because the single remaining element is coincidentally always the right answer. Fix Capture whether the removed file was the active mock before deleting, and only reassign in that case. Test plan Added a regression test: 3 duplicates (a, b, c โ active c), remove the non-active , assert the active mock stays . Fails before (becomes ), passes after. Full MockPlugin + getMockName suites: 13 pass, no regressions.
Summary: Remove the deprecated default-object export from Metro packages. The supported public API is now exclusively named exports, so any consumer importing a Metro package's default - directly, or implicitly via Babel/TypeScript - will break and must migrate to named imports. This affects the public entry points of , , , , , , , and . Default imports like these will no longer work: Switch to named imports instead: Namespace imports are unaffected and continue to work, since they bind the package's named exports: Changelog: [Breaking] Removed the deprecated default export from Metro's public packages; use named (or namespace) imports instead. ___ Reviewed By: huntie Differential Revision: D110062342
Summary: These have been deprecated (with a runtime warning) and removal planned for a year now. I believe they're little used in the wild and inherently very limited. Expo has already dropped support. Removing YAML support lets us drop a dependency also. Changelog: Differential Revision: D109987702
Repository: react/metro. Description: ๐ The JavaScript bundler for React Native Stars: 5609, Forks: 685. Primary language: JavaScript. Languages: JavaScript (99.8%), SCSS (0.1%), CSS (0%), TypeScript (0%). License: MIT. Homepage: https://metrobundler.dev Topics: bundler, javascript, react-native. Latest release: v0.85.0 (1w ago). Open PRs: 96, open issues: 361. Last activity: 7h ago. Community health: 75%. Top contributors: robhogan, rafeca, motiz88, cpojer, davidaurelio, SamChou19815, huntie, martinbigio, dependabot[bot], vjeux and others.