Skip to content

[flow] Migrate type param bounds to extends syntax in ReactNativeTypes#35996

Draft
marcoww6 wants to merge 1 commit intofacebook:mainfrom
marcoww6:flow-extends-syntax-ReactNativeTypes
Draft

[flow] Migrate type param bounds to extends syntax in ReactNativeTypes#35996
marcoww6 wants to merge 1 commit intofacebook:mainfrom
marcoww6:flow-extends-syntax-ReactNativeTypes

Conversation

@marcoww6
Copy link

Summary

  • Migrates deprecated Flow type parameter bound syntax <T: Type> to <T extends Type> in ReactNativeTypes.js
  • This is the source file that gets synced to react-native-github/Libraries/Renderer/shims/ReactNativeTypes.js via the build pipeline
  • Fixes the source-of-truth so the downstream sync in D95907848 picks up the change automatically

Context

D95907848 codemodded the synced copy in fbsource, but reviewer noted this file is synced from the React repo and must be changed here first (see PR #35989 comment).

Test plan

  • Verified all 5 occurrences updated (InspectorDataGetter, ReactNativeType.findHostInstance_DEPRECATED, ReactNativeType.findNodeHandle, ReactFabricType.findHostInstance_DEPRECATED, ReactFabricType.findNodeHandle)
  • Confirmed file parses correctly with flow-remove-types
  • CI Flow type check

…Types

Flow's type parameter bound syntax `<T: Type>` has been deprecated in
favor of `<T extends Type>`. This updates the 5 occurrences in
ReactNativeTypes.js to use the new syntax.

This is the source file that gets synced to react-native-github at
Libraries/Renderer/shims/ReactNativeTypes.js via the build pipeline.
@meta-cla meta-cla bot added the CLA Signed label Mar 10, 2026
@marcoww6 marcoww6 marked this pull request as draft March 10, 2026 21:16
@react-sizebot
Copy link

Comparing: 014138d...38423fd

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.84 kB 6.84 kB +0.05% 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 611.79 kB 611.79 kB = 108.12 kB 108.12 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 677.72 kB 677.72 kB = 119.08 kB 119.08 kB
facebook-www/ReactDOM-prod.classic.js = 697.67 kB 697.67 kB = 122.58 kB 122.58 kB
facebook-www/ReactDOM-prod.modern.js = 687.98 kB 687.98 kB = 120.96 kB 120.96 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
react-native/shims/ReactNativeTypes.js +0.49% 7.11 kB 7.14 kB +0.20% 1.99 kB 2.00 kB

Generated by 🚫 dangerJS against 38423fd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants