Repository navigation
[0.22] Raise browser targets to october 2021 versions - #2899
Conversation
|
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:
|
|
Size Change: -9.25 kB (-4.34%) Total Size: 204 kB 📦 View Changed
|
|
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
left a comment
There was a problem hiding this comment.
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, andResizeObserverare now called without a check, so they need a polyfill.addEventListenernow always passes the options object. A browser without options support reads it asuseCapture = 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.
Important
This PR targets the
0.22-devbranchRaises 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:
class-properties,object-rest-spreadandnullish-coalescing-operatorBabel plugins.CSS output:
@keyframesno longer emits a@-webkit-keyframesprefixed versionplaceholderTextColoremits only::placeholderunitlessNumbersonly addsWebkitprefixed keys. Thems,MozandOkeys are gonetextDecorationLineno longer falls back totextDecorationScrollViewno longer sets-webkit-overflow-scrolling: touch(no longer needed since iOS 13)SafeAreaViewalways usesenv(). Theconstant()check is goneRuntime fallbacks removed:
AppearanceandAccessibilityInfouseaddEventListener('change')instead ofaddListener(deprecated)AppStateno longer checks forwebkitHidden/webkitvisibilitychangeaddEventListenerno longer tests for passive listener supportImageLoaderalways usesimage.decode()useElementLayoutno longer warns aboutResizeObserverpolyfillisLocaleRTLexpectsIntl.Localeto exist