Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Enable @babel/preset-env's ShippedProposals mode (#1580)
Browse files Browse the repository at this point in the history
Enabling this means that preset-env now injects additional plugins for
any features that aren't yet stage 3, but have been shipped in at least
one browser (meaning they are as good as finalised):
https://babeljs.io/docs/en/babel-preset-env#shippedproposals

Using this new mode also means we no longer need to manually include the
`@babel/plugin-proposal-class-properties` plugin, since it's included
in the shipped proposals list as of Babel 7.10.0:
babel/babel#11451
  • Loading branch information
edmorley authored Jun 8, 2020
1 parent d300a08 commit 230e815
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 14 deletions.
1 change: 1 addition & 0 deletions packages/library/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports = (opts = {}) => {
{
debug: neutrino.options.debug,
useBuiltIns: coreJsVersion ? 'usage' : false,
shippedProposals: true,
targets: options.targets,
...(coreJsVersion && { corejs: coreJsVersion.major }),
},
Expand Down
1 change: 1 addition & 0 deletions packages/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = (opts = {}) => {
{
debug: neutrino.options.debug,
targets: options.targets,
shippedProposals: true,
useBuiltIns: coreJsVersion ? 'usage' : false,
...(coreJsVersion && { corejs: coreJsVersion.major }),
},
Expand Down
6 changes: 0 additions & 6 deletions packages/preact/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ module.exports = (opts = {}) => (neutrino) => {
require.resolve('@babel/plugin-transform-react-jsx'),
{ pragma: 'h', pragmaFrag: 'Fragment' },
],
// Using loose for the reasons here:
// https://github.com/facebook/create-react-app/issues/4263
[
require.resolve('@babel/plugin-proposal-class-properties'),
{ loose: true },
],
],
},
opts.babel || {},
Expand Down
1 change: 0 additions & 1 deletion packages/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
"dependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-transform-react-jsx": "^7.10.1",
"@neutrinojs/web": "9.2.0",
"babel-merge": "^3.0.0",
Expand Down
6 changes: 0 additions & 6 deletions packages/react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ module.exports = (opts = {}) => (neutrino) => {
removeImport: true,
},
],
// Using loose for the reasons here:
// https://github.com/facebook/create-react-app/issues/4263
[
require.resolve('@babel/plugin-proposal-class-properties'),
{ loose: true },
],
].filter(Boolean),
presets: [
[
Expand Down
1 change: 0 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
"dependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/preset-react": "^7.10.1",
"@neutrinojs/web": "9.2.0",
"babel-merge": "^3.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ module.exports = (opts = {}) => (neutrino) => {
{
debug: neutrino.options.debug,
useBuiltIns: coreJsVersion ? 'usage' : false,
shippedProposals: true,
targets: options.targets,
...(coreJsVersion && { corejs: coreJsVersion.major }),
},
Expand Down

0 comments on commit 230e815

Please sign in to comment.