RN babel preset: add import() syntax

Summary:
Allows us to parse the `import()` syntax. For now it's not transformed, so it would crash at runtime (or at minification with UglifyJS). However I want to release this under a new major version, so this wouldn't be allowed in OSS right away.

Also we bump to version 3.0.0 before release. D5443966 possibly introduced breaking changes, so it needs a major bump.

Reviewed By: cpojer

Differential Revision: D5630084

fbshipit-source-id: b271bbb8577ba7184e975f996ec415a915e869d9
This commit is contained in:
Jean Lauliac 2017-08-15 08:08:53 -07:00 committed by Facebook Github Bot
parent 7abce0b742
commit ab9c788c2c
3 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,7 @@ const getPreset = (src, options) => {
plugins.push(
'syntax-class-properties',
'syntax-dynamic-import',
'syntax-trailing-function-commas',
'transform-class-properties',
'transform-es2015-block-scoping',

View File

@ -1,6 +1,6 @@
{
"name": "babel-preset-react-native",
"version": "2.0.0",
"version": "3.0.0",
"description": "Babel preset for React Native applications",
"main": "index.js",
"repository": "https://github.com/facebook/react-native/tree/master/babel-preset",
@ -19,6 +19,7 @@
"babel-plugin-react-transform": "2.0.2",
"babel-plugin-syntax-async-functions": "^6.5.0",
"babel-plugin-syntax-class-properties": "^6.5.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-syntax-flow": "^6.5.0",
"babel-plugin-syntax-jsx": "^6.5.0",
"babel-plugin-syntax-trailing-function-commas": "^6.5.0",

View File

@ -12,6 +12,7 @@ module.exports = {
'babel-plugin-react-transform': require('babel-plugin-react-transform'),
'babel-plugin-syntax-async-functions': require('babel-plugin-syntax-async-functions'),
'babel-plugin-syntax-class-properties': require('babel-plugin-syntax-class-properties'),
'babel-plugin-syntax-dynamic-import': require('babel-plugin-syntax-dynamic-import'),
'babel-plugin-syntax-trailing-function-commas': require('babel-plugin-syntax-trailing-function-commas'),
'babel-plugin-transform-class-properties': require('babel-plugin-transform-class-properties'),
'babel-plugin-transform-es2015-function-name': require('babel-plugin-transform-es2015-function-name'),