Skip to content

Remove long-deprecated resolver.blacklistRE config (use blockList) - #1758

Closed
robhogan wants to merge 1 commit into
mainfrom
export-D110175146
Closed

robhogan wants to merge 1 commit into
mainfrom
export-D110175146

Conversation

@robhogan

Copy link
Copy Markdown
Collaborator

Summary:
blacklistRE was deprecated in favour of blockList in 2020. This removes it (the next release is semver major anyway), and tidies up some shim code.

Changelog:

 - **[Breaking]**: Remove deprecated `resolver.blacklistRE` (use `blockList`) 

Reviewed By: huntie

Differential Revision: D110175146

Summary:
`blacklistRE` was deprecated in favour of `blockList` [in 2020](94c0b54). This removes it (the next release is semver major anyway), and tidies up some shim code.

Changelog:
```
 - **[Breaking]**: Remove deprecated `resolver.blacklistRE` (use `blockList`) 
```

Reviewed By: huntie

Differential Revision: D110175146
@meta-codesync

meta-codesync Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@robhogan has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110175146.

@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 Jun 30, 2026
@meta-codesync meta-codesync Bot closed this in ac59593 Jun 30, 2026
@meta-codesync meta-codesync Bot added the Merged label Jun 30, 2026
@meta-codesync

meta-codesync Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in ac59593.

robhogan added a commit to expo/expo that referenced this pull request Sep 14, 2026
Metro 0.87 removes `resolver.blacklistRE` (react/metro#1758), so Expo no longer supports it at all. This removes the doctor check and its test.
robhogan added a commit to expo/expo that referenced this pull request Sep 14, 2026
# Why

Metro 0.87 removes two options Expo still references, and repurposes the last positional argument of `JsFileWrapping.wrapModule`. These all surfaced typechecking against `@expo/metro@58.0.0-rc.0`.

# How

- `transformer.unstable_renameRequire` is removed, and `require` is never renamed (react/metro@42577f778). `ExpoMetroConfig` already defaulted it to `false`, so the Babel path doesn't change behaviour. The last `wrapModule` argument is now an options object though, so passing the old boolean would have been silently wrong - this forwards `unstable_useStaticHermesModuleFactory` from `customTransformOptions.unstable_staticHermesOptimizedRequire`, as Metro's own transform worker does, and carries it through the reconcile settings for the serializer pass. The Noxcturnal path now always uses `require` too - without `ExpoMetroConfig`'s default it would otherwise have started renaming.
- `resolver.blacklistRE` is removed (react/metro#1758), and Metro silently ignores a leftover value. The file map fork now reads only `blockList`, matching Metro's `createFileMap`. `expo-doctor` keeps flagging `blacklistRE`, which is more useful now it does nothing.
- Metro always emits indexed source maps (react/metro@d17cecc07), so the `sourceMapString` parity test compares flattened mappings rather than bytes.
- Drops `unstable_renameRequire` from the transform worker test configs, which already expect the unrenamed `require` (#50143).

# Test Plan

```
npx turbo run typecheck --filter=@expo/cli --filter=@expo/metro-config --filter=@expo/metro-file-map --filter=babel-preset-expo --filter=expo-doctor --filter=expo --filter=expo-module-scripts --force --continue
pnpm --dir packages/@expo/metro-config jest src/transform-worker src/serializer
pnpm --dir packages/expo-doctor jest src/checks/__tests__/MetroConfigCheck.test.ts
pnpm --dir packages/@expo/cli jest --findRelatedTests src/start/server/metro/createFileMap-fork.ts
```

Typecheck 7/7. `@expo/metro-config` 928 passed (34 suites), `expo-doctor` 18 passed, `@expo/cli` 31 passed. Lint clean apart from existing `no-new-func` warnings.
robhogan added a commit to expo/expo that referenced this pull request Sep 14, 2026
Metro 0.87 removes `resolver.blacklistRE` (react/metro#1758), so Expo no longer supports it at all. This removes the doctor check and its test.
robhogan added a commit to expo/expo that referenced this pull request Sep 14, 2026
# Why

Metro 0.87 removes two options Expo still references, and repurposes the last positional argument of `JsFileWrapping.wrapModule`. These all surfaced typechecking against `@expo/metro@58.0.0-rc.0`.

# How

- `transformer.unstable_renameRequire` is removed, and `require` is never renamed (react/metro@42577f778). `ExpoMetroConfig` already defaulted it to `false`, so the Babel path doesn't change behaviour. The last `wrapModule` argument is now an options object though, so passing the old boolean would have been silently wrong - this forwards `unstable_useStaticHermesModuleFactory` from `customTransformOptions.unstable_staticHermesOptimizedRequire`, as Metro's own transform worker does, and carries it through the reconcile settings for the serializer pass. The Noxcturnal path now always uses `require` too - without `ExpoMetroConfig`'s default it would otherwise have started renaming.
- `resolver.blacklistRE` is removed (react/metro#1758), and Metro silently ignores a leftover value. The file map fork now reads only `blockList`, matching Metro's `createFileMap`. `expo-doctor` keeps flagging `blacklistRE`, which is more useful now it does nothing.
- Metro always emits indexed source maps (react/metro@d17cecc07), so the `sourceMapString` parity test compares flattened mappings rather than bytes.
- Drops `unstable_renameRequire` from the transform worker test configs, which already expect the unrenamed `require` (#50143).

# Test Plan

```
npx turbo run typecheck --filter=@expo/cli --filter=@expo/metro-config --filter=@expo/metro-file-map --filter=babel-preset-expo --filter=expo-doctor --filter=expo --filter=expo-module-scripts --force --continue
pnpm --dir packages/@expo/metro-config jest src/transform-worker src/serializer
pnpm --dir packages/expo-doctor jest src/checks/__tests__/MetroConfigCheck.test.ts
pnpm --dir packages/@expo/cli jest --findRelatedTests src/start/server/metro/createFileMap-fork.ts
```

Typecheck 7/7. `@expo/metro-config` 928 passed (34 suites), `expo-doctor` 18 passed, `@expo/cli` 31 passed. Lint clean apart from existing `no-new-func` warnings.
robhogan added a commit to expo/expo that referenced this pull request Sep 14, 2026
Metro 0.87 removes `resolver.blacklistRE` (react/metro#1758), so Expo no longer supports it at all. This removes the doctor check and its test.
robhogan added a commit to expo/expo that referenced this pull request Sep 15, 2026
# Why

Metro 0.87 removes two options Expo still references, and repurposes the last positional argument of `JsFileWrapping.wrapModule`. These all surfaced typechecking against `@expo/metro@58.0.0-rc.0`.

# How

- `transformer.unstable_renameRequire` is removed, and `require` is never renamed (react/metro@42577f778). `ExpoMetroConfig` already defaulted it to `false`, so the Babel path doesn't change behaviour. The last `wrapModule` argument is now an options object though, so passing the old boolean would have been silently wrong - this forwards `unstable_useStaticHermesModuleFactory` from `customTransformOptions.unstable_staticHermesOptimizedRequire`, as Metro's own transform worker does, and carries it through the reconcile settings for the serializer pass. The Noxcturnal path now always uses `require` too - without `ExpoMetroConfig`'s default it would otherwise have started renaming.
- `resolver.blacklistRE` is removed (react/metro#1758), and Metro silently ignores a leftover value. The file map fork now reads only `blockList`, matching Metro's `createFileMap`. `expo-doctor` keeps flagging `blacklistRE`, which is more useful now it does nothing.
- Metro always emits indexed source maps (react/metro@d17cecc07), so the `sourceMapString` parity test compares flattened mappings rather than bytes.
- Drops `unstable_renameRequire` from the transform worker test configs, which already expect the unrenamed `require` (#50143).

# Test Plan

```
npx turbo run typecheck --filter=@expo/cli --filter=@expo/metro-config --filter=@expo/metro-file-map --filter=babel-preset-expo --filter=expo-doctor --filter=expo --filter=expo-module-scripts --force --continue
pnpm --dir packages/@expo/metro-config jest src/transform-worker src/serializer
pnpm --dir packages/expo-doctor jest src/checks/__tests__/MetroConfigCheck.test.ts
pnpm --dir packages/@expo/cli jest --findRelatedTests src/start/server/metro/createFileMap-fork.ts
```

Typecheck 7/7. `@expo/metro-config` 928 passed (34 suites), `expo-doctor` 18 passed, `@expo/cli` 31 passed. Lint clean apart from existing `no-new-func` warnings.
robhogan added a commit to expo/expo that referenced this pull request Sep 15, 2026
Metro 0.87 removes `resolver.blacklistRE` (react/metro#1758), so Expo no longer supports it at all. This removes the doctor check and its test.
robhogan added a commit to expo/expo that referenced this pull request Sep 15, 2026
# Why

Metro 0.87 removes two options Expo still references, and repurposes the last positional argument of `JsFileWrapping.wrapModule`. These all surfaced typechecking against `@expo/metro@58.0.0-rc.0`.

# How

- `transformer.unstable_renameRequire` is removed, and `require` is never renamed (react/metro@42577f778). `ExpoMetroConfig` already defaulted it to `false`, so the Babel path doesn't change behaviour. The last `wrapModule` argument is now an options object though, so passing the old boolean would have been silently wrong - this forwards `unstable_useStaticHermesModuleFactory` from `customTransformOptions.unstable_staticHermesOptimizedRequire`, as Metro's own transform worker does, and carries it through the reconcile settings for the serializer pass. The Noxcturnal path now always uses `require` too - without `ExpoMetroConfig`'s default it would otherwise have started renaming.
- `resolver.blacklistRE` is removed (react/metro#1758), and Metro silently ignores a leftover value. The file map fork now reads only `blockList`, matching Metro's `createFileMap`. `expo-doctor` keeps flagging `blacklistRE`, which is more useful now it does nothing.
- Metro always emits indexed source maps (react/metro@d17cecc07), so the `sourceMapString` parity test compares flattened mappings rather than bytes.
- Drops `unstable_renameRequire` from the transform worker test configs, which already expect the unrenamed `require` (#50143).

# Test Plan

```
npx turbo run typecheck --filter=@expo/cli --filter=@expo/metro-config --filter=@expo/metro-file-map --filter=babel-preset-expo --filter=expo-doctor --filter=expo --filter=expo-module-scripts --force --continue
pnpm --dir packages/@expo/metro-config jest src/transform-worker src/serializer
pnpm --dir packages/expo-doctor jest src/checks/__tests__/MetroConfigCheck.test.ts
pnpm --dir packages/@expo/cli jest --findRelatedTests src/start/server/metro/createFileMap-fork.ts
```

Typecheck 7/7. `@expo/metro-config` 928 passed (34 suites), `expo-doctor` 18 passed, `@expo/cli` 31 passed. Lint clean apart from existing `no-new-func` warnings.
robhogan added a commit to expo/expo that referenced this pull request Sep 15, 2026
…ro 0.87.1) (#50135)

# Why

`@expo/metro@58.0.0-rc.0` is published
(expo/expo-metro#42), wrapping Metro 0.87.1.
This moves Expo onto it, along with the changes Metro 0.87 needs.

# How

- Moves the seven packages that depend on `@expo/metro` to
`~58.0.0-rc.0`, with the lockfile regenerated with pnpm 12.2.1. All
seven resolve `@expo/metro@58.0.0-rc.0` and `metro@0.87.1`.
- The changes Metro 0.87 needs:
- `transformer.unstable_renameRequire` is removed, and `require` is
never renamed (react/metro@42577f778). We
already defaulted it to `false`, so no behaviour change on the Babel
path, but `wrapModule`'s last argument is now an options object and the
old boolean would have been silently wrong. This forwards
`unstable_useStaticHermesModuleFactory` like Metro's transform worker
does, including through the reconcile settings. The Noxcturnal path now
always uses `require` too - without our default it would otherwise have
started renaming.
- `resolver.blacklistRE` is removed
(react/metro#1758), and we drop support for it
entirely. The file map fork reads only `blockList`, matching Metro's
`createFileMap`. `expo-doctor` now reports a leftover `blacklistRE` as
removed, rather than deprecated.
- `resolver.schemeResolvers` is new
(react/metro#1804). A `node:` specifier with no
registered scheme resolver now fails with
`FailedToResolveUnsupportedError`, which our optional resolvers didn't
swallow, so web builds importing `node:` built-ins broke instead of
getting an empty shim. They now treat it as a resolution miss.
- Metro stores per-module maps as compact VLQ (`VlqMap`) itself now
(react/metro@20b3b377c), so our `__packed`
maps, the `transformFile`/`sourceMapString` patches and our
`sourceMapString` fork are gone - the worker emits `VlqMap`s via Metro's
helpers. Metro's bundle maps are indexed
(react/metro@d17cecc07), so
`composeSourceMaps` (Hermes exports) and the server-output map rewrite
flatten them first. The transformer `CACHE_VERSION` is bumped, since
stale `__packed` cache entries otherwise fail Metro's serializer.
  - Fixtures and snapshots expect the unrenamed `require`.

# Test Plan

## Benchmarks
 
Focusing on memory and bundling speed, following the switch from Expo
packed maps (which were already an improvement over Metro 0.84) and
Metro-native VLQ maps (new in Metro 0.87).

Headlines are:
 - 11% faster cold bundles overall
- Transform time memory use within noise (ArrayBuffers down, but small
absolute numbers)
- First `.map` 6% faster, -35% peak+off-peak memory use overall (but
+18% peak RSS increase, +5% peak RSS total)
 - Second `.map` -33% memory use
 
This is all about as expected. Metro-native string maps use Base64
string encoding, which is slightly less dense than the binary
ArrayBuffer packs it replaces. However, it's much faster to serialise
to/from JSON, and requires no work at all to serialise index maps.

| | main | PR | Change |
|---|---|---|---|
| **Cold `.bundle`** | | | |
| Time | 3.21 s [3.03–3.36] | 2.87 s [2.71–3.02] | −11% |
| Peak heap increase, all threads | 1,319 MB | 1,304 MB | −1% |
| Peak heap increase, main thread only | 173 MB | 178 MB | +3% |
| Peak RSS increase (process) | 2,089 MB [1,975–2,209] | 2,142 MB
[2,060–2,240] | +3% |
| Peak RSS | 2,782 MB | 2,840 MB | +2% |
| `ArrayBuffer`s still in use after GC, main thread | 56 MB | 13 MB |
−76% |
| **First `.map` after the bundle** | | | |
| Time | 0.80 s [0.78–0.83] | 0.75 s [0.73–0.78] | −6% |
| Peak heap increase, all threads | 170 MB | 118 MB | −31% |
| Peak heap + off-heap increase, all threads | 246 MB | 161 MB | −35% |
| Peak RSS increase (process) | 254 MB [247–271] | 299 MB [277–312] |
**+18%** |
| Peak RSS | 2,852 MB | 3,003 MB | +5% |
| Memory still held after GC | about 0 | about 0 | — |
| Size | 41.3 MB (flat) | 42.3 MB (indexed) | +2% |
| **Second `.map`** | | | |
| Time | 0.77 s | 0.74 s | −4% |
| Peak heap + off-heap increase, all threads | 238 MB | 160 MB | −33% |

## Validation

```
npx turbo run typecheck --filter=@expo/cli --filter=@expo/metro-config --filter=@expo/metro-file-map --filter=babel-preset-expo --filter=expo-doctor --filter=expo --filter=expo-module-scripts --force --continue
pnpm --dir packages/@expo/metro-config jest src/transform-worker src/serializer
pnpm --dir packages/expo-doctor jest src/checks/__tests__/MetroConfigCheck.test.ts
pnpm --dir packages/@expo/cli jest --findRelatedTests src/start/server/metro/createFileMap-fork.ts
```

Locally: typecheck 7/7, `@expo/metro-config` 928 passed (34 suites),
`expo-doctor` 18 passed, `@expo/cli` 31 passed, lint clean apart from
existing `no-new-func` warnings. Plus CI, including the e2e jobs that
exercise Metro at runtime.

# Checklist

- [x] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [x] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- [x] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
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. Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant