Skip to content

Commit

Permalink
fix: remove deprecated proposal plugin in favor of standardized plugin (
Browse files Browse the repository at this point in the history
  • Loading branch information
10xLaCroixDrinker authored Jan 16, 2024
1 parent a0c3998 commit d1b476b
Show file tree
Hide file tree
Showing 5 changed files with 1,420 additions and 1,253 deletions.
18 changes: 9 additions & 9 deletions __tests__/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Object {
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-optional-chaining",
"babel-plugin-transform-react-remove-prop-types",
],
"presets": Array [
Expand Down Expand Up @@ -44,7 +44,7 @@ Object {
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-optional-chaining",
"babel-plugin-transform-react-remove-prop-types",
],
"presets": Array [
Expand Down Expand Up @@ -80,7 +80,7 @@ Object {
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-optional-chaining",
"babel-plugin-transform-react-remove-prop-types",
],
"presets": Array [
Expand Down Expand Up @@ -119,7 +119,7 @@ Object {
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-optional-chaining",
"babel-plugin-transform-react-remove-prop-types",
],
"presets": Array [
Expand Down Expand Up @@ -154,7 +154,7 @@ Object {
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-optional-chaining",
"babel-plugin-transform-react-remove-prop-types",
],
"presets": Array [
Expand Down Expand Up @@ -190,7 +190,7 @@ Object {
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-optional-chaining",
"babel-plugin-transform-react-remove-prop-types",
],
"presets": Array [
Expand Down Expand Up @@ -228,7 +228,7 @@ Object {
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-optional-chaining",
"babel-plugin-transform-react-remove-prop-types",
],
"presets": Array [
Expand Down Expand Up @@ -266,7 +266,7 @@ Object {
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-optional-chaining",
"babel-plugin-transform-react-remove-prop-types",
],
"presets": Array [
Expand Down Expand Up @@ -296,7 +296,7 @@ Object {
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-optional-chaining",
"babel-plugin-transform-react-remove-prop-types",
],
"presets": Array [
Expand Down
2 changes: 1 addition & 1 deletion __tests__/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jest.mock('@babel/preset-react', () => ({ default: '@babel/preset-react' }));
jest.mock('@babel/plugin-syntax-dynamic-import', () => ({ default: '@babel/plugin-syntax-dynamic-import' }));
jest.mock('@babel/plugin-proposal-class-properties', () => ({ default: '@babel/plugin-proposal-class-properties' }));
jest.mock('@babel/plugin-proposal-export-default-from', () => ({ default: '@babel/plugin-proposal-export-default-from' }));
jest.mock('@babel/plugin-proposal-optional-chaining', () => ({ default: '@babel/plugin-proposal-optional-chaining' }));
jest.mock('@babel/plugin-transform-optional-chaining', () => ({ default: '@babel/plugin-transform-optional-chaining' }));
jest.mock('babel-plugin-transform-react-remove-prop-types', () => ({ default: 'babel-plugin-transform-react-remove-prop-types' }));

const { NODE_ENV } = process.env;
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const reactPreset = require('@babel/preset-react');
const syntaxDynamicImport = require('@babel/plugin-syntax-dynamic-import').default;
const proposalClassProperties = require('@babel/plugin-proposal-class-properties').default;
const exportDefaultFrom = require('@babel/plugin-proposal-export-default-from').default;
const proposalOptionalChaining = require('@babel/plugin-proposal-optional-chaining').default;
const transformOptionalChaining = require('@babel/plugin-transform-optional-chaining').default;
const removePropTypes = require('babel-plugin-transform-react-remove-prop-types').default;

const { browserList, legacyBrowserList } = require('./browserlist');
Expand All @@ -30,7 +30,7 @@ module.exports = (api = {}, opts = {}) => {
syntaxDynamicImport,
proposalClassProperties,
exportDefaultFrom,
proposalOptionalChaining,
transformOptionalChaining,
];
if (isProduction) {
plugins.push(removePropTypes);
Expand Down
Loading

0 comments on commit d1b476b

Please sign in to comment.