Repository navigation
Conversation
The watcher backends filter change events by matching each relative path against globs with `micromatch`. Those globs aren't configurable - Metro builds them from `extensions`, plus `**/package.json` and the health check file prefix - so all micromatch ever checks is an extension, a file name or a prefix. This replaces the watchers' `globs` option with `included`, a set of extensions, basenames and basename prefixes checked with `Set` lookups and `startsWith`. Extensions are compared using `path.extname`, the same as the Node crawler: https://github.com/react/metro/blob/13604e0207e02c6aed7fbff97af439ed2df5fd1f/packages/metro-file-map/src/crawlers/node/index.js#L78-L79 It also removes the watchers' `dot` option, which Metro always set to `true`, and the unused `Glob` type. With that, `micromatch` is no longer a dependency of `metro-file-map`. The watcher backends are only reachable through `metro-file-map/private/*`, and Expo uses neither them nor the removed types. Changelog: Internal Test plan: New unit test for `isIncluded`. `integration-test.js` drives each watcher backend against a real temporary tree with an extension, a file name and a prefix in `included`, so it exercises this directly.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The replacement preserves intended watcher semantics and is supported by focused unit and backend integration coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Removes micromatch from production watcher filtering, replacing glob matching with explicit extension, basename, and prefix checks.
Changes:
- Introduces typed inclusion rules shared by all watcher backends.
- Removes obsolete glob and dotfile options.
- Adds unit and integration coverage for the new filtering behavior.
| File | Description |
|---|---|
WatchmanWatcher.js |
Uses explicit inclusion filtering. |
NativeWatcher.js |
Uses explicit inclusion filtering. |
FallbackWatcher.js |
Uses explicit inclusion filtering. |
common.js |
Implements isIncluded. |
AbstractWatcher.js |
Stores inclusion configuration. |
Watcher.js |
Constructs extension, basename, and prefix rules. |
flow-types.js |
Defines the new inclusion API. |
package.json |
Removes micromatch. |
WatchmanWatcher-test.js |
Updates Watchman fixtures. |
NativeWatcher-test.js |
Updates native watcher fixtures. |
FallbackWatcher-test.js |
Updates fallback watcher fixtures. |
integration-test.js |
Exercises inclusion rules across backends. |
common-test.js |
Tests inclusion matching semantics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
robhogan
marked this pull request as ready for review
October 5, 2026 13:07
robhogan
added this pull request to stack #2023
October 5, 2026 13:09
huntie
approved these changes
Oct 5, 2026
robhogan
added a commit
that referenced
this pull request
Oct 5, 2026
`Watcher` always watches `package.json` files, whatever `extensions` says, because they're crucial for module resolution. Neither crawler does the same, so with `json` absent from `extensions` they're skipped at startup. `FileMap` then checks every regular file change against `extensions` again, which drops the `package.json` events the watcher backend let through. This passes the same basenames to both crawlers. The Node crawler checks them alongside extensions. The Watchman crawler adds a `name` term for any basename whose extension isn't in `extensions`, and widens the `suffix` generator to cover it. With crawling and watching agreeing on which files to include, the watcher backends' `included` filter from #2000 is the only one needed, so this removes `FileMap`'s `hasWatchedExtension` recheck. There's no difference for a default Metro config, where `json` is in `sourceExts`. Changelog: [Fix] Include `package.json` files in the file map even when `json` is not in `sourceExts`, `assetExts` or `watcher.additionalExts`. Test plan: New `planQuery` tests for basenames, including that they don't change the query when `extensions` already covers them. The crawler integration test runs both crawlers against a real fixture tree with a `package.json` and only `js` in `extensions`. The `FileMap` test for the removed recheck is deleted, since `common-test.js` covers the backends' filter.
This was referenced Oct 5, 2026
robhogan
added a commit
to expo/expo
that referenced
this pull request
Oct 5, 2026
# Why Cherry-pick of #51093 onto `sdk-58`. It ports react/metro#2000 to `@expo/metro-file-map`. `micromatch` depends on `braces`, which has a CVE ([GHSA-vfj7-8cjw-p6xm](GHSA-vfj7-8cjw-p6xm)). The fork only uses `micromatch` to filter watcher change events, against globs it builds itself from `extensions`, `package.json` and the health check file prefix. None of them are configurable, so all it ever checks is an extension, a file name or a prefix. # How The same change as on `main`. The watchers' `globs` option is replaced by `included`, a set of `extensions`, `basenames` and `basenamePrefixes` checked with `Set` lookups and `startsWith`. A file matches an extension when its basename ends with `.` followed by that extension, as the `**/*.<ext>` globs did with `dot: true`. This keeps `.env` matching the `env` extension that `@expo/metro-config` adds to `watcher.additionalExts`, which `path.extname` would miss. The watchers' `dot` option, which was always `true`, and the unused `Glob` type are removed, and with them the `micromatch` and `@types/micromatch` dependencies. One difference from upstream: the fork's `healthCheckFilePrefix` is nullable, so a null prefix now adds no prefix match rather than a literal `**/null*` glob. Both commits from #51093 cherry-picked cleanly. The `.changeset` file is replaced by a `CHANGELOG.md` entry, because `sdk-58` does not use changesets. # Test Plan New unit test for `isIncluded`, ported from upstream and extended with dotfile and multi-part extension cases. A one-off script checked `isIncluded` against `micromatch.some(path, globs, {dot: true})` on 21 edge cases (`.env`, `.env.local`, `.envrc`, `src/.js`, `a.d.ts`, `a.js.map`, `a..js`, …) with no mismatches. On this branch, `pnpm test` (725 tests), `pnpm typecheck` and `pnpm lint` pass in `packages/@expo/metro-file-map`, and `pnpm install --frozen-lockfile` accepts the lockfile. The CLI E2E suite exercises the watchers through the injected file map, including `.env` reloads in `hmr-env-vars.test.ts`. # Checklist - [x] I added a `CHANGELOG.md` entry. - [ ] Docs: not applicable.
robhogan
added a commit
that referenced
this pull request
Oct 5, 2026
#2000 replaced the watchers' globs with `included`, comparing extensions using `path.extname`. That isn't quite what the `**/*.<ext>` globs did with `dot: true` - `path.extname('.env')` is `''`, so `.env` no longer matches an `env` extension, and a multi-part extension like `d.ts` never matches. That's a regression for Expo, which adds `env` to `watcher.additionalExts` so that editing `.env` triggers a reload: https://github.com/expo/expo/blob/7c9b0878c1942d24552adfab7de396c9e4a69103/packages/@expo/metro-config/src/ExpoMetroConfig.ts#L345 This matches an extension when the basename ends with `.` followed by that extension, after any dot, which is what the globs matched. Changelog: Internal (#2000 is unreleased) Test plan: Extended `common-test.js` with dotfile and multi-part extension cases. Compared against `micromatch.some(path, globs, {dot: true})` with the globs Metro used to build, on 21 edge-case paths (`.env`, `.env.local`, `.envrc`, `src/.js`, `a.d.ts`, `a.js.map`, `a..js`, ...), with no mismatches. Found by Expo's `hmr-env-vars` E2E test failing on the port of #2000 to Expo's file map, expo/expo#51093, which carries the same fix.
robhogan
added a commit
to expo/expo
that referenced
this pull request
Oct 5, 2026
# Why Port of react/metro#2000 + react/metro#2024 to `@expo/metro-file-map`. `micromatch` depends on `braces`, which has a CVE ([GHSA-vfj7-8cjw-p6xm](GHSA-vfj7-8cjw-p6xm)). The fork only uses `micromatch` to filter watcher change events, against globs it builds itself from `extensions`, `package.json` and the health check file prefix. None of them are configurable, so all it ever checks is an extension, a file name or a prefix. # How This replaces the watchers' `globs` option with `included`, a set of `extensions`, `basenames` and `basenamePrefixes` checked with `Set` lookups and `startsWith`. A file matches an extension when its basename ends with `.` followed by that extension, so `.env` matches `env` and `foo.d.ts` matches `d.ts`. It also removes the watchers' `dot` option, which was always `true`, and the unused `Glob` type. With that, `micromatch` and `@types/micromatch` are no longer dependencies of `@expo/metro-file-map`. One difference from upstream: the fork's `healthCheckFilePrefix` is nullable, so a null prefix now adds no prefix match rather than a literal `**/null*` glob. # Test Plan New unit test for `isIncluded`, ported from upstream. `pnpm test`, `pnpm typecheck` and `pnpm lint` pass in `packages/@expo/metro-file-map`. The CLI E2E suite exercises the watchers through the injected file map. # Checklist - [x] I added a changeset and followed [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
robhogan
added a commit
to expo/expo
that referenced
this pull request
Oct 5, 2026
# Why Cherry-pick of #51093 onto `sdk-58`. It ports react/metro#2000 and its follow-up react/metro#2024 to `@expo/metro-file-map`. `micromatch` depends on `braces`, which has a CVE ([GHSA-vfj7-8cjw-p6xm](GHSA-vfj7-8cjw-p6xm)). The fork only uses `micromatch` to filter watcher change events, against globs it builds itself from `extensions`, `package.json` and the health check file prefix. None of them are configurable, so all it ever checks is an extension, a file name or a prefix. # How The same change as on `main`. The watchers' `globs` option is replaced by `included`, a set of `extensions`, `basenames` and `basenamePrefixes` checked with `Set` lookups and `startsWith`. A file matches an extension when its basename ends with `.` followed by that extension, as the `**/*.<ext>` globs did with `dot: true`. This keeps `.env` matching the `env` extension that `@expo/metro-config` adds to `watcher.additionalExts`, which `path.extname` would miss. The watchers' `dot` option, which was always `true`, and the unused `Glob` type are removed, and with them the `micromatch` and `@types/micromatch` dependencies. One difference from upstream: the fork's `healthCheckFilePrefix` is nullable, so a null prefix now adds no prefix match rather than a literal `**/null*` glob. The merged commit from #51093 (52acc2c) cherry-picked cleanly. The `.changeset` file is replaced by a `CHANGELOG.md` entry, because `sdk-58` does not use changesets. # Test Plan New unit test for `isIncluded`, ported from upstream and extended with dotfile and multi-part extension cases. A one-off script checked `isIncluded` against `micromatch.some(path, globs, {dot: true})` on 21 edge cases (`.env`, `.env.local`, `.envrc`, `src/.js`, `a.d.ts`, `a.js.map`, `a..js`, …) with no mismatches. On this branch, `pnpm test` (725 tests), `pnpm typecheck` and `pnpm lint` pass in `packages/@expo/metro-file-map`, and `pnpm install --frozen-lockfile` accepts the lockfile. The CLI E2E suite exercises the watchers through the injected file map, including `.env` reloads in `hmr-env-vars.test.ts`. # Checklist - [x] I added a `CHANGELOG.md` entry. - [ ] Docs: not applicable. (cherry picked from commit 52acc2c)
This was referenced Oct 5, 2026
robhogan
added a commit
that referenced
this pull request
Oct 5, 2026
`Watcher` always watches `package.json` files, whatever `extensions` says, because they're crucial for module resolution. Neither crawler does the same, so with `json` absent from `extensions` they're skipped at startup. `FileMap` then checks every regular file change against `extensions` again, which drops the `package.json` events the watcher backend let through. This passes the same basenames to both crawlers. The Node crawler checks them alongside extensions. The Watchman crawler adds a `name` term for any basename whose extension isn't in `extensions`, and widens the `suffix` generator to cover it. With crawling and watching agreeing on which files to include, the watcher backends' `included` filter from #2000 is the only one needed, so this removes `FileMap`'s `hasWatchedExtension` recheck. There's no difference for a default Metro config, where `json` is in `sourceExts`. Changelog: [Fix] Include `package.json` files in the file map even when `json` is not in `sourceExts`, `assetExts` or `watcher.additionalExts`. Test plan: New `planQuery` tests for basenames, including that they don't change the query when `extensions` already covers them. The crawler integration test runs both crawlers against a real fixture tree with a `package.json` and only `js` in `extensions`. The `FileMap` test for the removed recheck is deleted, since `common-test.js` covers the backends' filter.
robhogan
added a commit
that referenced
this pull request
Oct 5, 2026
`Watcher` always watches `package.json` files, whatever `extensions` says, because they're crucial for module resolution. Neither crawler does the same, so with `json` absent from `extensions` they're skipped at startup. `FileMap` then checks every regular file change against `extensions` again, which drops the `package.json` events the watcher backend let through. This passes the same basenames to both crawlers. The Node crawler checks them alongside extensions. The Watchman crawler adds a `name` term for any basename whose extension isn't in `extensions`, and widens the `suffix` generator to cover it. With crawling and watching agreeing on which files to include, the watcher backends' `included` filter from #2000 is the only one needed, so this removes `FileMap`'s `hasWatchedExtension` recheck. There's no difference for a default Metro config, where `json` is in `sourceExts`. Changelog: [Fix] Include `package.json` files in the file map even when `json` is not in `sourceExts`, `assetExts` or `watcher.additionalExts`. Test plan: New `planQuery` tests for basenames, including that they don't change the query when `extensions` already covers them. The crawler integration test runs both crawlers against a real fixture tree with a `package.json` and only `js` in `extensions`. The `FileMap` test for the removed recheck is deleted, since `common-test.js` covers the backends' filter.
robhogan
added a commit
to expo/expo
that referenced
this pull request
Oct 5, 2026
# Why Cherry-pick of #51093 onto `sdk-58`. It ports react/metro#2000 and its follow-up react/metro#2024 to `@expo/metro-file-map`. `micromatch` depends on `braces`, which has a CVE ([GHSA-vfj7-8cjw-p6xm](GHSA-vfj7-8cjw-p6xm)). The fork only uses `micromatch` to filter watcher change events, against globs it builds itself from `extensions`, `package.json` and the health check file prefix. None of them are configurable, so all it ever checks is an extension, a file name or a prefix. # How The same change as on `main`. The watchers' `globs` option is replaced by `included`, a set of `extensions`, `basenames` and `basenamePrefixes` checked with `Set` lookups and `startsWith`. A file matches an extension when its basename ends with `.` followed by that extension, as the `**/*.<ext>` globs did with `dot: true`. This keeps `.env` matching the `env` extension that `@expo/metro-config` adds to `watcher.additionalExts`, which `path.extname` would miss. The watchers' `dot` option, which was always `true`, and the unused `Glob` type are removed, and with them the `micromatch` and `@types/micromatch` dependencies. One difference from upstream: the fork's `healthCheckFilePrefix` is nullable, so a null prefix now adds no prefix match rather than a literal `**/null*` glob. The merged commit from #51093 (52acc2c) cherry-picked cleanly. The `.changeset` file is replaced by a `CHANGELOG.md` entry, because `sdk-58` does not use changesets. # Test Plan New unit test for `isIncluded`, ported from upstream and extended with dotfile and multi-part extension cases. A one-off script checked `isIncluded` against `micromatch.some(path, globs, {dot: true})` on 21 edge cases (`.env`, `.env.local`, `.envrc`, `src/.js`, `a.d.ts`, `a.js.map`, `a..js`, …) with no mismatches. On this branch, `pnpm test` (725 tests), `pnpm typecheck` and `pnpm lint` pass in `packages/@expo/metro-file-map`, and `pnpm install --frozen-lockfile` accepts the lockfile. The CLI E2E suite exercises the watchers through the injected file map, including `.env` reloads in `hmr-env-vars.test.ts`. # Checklist - [x] I added a `CHANGELOG.md` entry. - [ ] Docs: not applicable. (cherry picked from commit 52acc2c)
robhogan
added a commit
to expo/expo
that referenced
this pull request
Oct 5, 2026
# Why Cherry-pick of #51093 onto `sdk-58`. It ports react/metro#2000 and its follow-up react/metro#2024 to `@expo/metro-file-map`. `micromatch` depends on `braces`, which has a CVE ([GHSA-vfj7-8cjw-p6xm](GHSA-vfj7-8cjw-p6xm)). The fork only uses `micromatch` to filter watcher change events, against globs it builds itself from `extensions`, `package.json` and the health check file prefix. None of them are configurable, so all it ever checks is an extension, a file name or a prefix. # How The same change as on `main`. The watchers' `globs` option is replaced by `included`, a set of `extensions`, `basenames` and `basenamePrefixes` checked with `Set` lookups and `startsWith`. A file matches an extension when its basename ends with `.` followed by that extension, as the `**/*.<ext>` globs did with `dot: true`. This keeps `.env` matching the `env` extension that `@expo/metro-config` adds to `watcher.additionalExts`, which `path.extname` would miss. The watchers' `dot` option, which was always `true`, and the unused `Glob` type are removed, and with them the `micromatch` and `@types/micromatch` dependencies. One difference from upstream: the fork's `healthCheckFilePrefix` is nullable, so a null prefix now adds no prefix match rather than a literal `**/null*` glob. The merged commit from #51093 (52acc2c) cherry-picked cleanly. The `.changeset` file is replaced by a `CHANGELOG.md` entry, because `sdk-58` does not use changesets. # Test Plan New unit test for `isIncluded`, ported from upstream and extended with dotfile and multi-part extension cases. A one-off script checked `isIncluded` against `micromatch.some(path, globs, {dot: true})` on 21 edge cases (`.env`, `.env.local`, `.envrc`, `src/.js`, `a.d.ts`, `a.js.map`, `a..js`, …) with no mismatches. On this branch, `pnpm test` (725 tests), `pnpm typecheck` and `pnpm lint` pass in `packages/@expo/metro-file-map`, and `pnpm install --frozen-lockfile` accepts the lockfile. The CLI E2E suite exercises the watchers through the injected file map, including `.env` reloads in `hmr-env-vars.test.ts`. # Checklist - [x] I added a `CHANGELOG.md` entry. - [ ] Docs: not applicable. (cherry picked from commit 52acc2c)
robhogan
added a commit
to expo/expo
that referenced
this pull request
Oct 5, 2026
# Why Cherry-pick of #51093 onto `sdk-57`. It ports react/metro#2000 and its follow-up react/metro#2024 to `@expo/metro-file-map`. `micromatch` depends on `braces`, which has a CVE ([GHSA-vfj7-8cjw-p6xm](GHSA-vfj7-8cjw-p6xm)). The fork only uses `micromatch` to filter watcher change events, against globs it builds itself from `extensions`, `package.json` and the health check file prefix. None of them are configurable, so all it ever checks is an extension, a file name or a prefix. # How The same change as on `main`. The watchers' `globs` option is replaced by `included`, a set of `extensions`, `basenames` and `basenamePrefixes` checked with `Set` lookups and `startsWith`. A file matches an extension when its basename ends with `.` followed by that extension, as the `**/*.<ext>` globs did with `dot: true`. This keeps `.env` matching the `env` extension that `@expo/metro-config` adds to `watcher.additionalExts`, which `path.extname` would miss. The watchers' `dot` option, which was always `true`, and the unused `Glob` type are removed, and with them the `micromatch` and `@types/micromatch` dependencies. One difference from upstream: the fork's `healthCheckFilePrefix` is nullable, so a null prefix now adds no prefix match rather than a literal `**/null*` glob. The merged commit from #51093 (52acc2c) cherry-picked cleanly. The `.changeset` file is replaced by a `CHANGELOG.md` entry, because `sdk-57` does not use changesets. # Test Plan New unit test for `isIncluded`, ported from upstream and extended with dotfile and multi-part extension cases. A one-off script checked `isIncluded` against `micromatch.some(path, globs, {dot: true})` on 21 edge cases (`.env`, `.env.local`, `.envrc`, `src/.js`, `a.d.ts`, `a.js.map`, `a..js`, …) with no mismatches. On this branch, `pnpm test` (725 tests), `pnpm typecheck` and `pnpm lint` pass in `packages/@expo/metro-file-map`, and `pnpm install --frozen-lockfile` accepts the lockfile. The CLI E2E suite exercises the watchers through the injected file map, including `.env` reloads in `hmr-env-vars.test.ts`. # Checklist - [x] I added a `CHANGELOG.md` entry. - [ ] Docs: not applicable. (cherry picked from commit 52acc2c)
robhogan
added a commit
to expo/expo
that referenced
this pull request
Oct 5, 2026
# Why Cherry-pick of #51093 onto `sdk-56`. It ports react/metro#2000 and its follow-up react/metro#2024 to `@expo/metro-file-map`. `micromatch` depends on `braces`, which has a CVE ([GHSA-vfj7-8cjw-p6xm](GHSA-vfj7-8cjw-p6xm)). The fork only uses `micromatch` to filter watcher change events, against globs it builds itself from `extensions`, `package.json` and the health check file prefix. None of them are configurable, so all it ever checks is an extension, a file name or a prefix. # How The same change as on `main`. The watchers' `globs` option is replaced by `included`, a set of `extensions`, `basenames` and `basenamePrefixes` checked with `Set` lookups and `startsWith`. A file matches an extension when its basename ends with `.` followed by that extension, as the `**/*.<ext>` globs did with `dot: true`. This keeps `.env` matching the `env` extension that `@expo/metro-config` adds to `watcher.additionalExts`, which `path.extname` would miss. The watchers' `dot` option, which was always `true`, and the unused `Glob` type are removed, and with them the `micromatch` and `@types/micromatch` dependencies. One difference from upstream: the fork's `healthCheckFilePrefix` is nullable, so a null prefix now adds no prefix match rather than a literal `**/null*` glob. The cherry-pick of the merged commit from #51093 (52acc2c) had one conflict. `FallbackWatcher.test.ts` doesn't exist on `sdk-56`, and the pick only updated the watcher options it passes, so I resolved it by keeping the file deleted. The `.changeset` file is replaced by a `CHANGELOG.md` entry, because `sdk-56` does not use changesets. # Test Plan New unit test for `isIncluded`, ported from upstream and extended with dotfile and multi-part extension cases. A one-off script checked `isIncluded` against `micromatch.some(path, globs, {dot: true})` on 21 edge cases (`.env`, `.env.local`, `.envrc`, `src/.js`, `a.d.ts`, `a.js.map`, `a..js`, …) with no mismatches. On this branch, `pnpm test` (720 tests), `pnpm typecheck` and `pnpm lint` pass in `packages/@expo/metro-file-map`, and `pnpm install --frozen-lockfile` with pnpm 10 (as CI uses on this branch) accepts the lockfile. The CLI E2E suite exercises the watchers through the injected file map, including `.env` reloads in `hmr-env-vars.test.ts`. # Checklist - [x] I added a `CHANGELOG.md` entry. - [ ] Docs: not applicable. (cherry picked from commit 52acc2c)
This was referenced Oct 5, 2026
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.
Security
This was originally filed a cleanup PR but the need is more acute due to CVE-2026-93687, a CVE on
braces, which is a dependency ofmicromatch. This PR removes Metro's only direct or indirect dependency onbracesin prod (there are still some indevDependencies, mostly via Jest).Context
The watcher backends filter change events by matching each relative path against globs with
micromatch. Those globs aren't configurable - Metro builds them fromextensions, plus**/package.jsonand the health check file prefix - so all micromatch ever checks is an extension, a base name or a prefix. We don't need the flexibility of globs here, and being explicit is faster, easier to reason about, and drops a dependency.Change
This replaces the watchers'
globsoption withincluded- a set ofextensions,basenamesandbasenamePrefixeschecked withSetlookups andstartsWith. Extensions are compared usingpath.extname, the same as the Node crawler:metro/packages/metro-file-map/src/crawlers/node/index.js
Lines 78 to 79 in 13604e0
It also removes the watchers'
dotoption, which Metro always set totrue, and the unusedGlobtype. With that,micromatchis no longer a dependency ofmetro-file-map. The watcher backends are only reachable throughmetro-file-map/private/*, and Expo uses neither them nor the removed types.Changelog
Test plan
New unit test for
isIncluded.integration-test.jsdrives each watcher backend against a real temporary tree with an extension, a file name and a prefix inincluded, so it exercises this directly.