Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit ab6b8ef

Browse files
Upgrade babel and core-js
This change also isolates the nested dependencies of the react-scripts package used in the builder, which were previously causing dependency conflicts, and fixes a flaky test
1 parent 3f391c4 commit ab6b8ef

File tree

6 files changed

+231
-468
lines changed

6 files changed

+231
-468
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
"lab.js/sinon",
3838
"lab.js/sinon/**",
3939
"lab.js.builder/bootstrap",
40+
"lab.js.builder/react-scripts",
41+
"lab.js.builder/react-scripts/**",
4042
"lab.js.website/bootstrap"
4143
]
4244
}

packages/library/package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
"main": "dist/lab.js",
1313
"module": "src/index.js",
1414
"dependencies": {
15-
"@babel/runtime": "^7.1.2",
16-
"babel-polyfill": "^6.23.0",
15+
"@babel/runtime": "^7.7.0",
1716
"common-tags": "^1.8.0",
18-
"core-js": "^2.5.6",
17+
"core-js": "^3.6.1",
1918
"cross-env": "^5.2.0",
2019
"es2015-proxy": "^0.1.7",
2120
"es6-promise": "^4.1.0",
@@ -30,15 +29,15 @@
3029
"whatwg-fetch": "^2.0.4"
3130
},
3231
"devDependencies": {
33-
"@babel/core": "^7.1.0",
34-
"@babel/plugin-proposal-class-properties": "^7.1.0",
32+
"@babel/core": "^7.7.0",
33+
"@babel/plugin-proposal-class-properties": "^7.7.0",
3534
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4",
36-
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
37-
"@babel/plugin-transform-regenerator": "^7.0.0",
38-
"@babel/plugin-transform-runtime": "^7.1.0",
39-
"@babel/preset-env": "^7.1.0",
35+
"@babel/plugin-proposal-object-rest-spread": "^7.7.0",
36+
"@babel/plugin-transform-regenerator": "^7.7.0",
37+
"@babel/plugin-transform-runtime": "^7.7.0",
38+
"@babel/preset-env": "^7.7.0",
4039
"babel-eslint": "^9.0.0",
41-
"babel-loader": "^8.0.0",
40+
"babel-loader": "8.0.4",
4241
"babel-plugin-istanbul": "^5.1.0",
4342
"babel-plugin-lodash": "^3.2.6",
4443
"babel-preset-minify": "^0.5.0",

packages/library/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Polyfill
2-
import 'babel-polyfill'
1+
// Load standard library polyfill
2+
import 'core-js/stable'
33

44
// Components
55
import { Component, Dummy } from './core'

packages/library/test/flow.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,12 @@ describe('Flow control', () => {
303303
const a = new lab.core.Dummy()
304304
s.options.content = [a]
305305

306-
let error
307-
308306
return s.run().then(() => {
309-
s.step().catch(err => (error = err))
310-
}).then(() => {
307+
// Step beyond last sequence content, resolve error
308+
// TODO: Extracting the error message here is not nice --
309+
// it would be nicer to use chai-as-promised and assert.isRejected
310+
return new Promise(resolve => s.step().catch(resolve))
311+
}).then(error => {
311312
assert.equal(
312313
error.message,
313314
'Sequence ended, can\'t take any more steps'

packages/library/webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module.exports = (env, argv) => {
4242
// Module generation is handled by webpack
4343
modules: false,
4444
useBuiltIns: 'usage',
45+
corejs: 3,
4546
}],
4647
],
4748
plugins: [
@@ -74,6 +75,7 @@ module.exports = (env, argv) => {
7475
// Module generation is handled by webpack
7576
modules: false,
7677
useBuiltIns: 'usage',
78+
corejs: 3,
7779
}],
7880
],
7981
plugins: [

0 commit comments

Comments
 (0)