docs(dev): add HMR design#10271
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label graphite: merge-when-ready to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
5f6144d to
d01a05b
Compare
fb4fd32 to
96e1361
Compare
d01a05b to
51cff6e
Compare
a7b7ea6 to
df875eb
Compare
51cff6e to
6342d8b
Compare
df875eb to
fc95531
Compare
bbe6ee4 to
d439856
Compare
fc95531 to
4bb6915
Compare
d439856 to
5a95b7f
Compare
4bb6915 to
14f9582
Compare
5a95b7f to
15e9fac
Compare
14f9582 to
0fe85ef
Compare
hyfdev
left a comment
There was a problem hiding this comment.
Two important guarantees in this design are not implemented safely yet.
| ship map. Re-sending a changed module follows from the stamps. | ||
|
|
||
| A reconnect resets `shipped[C]` to empty. Lazy chunk sizing also | ||
| subtracts the boot-evaluated map (modules the entry chunk evaluated at |
There was a problem hiding this comment.
Important: This is not a safe invariant yet. The hello carries no build ID, so a client evaluating an older output can freeze the latest top_level_evaluated snapshot. Lazy sizing may then omit a factory that this client does not actually hold (or holds at an older version); I reproduced the resulting initModule(dep) with no dep factory. Please document this as an unresolved correctness gap, or bind the snapshot to the served build before presenting this subtraction as safe.
| only the server holds module sources. Its output is a prediction, | ||
| filtered through the ship map into the patch — the push carries only | ||
| `changedIds`, the walk's _inputs_. Both error directions are safe: | ||
| over-predict wastes bytes; under-predict is caught by the client's |
There was a problem hiding this comment.
Important: The claim that under-prediction always becomes a clean reload is false today. FbmHMRClient checks hasFactory only for updateSet; an initModule failure during apply reaches the queue's warn-only catch, and lazy-chunk initModule runs outside that recovery path entirely. We have a concrete missing-factory case that leaves the page alive and stale. Please describe these as unresolved failure modes (or add the reload recovery) instead of asserting “never a stale page” and listing every missing factory as a reload fallback below.
hyfdev
left a comment
There was a problem hiding this comment.
Approved with the important design gaps noted in the review.
15e9fac to
78ebf17
Compare
0fe85ef to
f26ce7a
Compare
78ebf17 to
38184eb
Compare
✅ Deploy Preview for rolldown-rs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
38184eb to
d86b2c2
Compare
d86b2c2 to
28254ba
Compare
28254ba to
118cba4
Compare
118cba4 to
24a5389
Compare
8a37a87 to
5c7244e
Compare
24a5389 to
c7a5c77
Compare
5c7244e to
0b44bbc
Compare
c7a5c77 to
484b7e4
Compare
484b7e4 to
29ce07d
Compare

No description provided.