fix(babel): Roll back to babel@5, see details

- move babelrc to static so that it can be used during the build process and also whenever the app is transpiling things on the fly.
- move babel back to version 5, which is compatible with `apm install`. (babel 6 seems to require the "dedupe" behavior of NPM3)
- update harmony-collections to use an unpublished commit that fixes the "WeakMap is not generic" issue
This commit is contained in:
Ben Gotow 2015-11-07 14:27:18 -08:00
parent 8dcbb7c1b4
commit eb8810e01b
7 changed files with 14 additions and 20 deletions

View file

@ -1,6 +1,7 @@
fs = require 'fs'
path = require 'path'
os = require 'os'
babelOptions = require '../static/babelrc'
# This is the main Gruntfile that manages building N1 distributions.
# The reason it's inisde of the build/ folder is so everything can be
@ -127,7 +128,7 @@ module.exports = (grunt) ->
ext: '.js'
babelConfig =
options: require './config/babel.json'
options: babelOptions
dist:
files: [{
expand: true

View file

@ -1,3 +0,0 @@
{
"presets": ["es2015", "react", "stage-0"]
}

View file

@ -18,7 +18,7 @@
"fs-plus": "2.x",
"github-releases": "~0.3.0",
"grunt": "~0.4.1",
"grunt-babel": "^6.0.0",
"grunt-babel": "^5.0.1",
"grunt-cli": "~0.1.9",
"grunt-coffee-react": "^2.1.0",
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git#cfb99aa99811d52687969532bd5a98011ed95bfe",
@ -35,7 +35,7 @@
"grunt-peg": "~1.1.0",
"grunt-shell": "~0.3.1",
"handlebars": "^3.0.2",
"harmony-collections": "~0.3.8",
"harmony-collections": "git+https://github.com/Benvie/harmony-collections.git#0adbd738fccecd88cdd45b68077a718bcf7f3e3b",
"highlight.js": "^8.8.0",
"json-front-matter": "^1.0.0",
"legal-eagle": "~0.9.0",

View file

@ -16,10 +16,7 @@
"asar": "^0.5.0",
"async": "^0.9",
"atom-keymap": "5.1.11",
"babel-core": "^6.0.20",
"babel-preset-es2015": "^6.0.15",
"babel-preset-react": "^6.0.15",
"babel-preset-stage-0": "^6.0.15",
"babel-core": "^5.8.21",
"bluebird": "^2.9",
"classnames": "1.2.1",
"clear-cut": "0.4.0",
@ -77,10 +74,6 @@
"vm-compatibility-layer": "0.1.0"
},
"devDependencies": {
"babel-eslint": "^4.1.3",
"eslint": "^1.5.1",
"eslint-config-airbnb": "^0.1.0",
"eslint-plugin-react": "^3.4.2",
"nock": "^2",
"grunt": "^0.4.5",
"grunt-serve": "^0.1.6",

View file

@ -47,7 +47,6 @@ class AccountStore
windowMenu = _.find atom.menu.template, ({label}) -> MenuHelpers.normalizeLabel(label) is 'Window'
return unless windowMenu
submenu = _.reject windowMenu.submenu, (item) -> item.account
console.log(submenu)
return unless submenu
idx = _.findIndex submenu, ({type}) -> type is 'separator'
return unless idx > 0

7
static/babelrc.json Normal file
View file

@ -0,0 +1,7 @@
{
"breakConfig": true,
"sourceMap": "inline",
"blacklist": ["es6.forOf", "useStrict"],
"optional": ["asyncToGenerator"],
"stage": 0
}

View file

@ -16,11 +16,8 @@ function registerRuntimeTranspilers(hotreload) {
require('coffee-react/register');
}
// This redefines require.extensions
require('babel-core/register')({
sourceMaps: true,
presets: ['es2015', 'react', 'stage-0'],
extensions: ['.es6', '.es', '.jsx'],
});
babelOptions = require('./babelrc.json');
require('babel-core/register')(babelOptions);
}
window.onload = function() {