Conversation
robhogan
added this pull request to stack #2016
October 3, 2026 22:02
robhogan
requested review from
huntie and
vzaidman
and
a balanced review from Copilot
October 3, 2026 22:08
robhogan
marked this pull request as ready for review
October 3, 2026 22:09
There was a problem hiding this comment.
Copilot review overview
馃煛 Changes recommended
The new tests use unnormalized filesystem paths and will fail on Windows.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds virtual URL prefix support to HMR entry-point resolution, matching Metro Server behavior.
Changes:
- Resolves
[metro-project]and[metro-watchFolders]HMR paths. - Reuses
ProjectRouteMapfor server-root handling. - Adds coverage for both virtual prefixes.
| File | Description |
|---|---|
packages/鈥媘etro/鈥媠rc/鈥婬mrServer.js |
Integrates virtual route mapping into HMR. |
packages/鈥媘etro/鈥媠rc/鈥媉_tests__/鈥婬mrServer-test.js |
Tests virtual-prefix entry points. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
*Recreating #1709 / [D104223071](https://www.internalfb.com/diff/D104223071) (@motiz88) for GH first without a diff attachment* D102004228 added support for serving bundles from `Server` with the handling `[metro-watchFolders]/<N>/...` or `[metro-project]/...` virtual URL prefixes, but did not add the same support in `HmrServer`. Here, `HmrServer` constructs its own `ProjectRouteMap` to match `Server`'s behaviour exactly. Changelog: * **[Fix]:** Prevent HMR crash on `[metro-watchFolders]` or `[metro-project]` URLs Test plan: See [D104223071](https://www.internalfb.com/diff/D104223071)
This branch has not been deployed
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.

Recreating #1709 / D104223071 (@motiz88) for GH first without a diff attachment
D102004228 added support for serving bundles from
Serverwith the handling[metro-watchFolders]/<N>/...or[metro-project]/...virtual URL prefixes, but did not add the same support inHmrServer.Here,
HmrServerconstructs its ownProjectRouteMapto matchServer's behaviour exactly.Changelog:
[metro-watchFolders]or[metro-project]URLsTest plan:
See D104223071