Permalink
Browse files

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
  • Loading branch information...
jeanlauliac authored and facebook-github-bot committed Aug 15, 2017
1 parent 7abce0b commit ab9c788c2c8556bb7f76a7db77f354d7227bb102
Showing with 4 additions and 1 deletion.
  1. +1 −0 babel-preset/configs/main.js
  2. +2 −1 babel-preset/package.json
  3. +1 −0 babel-preset/plugins.js
@@ -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',
@@ -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
@@ -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'),

0 comments on commit ab9c788

Please sign in to comment.