Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade React to v18 #2280

Merged
merged 15 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var path = require("path");
module.exports = {
addons: [
"storybook-addon-performance/register",
"@storybook/addon-options/register",
{
name: "@storybook/addon-storysource",
Expand Down
3 changes: 1 addition & 2 deletions config/webpack/webpack.config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ module.exports = {
]
},
devServer: {
port: WDS_PORT,
noInfo: false
port: WDS_PORT
},
// https://stackoverflow.com/questions/64475910/replacing-polyfill-for-process-in-webpack-v5-from-v4
plugins: [
Expand Down
25 changes: 11 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@
"@babel/plugin-transform-template-literals": "7.16.7",
"@babel/preset-react": "7.16.7",
"@babel/preset-typescript": "^7.17.12",
"@storybook/addon-actions": "^6.5.5",
"@storybook/addon-actions": "^6.5.6",
"@storybook/addon-options": "^5.3.21",
"@storybook/addon-storysource": "^6.5.5",
"@storybook/react": "^6.5.5",
"@storybook/addon-storysource": "^6.5.6",
"@storybook/react": "^6.5.6",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.2",
"@testing-library/react": "^13.3.0",
"@testing-library/react-native": "^9.1.0",
"@types/jest": "^27.5.1",
"@types/jest": "^28.1.0",
"@types/lodash": "^4.14.149",
"@types/react": "^16.14.26",
"@types/react-dom": "^16.9.5",
"@types/react": "^18.0.10",
"@types/react-dom": "^18.0.5",
"@typescript-eslint/eslint-plugin": "^5.26.0",
"@typescript-eslint/parser": "^5.26.0",
"babel-eslint": "^10.0.3",
Expand Down Expand Up @@ -107,13 +107,13 @@
"nps-utils": "^1.5.0",
"prettier": "^2.6.2",
"prop-types": "^15.8.1",
"react": "^16.14.0",
"react-dom": "^16.13.1",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-hot-loader": "v2.0.0-alpha-4",
"react-test-renderer": "^16.13.1",
"react-test-renderer": "^18.1.0",
"rimraf": "^3.0.2",
"seedrandom": "^2.4.3",
"storybook-addon-performance": "^0.10.0",
"styled-components": "^5.3.5",
scottrippey marked this conversation as resolved.
Show resolved Hide resolved
"ts-jest": "^28.0.3",
"ts-loader": "^9.3.0",
"typescript": "^4.7.2",
Expand All @@ -122,8 +122,5 @@
"webpack-dev-server": "^4.9.0",
"webpack-stats-plugin": "^1.0.3"
},
"resolutions": {
"@types/react": "^16.14.26"
},
"sideEffects": false
}
2 changes: 1 addition & 1 deletion packages/victory-area/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"victory-vendor": "^36.4.0"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-axis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"victory-vendor": "^36.4.0"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-box-plot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"victory-vendor": "^36.4.0"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-brush-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-brush-line/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-candlestick/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
31 changes: 28 additions & 3 deletions packages/victory-canvas/src/canvas-bar.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/*global Path2D:false */
import { assign, omit } from "lodash";
import { assign } from "lodash";
import PropTypes from "prop-types";
import React from "react";
import {
Bar,
getBarPath,
getBarWidth,
getCornerRadius,
getPolarBarPath,
getStyle
} from "victory-bar";
import { useCanvasContext } from "./hooks/use-canvas-context";
import { CommonProps } from "victory-core";

const evaluateProps = (props) => {
/**
Expand Down Expand Up @@ -108,6 +109,30 @@ const CanvasBar = (initialProps) => {
return null;
};

CanvasBar.propTypes = omit(Bar.propTypes, "pathComponent");
CanvasBar.propTypes = {
...CommonProps.primitiveProps,
alignment: PropTypes.oneOf(["start", "middle", "end"]),
barRatio: PropTypes.number,
barWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
cornerRadius: PropTypes.oneOfType([
PropTypes.number,
PropTypes.func,
PropTypes.shape({
top: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
topLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
topRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
bottom: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
bottomLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
bottomRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func])
})
]),
datum: PropTypes.object,
getPath: PropTypes.func,
horizontal: PropTypes.bool,
width: PropTypes.number,
x: PropTypes.number,
y: PropTypes.number,
y0: PropTypes.number
};

export default CanvasBar;
2 changes: 1 addition & 1 deletion packages/victory-chart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"victory-shared-events": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"victory-vendor": "^36.4.0"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export default class VictoryAnimation extends React.Component<
};

static contextType = TimerContext;
context!: React.ContextType<typeof TimerContext>;
private interpolator: null | ((value: number) => AnimationStyle);
private queue: AnimationStyle[];
private ease: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default class VictoryTransition extends React.Component<
};

static contextType = TimerContext;
context!: React.ContextType<typeof TimerContext>;
private continuous: boolean;
private timer: Timer;
private transitionProps: any;
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-create-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"victory-zoom-container": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-cursor-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-errorbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-group/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"victory-shared-events": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-histogram/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"victory-vendor": "^36.4.0"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-legend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-line/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"victory-vendor": "^36.4.0"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react/no-multi-comp */
import React from "react";
import { flow } from "lodash";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-pie/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"victory-vendor": "^36.4.0"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-polar-axis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-scatter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-selection-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-shared-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"victory-shared-events": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-tooltip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-voronoi-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"victory-tooltip": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react/no-multi-comp */
import PropTypes from "prop-types";
import React from "react";
import { defaults, isFunction, pick } from "lodash";
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-voronoi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-zoom-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"victory-core": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
2 changes: 1 addition & 1 deletion packages/victory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"victory-zoom-container": "^36.4.1"
},
"peerDependencies": {
"react": "^16.6.0 || ^17.0.0"
"react": ">=16.6.0"
},
"scripts": {
"version": "yarn run nps build-libs && nps build-dists"
Expand Down
Loading