Repository navigation
Conversation
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
September 25, 2026 18:04
128f7ac to
6a3fc0e
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
September 29, 2026 14:30
6a3fc0e to
5de1b40
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
September 29, 2026 14:36
5de1b40 to
aa75dc8
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
October 9, 2026 15:34
aa75dc8 to
45d155a
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
October 9, 2026 15:42
45d155a to
d42120c
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
October 19, 2026 07:10
d42120c to
10a5047
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
2 times, most recently
from
October 19, 2026 07:34
51e1703 to
6fe4e75
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
October 19, 2026 07:48
6fe4e75 to
818a641
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
October 21, 2026 17:01
818a641 to
d0a76ec
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
October 30, 2026 14:19
d0a76ec to
6d7fdd5
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
October 30, 2026 14:24
6d7fdd5 to
fc0cb38
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
October 30, 2026 16:05
fc0cb38 to
e3fd11a
Compare
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
October 30, 2026 18:35
e3fd11a to
629563f
Compare
This was referenced Nov 16, 2026
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
November 16, 2026 16:19
629563f to
7866a3a
Compare
…ange event ## Context A file map plugin often knows things about a batch of changes that nothing else can work out. For Haste, #1952 records the names a resolution looked up, and invalidating from those means knowing which names a change rebound. The `ChangeEvent` carries paths, and by the time a consumer sees it a removed file's name is already gone from the map, but `HastePlugin.onChanged` has it to hand: https://github.com/react/metro/blob/6dbe97956af0f66f7a1d88014ba0b784a4a4d893/packages/metro-file-map/src/plugins/HastePlugin.js#L241-L245 ## This change This lets a plugin's `onChanged` return a summary, published on `ChangeEvent.pluginChanges` by plugin name. The summary type defaults to `void`, so existing plugins are unaffected. `HastePlugin` reports `changedNames`. Plugin names now have to be unique across all plugins, not just those with a worker. Persisted state was already keyed by name, so two sharing a name were already overwriting each other. Not addressed here: on a cold start `HastePlugin` builds a summary nobody reads (transient, and nothing where Haste is inert), and an edit that changes a file's Haste name is neither applied to the map nor reported, which predates this. Invalidating from the summary is the next PR. Changelog: Internal ## Test plan New unit tests cover the watch and recrawl paths and duplicate plugin names.
robhogan
force-pushed
the
robhogan/plugin-change-summaries
branch
from
November 18, 2026 13:05
7866a3a to
08303d7
Compare
robhogan
marked this pull request as ready for review
November 20, 2026 16:04
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.
Context
A file map plugin often knows things about a batch of changes that nothing else can work out. For Haste, #1952 records the names a resolution looked up, and invalidating from those means knowing which names a change rebound. The
ChangeEventcarries paths, and by the time a consumer sees it a removed file's name is already gone from the map, butHastePlugin.onChangedhas it to hand:metro/packages/metro-file-map/src/plugins/HastePlugin.js
Lines 241 to 245 in 6dbe979
This change
This lets a plugin's
onChangedreturn a summary, published onChangeEvent.pluginChangesby plugin name. The summary type defaults tovoid, so existing plugins are unaffected.HastePluginreportschangedNames.Plugin names now have to be unique across all plugins, not just those with a worker. Persisted state was already keyed by name, so two sharing a name were already overwriting each other.
Not addressed here: on a cold start
HastePluginbuilds a summary nobody reads (transient, and nothing where Haste is inert), and an edit that changes a file's Haste name is neither applied to the map nor reported, which predates this.Invalidating from the summary is the next PR.
Changelog: Internal
Test plan
New unit tests cover the watch and recrawl paths and duplicate plugin names.