Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIKE] Configure Babel to add core-js polyfills #4557

Closed
wants to merge 8 commits into from

Commits on Feb 19, 2024

  1. Move Babel browserslistEnv to config root

    This option is no longer `@babel/preset-env` specific since v7.13.0
    colinrotherham committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    0862adf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4ee513f View commit details
    Browse the repository at this point in the history
  3. Workaround for Opera Mobile 73 compatibility data

    Opera Mobile has relaunched for Android using Chromium but the compatibility data still thinks lots of features are unsupported:
    
    ```
    The es-shims polyfill added the following polyfills:
      Array.prototype.every { "opera_mobile":"73" }
      Array.prototype.indexOf { "opera_mobile":"73" }
      Array.prototype.keys { "opera_mobile":"73" }
      Date.now { "opera_mobile":"73" }
      Function.prototype.name { "opera_mobile":"73" }
      Object.entries { "opera_mobile":"73" }
      String.prototype.split { "opera_mobile":"73" }
      String.prototype.trim { "opera_mobile":"73" }
    ```
    
    See related issues:
    
    browserslist/browserslist#766
    babel/babel#15711
    colinrotherham committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    6b1bf23 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a7b3563 View commit details
    Browse the repository at this point in the history
  5. Exclude polyfill for ES2022 Error cause

    Although this polyfill is required for feature complete Error support, we don’t use the `.cause` property yet
    
    ```
    The es-shims polyfill added the following polyfills:
      es.error.cause { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
    ```
    colinrotherham committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    ada136d View commit details
    Browse the repository at this point in the history
  6. Exclude polyfill for WHATWG URL constructor undefined base issue

    Although this polyfill is required for bug-free `new URL('http://x', undefined)` in Safari versions < 14 with an `undefined` base, we don’t use it:
    
    ```
    The corejs3 polyfill added the following polyfills:
      web.url { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
      web.url-search-params { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
    ```
    colinrotherham committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    f25f11c View commit details
    Browse the repository at this point in the history
  7. Exclude polyfills for DOM collection iteration

    Although these polyfills are required to iterate DOM collections, we always use `Array.from()` so don’t need them:
    
    ```
    The corejs3 polyfill added the following polyfills:
      es.array.iterator { "chrome":"61", "opera":"48", "samsung":"8.2" }
      web.dom-collections.iterator { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
    ```
    colinrotherham committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    e5ebecd View commit details
    Browse the repository at this point in the history
  8. Ignore various fixes in supported features

    For example, polyfills to fix unhandled empty space characters in ES5 `''.trim()` that would be removed in ES2015
    colinrotherham committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    363b5f1 View commit details
    Browse the repository at this point in the history