Skip to content

Commit

Permalink
Upgrade babel and use env presets for browsers (#2804)
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot committed Mar 18, 2024
1 parent dd86278 commit 6cddc68
Show file tree
Hide file tree
Showing 6 changed files with 1,139 additions and 1,402 deletions.
35 changes: 19 additions & 16 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
module.exports = {
presets: ["@babel/preset-react", "@babel/preset-typescript"],
plugins: [
"lodash",
["@babel/proposal-class-properties", { loose: true }],
"@babel/transform-arrow-functions",
"@babel/transform-block-scoping",
"@babel/transform-classes",
"@babel/transform-computed-properties",
"@babel/transform-destructuring",
"@babel/transform-parameters",
"@babel/transform-shorthand-properties",
"@babel/transform-spread",
"@babel/transform-template-literals",
"@babel/proposal-object-rest-spread",
"@babel/proposal-optional-chaining",
"@babel/plugin-proposal-export-namespace-from",
presets: [
[
"@babel/preset-env",
{
loose: true,
exclude: [
// only enabled in commonjs targets
// see the section on `env` below
"@babel/plugin-transform-modules-commonjs",

// do not use this plugin with webpack
// ref: https://babeljs.io/docs/babel-plugin-proposal-dynamic-import
"@babel/plugin-proposal-dynamic-import",
],
},
],
"@babel/preset-react",
"@babel/preset-typescript",
],
plugins: ["lodash"],
ignore: ["**/*.d.ts"],
env: {
commonjs: {
Expand Down
2 changes: 1 addition & 1 deletion .babelrc.native.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
presets: ["module:metro-react-native-babel-preset"],
plugins: [
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-transform-export-namespace-from",
"@babel/plugin-transform-flow-strip-types",
],
};
34 changes: 34 additions & 0 deletions .changeset/strange-beds-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
"victory": major
"victory-area": major
"victory-axis": major
"victory-bar": major
"victory-box-plot": major
"victory-brush-container": major
"victory-brush-line": major
"victory-candlestick": major
"victory-canvas": major
"victory-chart": major
"victory-core": major
"victory-create-container": major
"victory-cursor-container": major
"victory-errorbar": major
"victory-group": major
"victory-histogram": major
"victory-legend": major
"victory-line": major
"victory-native": major
"victory-pie": major
"victory-polar-axis": major
"victory-scatter": major
"victory-selection-container": major
"victory-shared-events": major
"victory-stack": major
"victory-tooltip": major
"victory-vendor": major
"victory-voronoi": major
"victory-voronoi-container": major
"victory-zoom-container": major
---

Upgrade babel dependencies and build target to modern browsers
47 changes: 21 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,17 @@
},
"homepage": "https://commerce.nearform.com/open-source/victory",
"devDependencies": {
"@babel/cli": "7.18.9",
"@babel/core": "7.18.9",
"@babel/eslint-parser": "^7.18.9",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-proposal-object-rest-spread": "7.18.9",
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
"@babel/plugin-transform-arrow-functions": "7.18.6",
"@babel/plugin-transform-block-scoping": "7.18.9",
"@babel/plugin-transform-classes": "7.18.9",
"@babel/plugin-transform-computed-properties": "7.18.9",
"@babel/plugin-transform-destructuring": "7.18.9",
"@babel/plugin-transform-modules-commonjs": "7.18.6",
"@babel/plugin-transform-parameters": "7.18.8",
"@babel/plugin-transform-shorthand-properties": "7.18.6",
"@babel/plugin-transform-spread": "7.18.9",
"@babel/plugin-transform-template-literals": "7.18.9",
"@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "^7.17.12",
"@babel/cli": "7.23.9",
"@babel/core": "7.23.9",
"@babel/eslint-parser": "7.23.9",
"@babel/plugin-transform-export-namespace-from": "7.23.4",
"@babel/plugin-transform-modules-commonjs": "7.23.3",
"@babel/preset-env": "7.23.9",
"@babel/preset-react": "7.23.3",
"@babel/preset-typescript": "7.23.3",
"@changesets/cli": "^2.24.1",
"@storybook/addon-storysource": "^7.6.10",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/addon-storysource": "^7.6.10",
"@storybook/react": "^7.6.7",
"@storybook/react-webpack5": "^7.6.7",
"@svitejs/changesets-changelog-github-compact": "^0.1.1",
Expand All @@ -64,11 +53,11 @@
"@types/testing-library__jest-dom": "^5.14.5",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"babel-jest": "^29.7.0",
"babel-loader": "^8.2.5",
"babel-plugin-lodash": "^3.1.2",
"babel-plugin-module-resolver": "^4.1.0",
"babel-preset-react-native": "^4.0.1",
"babel-jest": "29.7.0",
"babel-loader": "9.1.3",
"babel-plugin-lodash": "3.3.4",
"babel-plugin-module-resolver": "5.0.0",
"babel-preset-react-native": "4.0.1",
"chromatic": "^6.7.1",
"concurrently": "^7.3.0",
"cpx2": "^4.2.0",
Expand All @@ -93,7 +82,7 @@
"lodash": "^4.17.19",
"lodash-webpack-plugin": "^0.11.6",
"mdast-util-to-string": "^1.0.6",
"metro-react-native-babel-preset": "0.71.3",
"metro-react-native-babel-preset": "0.77.0",
"nps": "^5.9.0",
"octokit": "^3.1.1",
"prettier": "^2.6.2",
Expand Down Expand Up @@ -125,6 +114,12 @@
"@types/eslint": "8.4.3"
}
},
"browserslist": [
"> 0.5%",
"last 2 versions",
"Firefox ESR",
"not dead"
],
"scripts": {
"version": "pnpm changeset version && pnpm install --no-frozen-lockfile",
"publish": "nps git:tag && pnpm changeset publish --no-git-tag",
Expand Down

0 comments on commit 6cddc68

Please sign in to comment.