GithubHelp home page GithubHelp logo

gerhobbelt / babel-preset-modern-browsers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from christophehurpeau/babel-preset-modern-browsers

0.0 2.0 0.0 45.35 MB

Babel presets for modern browsers

License: ISC License

JavaScript 100.00%

babel-preset-modern-browsers's Introduction

babel-preset-modern-browsers

Babel presets for modern browsers

This preset covers es2015, es2016, es2017 and es2018.

More info in the compatibility table below

babel 7

Since v12, this package requires @babel/[email protected]. If you use babel 6, you can still use the version "11.0.1" of this package. If you want to migrate, you can read the announcement and the official migration guide.

Alternatives

Modern browsers

  • with edge: true: Edge 15 Firefox 53 Chrome 55 Opera 42 Safari 10.1
  • with edge: false: Firefox 57 Chrome 63 Opera 50 Safari 10.1

Installation

npm install --save-dev babel-preset-modern-browsers@next @babel/core

Usage

Add the following line to your .babelrc file:

{
  "presets": ["modern-browsers"]
}

Options

  • loose: Enable “loose” transformations for any plugins in this preset that allow them (Disabled by default).
  • modules - Enable transformation of ES6 module syntax to another module type (Enabled by default to "commonjs"). Can be false to not transform modules, or "commonjs"
  • es2018 - Enable es2018 features (Enabled by default)
  • shippedProposals - Enable features in stages but already available in browsers (Enabled by default)
  • edge - Support Edge (Enabled by default)
{
  presets: [
    ["modern-browsers", { "loose": true }]
  ]
}
{
  presets: [
    [require("babel-preset-modern-browsers"), { "loose": true }]
  ]
}

Edge

Missing features added for edge option:

  • function-name
  • object rest/spread properties

Compatibility Table

Note: most unused plugins are babel 6 plugins, I didn't update them for the documentation.

Feature Edge Firefox Chrome Opera Safari

Shipped Proposals

Optional catch binding Edge None Firefox 58 Chrome 66 Opera 53 Safari 11.1
↳ (used) syntax-optional-catch-binding

ES2018

Object Rest/Spread Properties Edge None Firefox 55 Chrome 60 Opera 47 Safari 11.1
edge: proposal-object-rest-spread
else syntax-object-rest-spread
RegExp Unicode Property Escapes Edge None Firefox None Chrome 64 Opera 51 Safari 11.1
↳ (used) proposal-unicode-property-regex
Asynchronous Iterators Edge None Firefox 57 Chrome 63 Opera 50 Safari 11.1
edge: plugin-proposal-async-generator-functions
else syntax-async-generators

ES2017

trailing commas in function Edge 14 Firefox 52 Chrome 58 Opera 45 Safari 10
↳ (used) syntax-trailing-function-commas
async function Edge 15 Firefox 52 Chrome 55 Opera 42 Safari 10.1
↳ (unused) transform-async-to-generator

ES2016

exponentiation operator Edge 14 Firefox 52 Chrome 52 Opera 39 Safari 10
↳ (unused) transform-exponentiation-operator

ES2015

Edge Partial Firefox 53 Chrome 52 Opera 39 Safari 10

Syntax

default parameters Edge 14 Firefox 53 Chrome 49 Opera 36 Safari 10
↳ (unused) transform-es2015-parameters
rest parameters Edge 12 Firefox 43 Chrome 47 Opera 34 Safari 10
↳ (unused) transform-es2015-parameters
spread Edge 13 Firefox 36 Chrome 46 Opera 33 Safari 10
↳ (unused) transform-es2015-spread
computed properties Edge 12 Firefox 34 Chrome 44 Opera 31 Safari 7.1
↳ (unused) transform-es2015-computed-properties
shorthand properties Edge 12 Firefox 33 Chrome 43 Opera 30 Safari 9
↳ (unused) transform-es2015-shorthand-properties
for...of Edge 14 Firefox 53 Chrome 51 Opera 38 Safari 10
↳ (unused) transform-es2015-for-of
template string Edge 13 Firefox 34 Chrome 41 Opera 28 Safari 9
↳ (unused) transform-es2015-template-literals
Regexp sticky Edge 13 Firefox 31 Chrome 49 Opera 36 Safari 10
↳ (unused) transform-es2015-sticky-regex
Regexp unicode Edge 12 Firefox 46 Chrome 51 Opera 38 Safari 10
↳ (unused) transform-es2015-unicode-regex
destructuring Edge 15 Firefox 53 Chrome 52 Opera 39 Safari 10
↳ (unused) transform-es2015-destructuring
Unicode Strings Edge 12 Firefox 45 Chrome 44 Opera 31 Safari 9
Octal/Binary Numbers Edge 12 Firefox 36 Chrome 41 Opera 28 Safari 9
↳ (unused) transform-es2015-literals

Bindings

const Edge 14 Firefox 51 Chrome 49 Opera 36 Safari 10
let Edge 14 Firefox 51 Chrome 49 Opera 36 Safari 10
↳ (unused) transform-es2015-block-scoping
block-level function declaration Edge 11 Firefox 46 Chrome 41 Opera 28 Safari 10
↳ (unused) transform-es2015-block-scoped-functions

Functions

arrow functions Edge 13 Firefox 45 Chrome 49 Opera 36 Safari 10
↳ (used with edge, with function-name) transform-es2015-arrow-functions
classes Edge 13 Firefox 45 Chrome 49 Opera 36 Safari 10
↳ (unused) transform-es2015-classes
super Edge 13 Firefox 45 Chrome 49 Opera 36 Safari 10
↳ (unused) transform-es2015-object-super
generators Edge 13 Firefox 53 Chrome 51 Opera 38 Safari 10
↳ (unused) transform-regenerator

Built-ins

typeof Symbol Edge 12 Firefox 36 Chrome 38 Opera 25 Safari 9
↳ (unused) transform-es2015-typeof-symbol

Built-in extensions

function name Edge Partial Firefox 53 Chrome 52 Opera 39 Safari 10
↳ (used with edge) transform-es2015-function-name

Release Dates

Date Version ESR
2018-12-11 Firefox 64
2018-10-23 Firefox 63
2018-09-05 Firefox 62
2018-06-26 Firefox 61
2018-05-09 Firefox 60 ESR
2018-03-13 Firefox 59
2018-01-16 Firefox 58
Date Version
2018-10-16 Chrome 70
2018-09-04 Chrome 69
2018-07-24 Chrome 68
2018-05-29 Chrome 67
2018-04-17 Chrome 66
2018-03-06 Chrome 65
2018-01-23 Chrome 64
Date Version
2018-03-29 Safari 11.1
2017-09-19 Safari 11.0
2017-03-27 Safari 10.1
2016-09-20 Safari 10.0
Date Version
2018-04-30 Edge 17
2017-09-26 Edge 16
2017-03-20 Edge 15

Thanks

babel-preset-modern-browsers's People

Contributors

announcement avatar christophehurpeau avatar gerhobbelt avatar graingert avatar greenkeeperio-bot avatar plotnikovn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.