Coder Social home page Coder Social logo

babel-preset-modern-browsers's Introduction

babel-preset-modern-browsers NPM version

Edge 15 Firefox 53 Chrome 55 Opera 42 Safari 10.1

Babel presets for modern browsers

Dependency ci Status Dependency Status

This preset covers es2015, es2016 and es2017.

More info in the compatibility table below

Alternatives

Installation

npm install --save-dev babel-preset-modern-browsers

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"
  • es2016 - Enable es2016 features (Enabled by default)
  • es2017 - Enable es2017 features (Enabled by default)
  • edge - Support Edge (Disabled by default)
{
  presets: [
    ["modern-browsers", { "loose": true }]
  ]
}
{
  presets: [
    [require("babel-preset-modern-browsers").buildPreset, { "loose": true }]
  ]
}

Note: to support proposals, you can add babel preset stage-X or the stage you want:

{
  "presets": [
    "modern-browsers",
    "stage-1"
  ]
}

Edge

Missing features added for edge option:

  • function-name

Compatibility Table

Feature Edge Firefox Chrome Opera Safari

ES2017

trailing commas in function Edge 14 Firefox 52 Chrome 58 Opera 45 Safari 10
↳ (used) babel-plugin-syntax-trailing-function-commas
async function Edge 15 Firefox 52 Chrome 55 Opera 42 Safari 10.1
↳ (unused) babel-plugin-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, needed 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
2017-04-19 Firefox 53
2017-03-07 Firefox 52
2017-01-24 Firefox 51
2016-11-08 Firefox 50
2016-09-20 Firefox 49
2016-08-02 Firefox 48
2016-06-07 Firefox 47
Date Version
2017-04-19 Chrome 58
2017-03-09 Chrome 57
2017-01-25 Chrome 56
2016-12-06 Chrome 55
2016-10-12 Chrome 54
2016-08-31 Chrome 53
2016-07-20 Chrome 52
Date Version
2017-03-27 Safari 10.1
2016-09-20 Safari 10
Date Version
2017-03-20 Edge 15

Thanks

babel-preset-modern-browsers's People

Contributors

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

Watchers

 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.