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

Add Babel to transform ES2020 public and static class fields #3820

Merged
merged 10 commits into from
Jul 14, 2023

Commits on Jul 14, 2023

  1. Apply Babel transforms (without polyfills) on Rollup builds

    Transforms will be applied based on `.browserslistrc` supported browsers, with helper functions bundled if needed
    colinrotherham committed Jul 14, 2023
    1 Configuration menu
    Copy the full SHA
    d2c4e2e View commit details
    Browse the repository at this point in the history
  2. Apply Babel bug fixes to avoid “catch all” transforms

    We enable `{ bugfixes: true }` to let Babel use smaller transforms for partially supported browser features
    
    For example, Babel knows that full support for template strings as “tagged templates with escape sequences” only shipped in Safari 11
    
    But we can now use template strings in Safari 9.1 too
    
    https://caniuse.com/mdn-javascript_grammar_template_literals_template_literal_revision
    colinrotherham committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    dfedc61 View commit details
    Browse the repository at this point in the history
  3. Configure ESLint to allow ES2020 class fields

    Babel transpiles ES2020 class fields for our Browserslist supported browsers
    colinrotherham committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    2b1c7d5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    66a46be View commit details
    Browse the repository at this point in the history
  5. Prefer using window.setTimeout() and window.setInterval()

    Shows the compiler that we’re using DOM timers and intervals, rather than Node.js globals
    colinrotherham committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    570012c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    26158f4 View commit details
    Browse the repository at this point in the history
  7. Use class fields for all assigned properties

    The compiler can infer construction types, reducing JSDoc comments
    colinrotherham committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    ac7bdf5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    61fa8bb View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7e412fe View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    bb9e80f View commit details
    Browse the repository at this point in the history