Skip to content

[0.22] Remove dead code - #2897

Merged
zoontek merged 18 commits into
0.22-devfrom
remove-dead-code
Oct 9, 2026
Merged

zoontek merged 18 commits into
0.22-devfrom
remove-dead-code

Conversation

@zoontek

@zoontek zoontek commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Important

This PR targets the 0.22-dev branch

This PR removes code that is not exported, and that nothing in the package uses.

Deleted modules (orphans):

  • JSEventLoopWatchdog
  • StaticContainer, StaticRenderer
  • setAndForwardRef
  • PanResponder/Alternative
  • StyleSheet/compiler/resolveShadowValue

Duplicates removed (files were 100% identical):

  • StyleSheet/compiler/unitlessNumbers (use modules/unitlessNumbers instead)
  • vendor/hash (use exports/StyleSheet/compiler/hash instead as it's only used in exports/StyleSheet)
  • modules/normalizeColor (use exports/StyleSheet/compiler/normalizeColor instead as it's only used in exports/StyleSheet)

Other cleanup:

  • Unused Animated code in AnimatedImplementation, NativeAnimatedHelper, createAnimatedComponent
  • Removed prop-types from the benchmarks package. AppText used it for legacy contextTypes, which React 19 no longer supports
  • Deleted the prop-types and create-react-class flow-typed stubs
  • stringifyValueWithProperty is no longer exported, because only its own module uses it
  • Deleted commented-out code in ScrollView, StyleSheet and the benchmarks app
  • Deleted unused ResponderEventTypes constants
  • Deleted addModalityListener from modality
  • Removed boxFlex and boxFlexGroup from unitlessNumbers

@zoontek
zoontek requested a review from Kudo October 8, 2026 20:38
@codesandbox-ci

codesandbox-ci Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e0a3c32:

Sandbox Source
react-native-web-examples Configuration

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Size Change: -8.3 kB (-3.75%)

Total Size: 213 kB

📦 View Changed
Filename Size Change
packages/react-native-web/dist/exports/PanResponder/Alternative.js 0 B -3.23 kB (removed) 🏆
packages/react-native-web/dist/exports/ScrollView/index.js 7.36 kB -46 B (-0.62%)
packages/react-native-web/dist/exports/StyleSheet/compiler/index.js 4.04 kB -19 B (-0.47%)
packages/react-native-web/dist/exports/StyleSheet/compiler/normalizeValueWithProperty.js 423 B +9 B (+2.17%)
packages/react-native-web/dist/exports/StyleSheet/compiler/resolveShadowValue.js 0 B -447 B (removed) 🏆
packages/react-native-web/dist/exports/StyleSheet/compiler/unitlessNumbers.js 0 B -715 B (removed) 🏆
packages/react-native-web/dist/exports/StyleSheet/index.js 1.79 kB -59 B (-3.2%)
packages/react-native-web/dist/modules/modality/index.js 1.38 kB -109 B (-7.32%) ✅
packages/react-native-web/dist/modules/normalizeColor/index.js 0 B -421 B (removed) 🏆
packages/react-native-web/dist/modules/unitlessNumbers/index.js 710 B -5 B (-0.7%)
packages/react-native-web/dist/modules/useResponderEvents/ResponderEventTypes.js 417 B -48 B (-10.32%) 👏
packages/react-native-web/dist/vendor/hash/index.js 0 B -558 B (removed) 🏆
packages/react-native-web/dist/vendor/react-native/Animated/AnimatedImplementation.js 4.2 kB -10 B (-0.24%)
packages/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js 808 B -10 B (-1.22%)
packages/react-native-web/dist/vendor/react-native/Animated/NativeAnimatedHelper.js 4.29 kB -45 B (-1.04%)
packages/react-native-web/dist/vendor/react-native/JSEventLoopWatchdog/index.js 0 B -1.01 kB (removed) 🏆
packages/react-native-web/dist/vendor/react-native/StaticContainer/index.js 0 B -562 B (removed) 🏆
packages/react-native-web/dist/vendor/react-native/StaticRenderer/index.js 0 B -290 B (removed) 🏆
packages/react-native-web/dist/vendor/react-native/Utilities/setAndForwardRef.js 0 B -726 B (removed) 🏆

compressed-size-action

Comment thread package-lock.json
@zoontek
zoontek merged commit d9152ed into 0.22-dev Oct 9, 2026
6 checks passed
@zoontek
zoontek deleted the remove-dead-code branch October 9, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants