Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Apr 9, 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.

@react-sizebot
Copy link

react-sizebot commented Apr 9, 2025

Comparing: 31ecc98...bb01a3c

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 = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 517.64 kB 517.64 kB = 92.08 kB 92.08 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 622.45 kB 622.45 kB = 110.15 kB 110.15 kB
facebook-www/ReactDOM-prod.classic.js = 655.67 kB 655.67 kB = 115.73 kB 115.72 kB
facebook-www/ReactDOM-prod.modern.js = 645.95 kB 645.95 kB = 114.18 kB 114.17 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against bb01a3c

@@ -240,3 +235,78 @@ export type ReactTimeInfo = {
export type ReactDebugInfo = Array<
ReactComponentInfo | ReactEnvironmentInfo | ReactAsyncInfo | ReactTimeInfo,
>;

Copy link
Member

Choose a reason for hiding this comment

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

I assume you're intentionally omitting LegacyHidden because deprecated, and doesn't need shared?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mainly I didn't see it implemented in Fizz originally. I see now that it's just part of the list of pass-throughs that just read children (along with Profiler) but we're not importing it into Fizz so was no reason to.

@sebmarkbage sebmarkbage merged commit c44e4a2 into facebook:main Apr 10, 2025
241 checks passed
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