Skip to content

[0.22] Raise browser targets to october 2021 versions - #2899

Merged
zoontek merged 3 commits into
0.22-devfrom
raise-browsers-target
Oct 10, 2026
Merged

zoontek merged 3 commits into
0.22-devfrom
raise-browsers-target

Conversation

@zoontek

@zoontek zoontek commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Important

This PR targets the 0.22-dev branch

Raises the browser targets to versions released around October 2021, and removes the polyfills, vendor prefixes and fallbacks those versions no longer need.

New targets: Chrome 95, Edge 95, Firefox 93, Safari 15.1, iOS Safari 15.1. The Babel config and the browser compatibility docs are updated to match.

Build:

  • Removed the class-properties, object-rest-spread and nullish-coalescing-operator Babel plugins.

CSS output:

  • @keyframes no longer emits a @-webkit-keyframes prefixed version
  • placeholderTextColor emits only ::placeholder
  • unitlessNumbers only adds Webkit prefixed keys. The ms, Moz and O keys are gone
  • textDecorationLine no longer falls back to textDecoration
  • ScrollView no longer sets -webkit-overflow-scrolling: touch (no longer needed since iOS 13)
  • SafeAreaView always uses env(). The constant() check is gone

Runtime fallbacks removed:

  • Appearance and AccessibilityInfo use addEventListener('change') instead of addListener (deprecated)
  • AppState no longer checks for webkitHidden / webkitvisibilitychange
  • addEventListener no longer tests for passive listener support
  • ImageLoader always uses image.decode()
  • useElementLayout no longer warns about ResizeObserver polyfill
  • isLocaleRTL expects Intl.Locale to exist

@zoontek
zoontek requested a review from Kudo October 9, 2026 09:27
@codesandbox-ci

codesandbox-ci Bot commented Oct 9, 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 c9e7493:

Sandbox Source
react-native-web-examples Configuration

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Size Change: -9.25 kB (-4.34%)

Total Size: 204 kB

📦 View Changed
Filename Size Change
packages/react-native-web/dist/exports/AccessibilityInfo/index.js 882 B -37 B (-4.03%)
packages/react-native-web/dist/exports/ActivityIndicator/index.js 1.01 kB -127 B (-11.19%) 👏
packages/react-native-web/dist/exports/Appearance/index.js 623 B +74 B (+13.48%) ⚠️
packages/react-native-web/dist/exports/AppRegistry/AppContainer.js 524 B -4 B (-0.76%)
packages/react-native-web/dist/exports/AppRegistry/index.js 1.14 kB -45 B (-3.78%)
packages/react-native-web/dist/exports/AppRegistry/renderApplication.js 678 B -2 B (-0.29%)
packages/react-native-web/dist/exports/AppState/index.js 701 B -115 B (-14.09%) 👏
packages/react-native-web/dist/exports/BackHandler/index.js 319 B +1 B (+0.31%)
packages/react-native-web/dist/exports/Button/index.js 650 B -19 B (-2.84%)
packages/react-native-web/dist/exports/Clipboard/index.js 646 B +2 B (+0.31%)
packages/react-native-web/dist/exports/Dimensions/index.js 1.18 kB +6 B (+0.51%)
packages/react-native-web/dist/exports/I18nManager/index.js 257 B -4 B (-1.53%)
packages/react-native-web/dist/exports/Image/index.js 3.6 kB -321 B (-8.18%) ✅
packages/react-native-web/dist/exports/ImageBackground/index.js 810 B -108 B (-11.76%) 👏
packages/react-native-web/dist/exports/Keyboard/index.js 353 B +1 B (+0.28%)
packages/react-native-web/dist/exports/KeyboardAvoidingView/index.js 589 B -92 B (-13.51%) 👏
packages/react-native-web/dist/exports/Linking/index.js 1.29 kB -22 B (-1.67%)
packages/react-native-web/dist/exports/Modal/index.js 1.04 kB -132 B (-11.25%) 👏
packages/react-native-web/dist/exports/Modal/ModalAnimation.js 1.18 kB -25 B (-2.07%)
packages/react-native-web/dist/exports/Modal/ModalContent.js 795 B -68 B (-7.88%) ✅
packages/react-native-web/dist/exports/Modal/ModalFocusTrap.js 1.59 kB -1 B (-0.06%)
packages/react-native-web/dist/exports/Modal/ModalPortal.js 489 B +4 B (+0.82%)
packages/react-native-web/dist/exports/NativeModules/index.js 216 B +1 B (+0.47%)
packages/react-native-web/dist/exports/PixelRatio/index.js 565 B +1 B (+0.18%)
packages/react-native-web/dist/exports/Platform/index.js 321 B +1 B (+0.31%)
packages/react-native-web/dist/exports/Pressable/index.js 1.34 kB -232 B (-14.71%) 👏
packages/react-native-web/dist/exports/processColor/index.js 354 B +1 B (+0.28%)
packages/react-native-web/dist/exports/RefreshControl/index.js 383 B -122 B (-24.16%) 🎉
packages/react-native-web/dist/exports/render/index.js 306 B +1 B (+0.33%)
packages/react-native-web/dist/exports/SafeAreaView/index.js 495 B -152 B (-23.49%) 🎉
packages/react-native-web/dist/exports/ScrollView/index.js 7.07 kB -293 B (-3.98%)
packages/react-native-web/dist/exports/ScrollView/ScrollViewBase.js 1.38 kB -144 B (-9.48%) ✅
packages/react-native-web/dist/exports/StatusBar/index.js 276 B +1 B (+0.36%)
packages/react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle.js 1.78 kB -216 B (-10.81%) 👏
packages/react-native-web/dist/exports/StyleSheet/compiler/hash.js 560 B +2 B (+0.36%)
packages/react-native-web/dist/exports/StyleSheet/compiler/hyphenateStyleName.js 341 B +2 B (+0.59%)
packages/react-native-web/dist/exports/StyleSheet/compiler/index.js 3.81 kB -238 B (-5.89%) ✅
packages/react-native-web/dist/exports/StyleSheet/compiler/normalizeColor.js 423 B -4 B (-0.94%)
packages/react-native-web/dist/exports/StyleSheet/compiler/normalizeValueWithProperty.js 426 B +3 B (+0.71%)
packages/react-native-web/dist/exports/StyleSheet/dom/createCSSStyleSheet.js 548 B +3 B (+0.55%)
packages/react-native-web/dist/exports/StyleSheet/dom/createOrderedCSSStyleSheet.js 1.99 kB +3 B (+0.15%)
packages/react-native-web/dist/exports/StyleSheet/dom/index.js 908 B +4 B (+0.44%)
packages/react-native-web/dist/exports/StyleSheet/index.js 1.68 kB -104 B (-5.82%) ✅
packages/react-native-web/dist/exports/StyleSheet/preprocess.js 1.9 kB -30 B (-1.56%)
packages/react-native-web/dist/exports/StyleSheet/validate.js 844 B -3 B (-0.35%)
packages/react-native-web/dist/exports/Switch/index.js 1.64 kB -212 B (-11.47%) 👏
packages/react-native-web/dist/exports/Text/index.js 1.78 kB -294 B (-14.18%) 👏
packages/react-native-web/dist/exports/TextInput/index.js 3.45 kB -272 B (-7.32%) ✅
packages/react-native-web/dist/exports/TouchableHighlight/index.js 1.54 kB -201 B (-11.53%) 👏
packages/react-native-web/dist/exports/TouchableOpacity/index.js 1.24 kB -170 B (-12.04%) 👏
packages/react-native-web/dist/exports/TouchableWithoutFeedback/index.js 836 B -33 B (-3.8%)
packages/react-native-web/dist/exports/UIManager/index.js 1.24 kB -42 B (-3.28%)
packages/react-native-web/dist/exports/useColorScheme/index.js 371 B -30 B (-7.48%) ✅
packages/react-native-web/dist/exports/useWindowDimensions/index.js 516 B -12 B (-2.27%)
packages/react-native-web/dist/exports/Vibration/index.js 301 B +1 B (+0.33%)
packages/react-native-web/dist/exports/View/index.js 1.46 kB -243 B (-14.29%) 👏
packages/react-native-web/dist/modules/AccessibilityUtil/index.js 252 B +1 B (+0.4%)
packages/react-native-web/dist/modules/AccessibilityUtil/isDisabled.js 236 B -1 B (-0.42%)
packages/react-native-web/dist/modules/AccessibilityUtil/propsToAccessibilityComponent.js 620 B +2 B (+0.32%)
packages/react-native-web/dist/modules/AccessibilityUtil/propsToAriaRole.js 432 B +1 B (+0.23%)
packages/react-native-web/dist/modules/addEventListener/index.js 547 B -303 B (-35.65%) 🎉
packages/react-native-web/dist/modules/AssetRegistry/index.js 641 B -1 B (-0.16%)
packages/react-native-web/dist/modules/createDOMProps/index.js 3.32 kB -574 B (-14.76%) 👏
packages/react-native-web/dist/modules/forwardedProps/index.js 1.01 kB +2 B (+0.2%)
packages/react-native-web/dist/modules/ImageLoader/index.js 1.34 kB -15 B (-1.11%)
packages/react-native-web/dist/modules/InteractionManager/index.js 697 B +4 B (+0.58%)
packages/react-native-web/dist/modules/InteractionManager/TaskQueue.js 370 B -8 B (-2.12%)
packages/react-native-web/dist/modules/isSelectionValid/index.js 318 B +1 B (+0.32%)
packages/react-native-web/dist/modules/mergeRefs/index.js 439 B +2 B (+0.46%)
packages/react-native-web/dist/modules/modality/index.js 1.39 kB +5 B (+0.36%)
packages/react-native-web/dist/modules/multiplyStyleLengthValue/index.js 411 B +5 B (+1.23%)
packages/react-native-web/dist/modules/pick/index.js 271 B +1 B (+0.37%)
packages/react-native-web/dist/modules/requestIdleCallback/index.js 385 B -1 B (-0.26%)
packages/react-native-web/dist/modules/TextInputState/index.js 614 B +1 B (+0.16%)
packages/react-native-web/dist/modules/UnimplementedView/index.js 465 B -51 B (-9.88%) 👏
packages/react-native-web/dist/modules/unitlessNumbers/index.js 699 B -11 B (-1.55%)
packages/react-native-web/dist/modules/useElementLayout/index.js 873 B -163 B (-15.73%) 👏
packages/react-native-web/dist/modules/useEvent/index.js 544 B -1 B (-0.18%)
packages/react-native-web/dist/modules/useHover/index.js 1.26 kB -83 B (-6.19%) ✅
packages/react-native-web/dist/modules/useLocale/index.js 442 B -2 B (-0.45%)
packages/react-native-web/dist/modules/useLocale/isLocaleRTL.js 699 B -39 B (-5.28%) ✅
packages/react-native-web/dist/modules/usePlatformMethods/index.js 501 B -3 B (-0.6%)
packages/react-native-web/dist/modules/usePressEvents/PressResponder.js 4.71 kB -83 B (-1.73%)
packages/react-native-web/dist/modules/useResponderEvents/createResponderEvent.js 1.4 kB +7 B (+0.5%)
packages/react-native-web/dist/modules/useResponderEvents/index.js 868 B -31 B (-3.45%)
packages/react-native-web/dist/modules/useResponderEvents/ResponderEventTypes.js 419 B +2 B (+0.48%)
packages/react-native-web/dist/modules/useResponderEvents/ResponderSystem.js 5.16 kB -112 B (-2.12%)
packages/react-native-web/dist/modules/useResponderEvents/ResponderTouchHistoryStore.js 1.77 kB +18 B (+1.03%)
packages/react-native-web/dist/modules/useResponderEvents/utils.js 1.52 kB -9 B (-0.59%)
packages/react-native-web/dist/modules/useStable/index.js 399 B +1 B (+0.25%)
packages/react-native-web/dist/vendor/react-native/Animated/Animated.js 354 B -45 B (-11.28%) 👏
packages/react-native-web/dist/vendor/react-native/Animated/AnimatedEvent.js 1.79 kB -2 B (-0.11%)
packages/react-native-web/dist/vendor/react-native/Animated/AnimatedImplementation.js 3.99 kB -211 B (-5.02%) ✅
packages/react-native-web/dist/vendor/react-native/Animated/AnimatedMock.js 1.19 kB -91 B (-7.12%) ✅
packages/react-native-web/dist/vendor/react-native/Animated/animations/Animation.js 842 B +7 B (+0.84%)
packages/react-native-web/dist/vendor/react-native/Animated/animations/DecayAnimation.js 744 B -70 B (-8.6%) ✅
packages/react-native-web/dist/vendor/react-native/Animated/animations/SpringAnimation.js 2.73 kB -296 B (-9.8%) 👏
packages/react-native-web/dist/vendor/react-native/Animated/animations/TimingAnimation.js 1.2 kB -94 B (-7.25%) ✅
packages/react-native-web/dist/vendor/react-native/Animated/bezier.js 1.41 kB +9 B (+0.64%)
packages/react-native-web/dist/vendor/react-native/Animated/components/AnimatedFlatList.js 433 B +2 B (+0.46%)
packages/react-native-web/dist/vendor/react-native/Animated/components/AnimatedScrollView.js 434 B -1 B (-0.23%)
packages/react-native-web/dist/vendor/react-native/Animated/components/AnimatedSectionList.js 436 B +1 B (+0.23%)
packages/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js 718 B -90 B (-11.14%) 👏
packages/react-native-web/dist/vendor/react-native/Animated/Easing.js 1.91 kB -13 B (-0.67%)
packages/react-native-web/dist/vendor/react-native/Animated/NativeAnimatedHelper.js 4.14 kB -147 B (-3.42%)
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedColor.js 2.21 kB -44 B (-1.96%)
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedDiffClamp.js 533 B -1 B (-0.19%)
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedDivision.js 724 B +8 B (+1.12%)
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedInterpolation.js 2.78 kB -34 B (-1.21%)
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedNode.js 1.43 kB -26 B (-1.79%)
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedProps.js 1.13 kB -43 B (-3.65%)
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedStyle.js 991 B -2 B (-0.2%)
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedTracking.js 830 B -46 B (-5.25%) ✅
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedValue.js 2.58 kB -2 B (-0.08%)
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedValueXY.js 1.61 kB +7 B (+0.44%)
packages/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedWithChildren.js 720 B -98 B (-11.98%) 👏
packages/react-native-web/dist/vendor/react-native/Animated/SpringConfig.js 714 B +3 B (+0.42%)
packages/react-native-web/dist/vendor/react-native/Animated/useAnimatedProps.js 2.35 kB -188 B (-7.41%) ✅
packages/react-native-web/dist/vendor/react-native/deepDiffer/index.js 748 B -5 B (-0.66%)
packages/react-native-web/dist/vendor/react-native/EventEmitter/NativeEventEmitter.js 1.06 kB -59 B (-5.25%) ✅
packages/react-native-web/dist/vendor/react-native/FillRateHelper/index.js 2.05 kB -38 B (-1.82%)
packages/react-native-web/dist/vendor/react-native/FlatList/index.js 5.01 kB -194 B (-3.73%)
packages/react-native-web/dist/vendor/react-native/LayoutAnimation/index.js 1.1 kB -16 B (-1.44%)
packages/react-native-web/dist/vendor/react-native/PanResponder/index.js 5.13 kB +2 B (+0.04%)
packages/react-native-web/dist/vendor/react-native/ReactNative/ReactNativeFeatureFlags.js 326 B -3 B (-0.91%)
packages/react-native-web/dist/vendor/react-native/SectionList/index.js 2.06 kB -97 B (-4.49%)
packages/react-native-web/dist/vendor/react-native/TouchHistoryMath/index.js 1.05 kB -19 B (-1.78%)
packages/react-native-web/dist/vendor/react-native/TurboModule/TurboModuleRegistry.js 355 B +2 B (+0.57%)
packages/react-native-web/dist/vendor/react-native/Utilities/useMergeRefs.js 640 B -19 B (-2.88%)
packages/react-native-web/dist/vendor/react-native/vendor/emitter/EventEmitter.js 1.02 kB -30 B (-2.87%)
packages/react-native-web/dist/vendor/react-native/ViewabilityHelper/index.js 2.23 kB -178 B (-7.4%) ✅
packages/react-native-web/dist/vendor/react-native/VirtualizedList/CellRenderMask.js 1.19 kB -75 B (-5.95%) ✅
packages/react-native-web/dist/vendor/react-native/VirtualizedList/ChildListCollection.js 583 B -215 B (-26.94%) 🎉
packages/react-native-web/dist/vendor/react-native/VirtualizedList/index.js 14.6 kB -784 B (-5.1%) ✅
packages/react-native-web/dist/vendor/react-native/VirtualizedList/StateSafePureComponent.js 791 B +6 B (+0.76%)
packages/react-native-web/dist/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js 1.58 kB -133 B (-7.76%) ✅
packages/react-native-web/dist/vendor/react-native/VirtualizedList/VirtualizedListContext.js 755 B -55 B (-6.79%) ✅
packages/react-native-web/dist/vendor/react-native/VirtualizedSectionList/index.js 3.37 kB -290 B (-7.92%) ✅
packages/react-native-web/dist/vendor/react-native/VirtualizeUtils/index.js 2.39 kB -52 B (-2.13%)

compressed-size-action

@zoontek zoontek changed the title Raise browser targets to october 2021 versions [0.22] Raise browser targets to october 2021 versions Oct 9, 2026
@zoontek

zoontek commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

For context: Safari 15.1 was chosen as the baseline because it corresponds to the minimum iOS version currently supported by React Native (as Safari and iOS versions are tied together). The versions of the other browsers were selected based on their release dates, matching the month in which Safari 15.1 was released.

@Kudo Kudo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

as talked offline. the little concern is that android builtin webview could still has old chrome version. for example, android 9 builtin webview is chrome 66.
for expo dom components, we have a default babel preset that could transform to support chrome 66. if people want to support old browsers, they could customize babel config to support old js features.

i'm wondering if all the pr's change can be babel transformed or polyfilled. this is agent report as a reference.

--

Babel only covers syntax. On browsers older than the new targets:

  • image.decode(), MediaQueryList.addEventListener, and ResizeObserver are now called without a check, so they need a polyfill.
  • addEventListener now always passes the options object. A browser without options support reads it as useCapture = true, and a polyfill can't fix that.
  • The runtime CSS fallbacks (@-webkit-keyframes, prefixed placeholder selectors, constant()) are gone. Babel and PostCSS can't add them back.

Expo DOM components on Android 9 (Chrome 66)

We talked earlier about the Android 9 factory WebView, which runs Chrome 66. Expo DOM components build with a separate Babel preset for old Android WebViews (webview.ts). It includes the class-properties, object-rest-spread, and nullish-coalescing transforms, and Metro runs it on node_modules too. So the syntax is covered.

For runtime APIs, MDN compat data shows that Chrome 66 has image.decode() (64), ResizeObserver (64), MediaQueryList change events (39), and the addEventListener options object (49). Intl.Locale arrives in Chrome 74, but isLocaleRTL catches the error and falls back to the language code. So I don't expect this PR to break DOM components on Android 9.

Comment thread configs/babel.config.js
@zoontek
zoontek merged commit e1e5f03 into 0.22-dev Oct 10, 2026
6 checks passed
@zoontek
zoontek deleted the raise-browsers-target branch October 10, 2026 09:01
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