Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

ActivityProps - Public API
LegacyHiddenProps - Public Legacy API
OffscreenProps - Internal implementation detail

This is the internal data structure and not the public API.
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Apr 9, 2025
// Note: These happen to have identical begin phases, for now. We shouldn't hold
// ourselves to this constraint, though. If the behavior diverges, we should
// fork the function.
// This just works today because it has the same Props.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to change the internal format of the OffscreenProps we just have to make the translation here.

@react-sizebot
Copy link

react-sizebot commented Apr 9, 2025

Comparing: 3fbfb9b...699e4ae

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 = 6.68 kB 6.68 kB +0.05% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js +0.02% 517.53 kB 517.64 kB +0.02% 92.06 kB 92.08 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js +0.02% 622.34 kB 622.45 kB +0.01% 110.13 kB 110.15 kB
facebook-www/ReactDOM-prod.classic.js +0.07% 655.25 kB 655.67 kB +0.02% 115.70 kB 115.73 kB
facebook-www/ReactDOM-prod.modern.js +0.07% 645.53 kB 645.95 kB +0.02% 114.15 kB 114.18 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 699e4ae

ActivityProps - Public API
LegacyHiddenProps - Public Legacy API
OffscreenProps - Internal implementation detail
We should figure out where we should put all these types that are public API
like ViewTransitionProps, SuspenseProps etc. They're currently untyped in Fizz.
@@ -645,8 +647,8 @@ function updateOffscreenComponent(
current: Fiber | null,
workInProgress: Fiber,
renderLanes: Lanes,
nextProps: OffscreenProps,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, what's the thinking here? Better for types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the implementation detail of both LegacyHidden AND OffscreenComponent which may have different prop types. I pass in both OffscreenProps and LegacyProps in here and so if we change them, then types will break and we'll not forget to bridge LegacyHidden.

@sebmarkbage sebmarkbage merged commit 31ecc98 into facebook:main Apr 10, 2025
241 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 10, 2025
ActivityProps - Public API
LegacyHiddenProps - Public Legacy API
OffscreenProps - Internal implementation detail

DiffTrain build for [31ecc98](31ecc98)
github-actions bot pushed a commit that referenced this pull request Apr 10, 2025
ActivityProps - Public API
LegacyHiddenProps - Public Legacy API
OffscreenProps - Internal implementation detail

DiffTrain build for [31ecc98](31ecc98)
sebmarkbage added a commit that referenced this pull request Apr 10, 2025
Stacked on #32838.

We don't always type the Props of built-ins. This adds typing for most
of the built-ins.

When we did type them, we used to put it in the `ReactFiber...Component`
files but any public API like this can be implemented in other renderers
too such as Fizz. So I moved them to `shared/ReactTypes` which is where
we put other public API types (that are not already built-in to Flow).
That way Fizz can import them and assert properly when it accesses the
props.
github-actions bot pushed a commit that referenced this pull request Apr 10, 2025
Stacked on #32838.

We don't always type the Props of built-ins. This adds typing for most
of the built-ins.

When we did type them, we used to put it in the `ReactFiber...Component`
files but any public API like this can be implemented in other renderers
too such as Fizz. So I moved them to `shared/ReactTypes` which is where
we put other public API types (that are not already built-in to Flow).
That way Fizz can import them and assert properly when it accesses the
props.

DiffTrain build for [c44e4a2](c44e4a2)
github-actions bot pushed a commit that referenced this pull request Apr 10, 2025
Stacked on #32838.

We don't always type the Props of built-ins. This adds typing for most
of the built-ins.

When we did type them, we used to put it in the `ReactFiber...Component`
files but any public API like this can be implemented in other renderers
too such as Fizz. So I moved them to `shared/ReactTypes` which is where
we put other public API types (that are not already built-in to Flow).
That way Fizz can import them and assert properly when it accesses the
props.

DiffTrain build for [c44e4a2](c44e4a2)
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.

4 participants