Skip to content

[Fast Refresh] Unify hot reload type resolution - #36962

Merged
sophiebits merged 1 commit into
mainfrom
fresh-type-changes/unify-type-resolution
Jul 8, 2026
Merged

[Fast Refresh] Unify hot reload type resolution#36962
sophiebits merged 1 commit into
mainfrom
fresh-type-changes/unify-type-resolution

Conversation

@sophiebits

@sophiebits sophiebits commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Previously resolveForwardRefForHotReloading was treated as a special
case. It's simpler to move this logic to updateForwardRef which
mirrors how updateMemoComponent and mountLazyComponent already are,
and it allows us to unify to a single resolveTypeForHotReloading which
we'll use in the next commit.

Since .type is no longer changing we need to set didReceiveUpdate
manually.

This behavior is already tested in "can update forwardRef render
function in isolation".

Previously resolveForwardRefForHotReloading was treated as a special
case. It's simpler to move this logic to updateForwardRef which
mirrors how updateMemoComponent and mountLazyComponent already are,
and it allows us to unify to a single resolveTypeForHotReloading which
we'll use in the next commit.

Since .type is no longer changing we need to set didReceiveUpdate
manually.

This behavior is already tested in "can update forwardRef render
function in isolation".
@meta-cla meta-cla Bot added the CLA Signed label Jul 8, 2026
@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label Jul 8, 2026
@sophiebits
sophiebits requested a review from gaearon July 8, 2026 07:19
@sophiebits
sophiebits marked this pull request as ready for review July 8, 2026 07:20
@react-sizebot

Copy link
Copy Markdown

Comparing: 5a90a5a...d3ec1b0

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 7.19 kB 7.19 kB = 1.91 kB 1.91 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 614.54 kB 614.54 kB = 108.60 kB 108.60 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 7.19 kB 7.19 kB = 1.91 kB 1.91 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 685.72 kB 685.72 kB = 120.10 kB 120.10 kB
facebook-www/ReactDOM-prod.classic.js = 706.07 kB 706.07 kB = 123.68 kB 123.69 kB
facebook-www/ReactDOM-prod.modern.js = 696.39 kB 696.39 kB = 122.07 kB 122.07 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against d3ec1b0

@sophiebits
sophiebits merged commit df4bd1b into main Jul 8, 2026
247 checks passed
github-actions Bot pushed a commit that referenced this pull request Jul 8, 2026
Previously resolveForwardRefForHotReloading was treated as a special
case. It's simpler to move this logic to updateForwardRef which
mirrors how updateMemoComponent and mountLazyComponent already are,
and it allows us to unify to a single resolveTypeForHotReloading which
we'll use in the next commit.

Since .type is no longer changing we need to set didReceiveUpdate
manually.

This behavior is already tested in "can update forwardRef render
function in isolation".

DiffTrain build for [df4bd1b](df4bd1b)
github-actions Bot pushed a commit that referenced this pull request Jul 8, 2026
Previously resolveForwardRefForHotReloading was treated as a special
case. It's simpler to move this logic to updateForwardRef which
mirrors how updateMemoComponent and mountLazyComponent already are,
and it allows us to unify to a single resolveTypeForHotReloading which
we'll use in the next commit.

Since .type is no longer changing we need to set didReceiveUpdate
manually.

This behavior is already tested in "can update forwardRef render
function in isolation".

DiffTrain build for [df4bd1b](df4bd1b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants