Skip to content

Commit

Permalink
feat(packages): use react 17 (patternfly#5111)
Browse files Browse the repository at this point in the history
* feat(packages): use react 17

* bump theme

* use unoffical react 17 enzyme adapter

* fix dropdown keyboard bug

* snapshot updates
  • Loading branch information
redallen authored Jan 6, 2021
1 parent 3816a2c commit 7fbafcc
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 286 deletions.
2 changes: 1 addition & 1 deletion jest.env.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'raf/polyfill';
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import MutationObserver from 'mutation-observer';

configure({ adapter: new Adapter() });
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"@types/jest": "^24.0.11",
"@typescript-eslint/eslint-plugin": "^4.4.1",
"@typescript-eslint/parser": "^4.4.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.3.1",
"babel-jest": "^25.1.0",
"codecov": "^3.7.2",
"concurrently": "^5.3.0",
"enzyme": "3.10.0",
"enzyme-adapter-react-16": "1.15.5",
"enzyme-to-json": "3.4.0",
"eslint": "^7.11.0",
"eslint-plugin-markdown": "^1.0.2",
Expand All @@ -58,8 +58,8 @@
"mutation-observer": "^1.0.3",
"plop": "^2.0.0",
"prettier": "^1.18.2",
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"surge": "^0.21.3",
"ttypescript": "^1.5.12"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/react-catalog-view-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"typescript": "^3.8.3"
},
"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/react-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
"victory-zoom-container": "^35.4.4"
},
"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"scripts": {
"clean": "rimraf dist"
Expand Down
6 changes: 3 additions & 3 deletions packages/react-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"typescript": "^3.8.3"
},
"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
}
}
}
4 changes: 2 additions & 2 deletions packages/react-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"yo": "^3.1.1"
},
"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/react-core/src/components/Dropdown/Toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ export class Toggle extends React.Component<ToggleProps> {
componentDidMount = () => {
document.addEventListener('mousedown', this.onDocClick);
document.addEventListener('touchstart', this.onDocClick);
document.addEventListener('keydown', this.onEscPress);
document.addEventListener('keydown', this.onEscPress, { capture: true });
};

componentWillUnmount = () => {
document.removeEventListener('mousedown', this.onDocClick);
document.removeEventListener('touchstart', this.onDocClick);
document.removeEventListener('keydown', this.onEscPress);
document.removeEventListener('keydown', this.onEscPress, { capture: true });
};

onDocClick = (event: MouseEvent | TouchEvent) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"@patternfly/patternfly-a11y": "2.0.11",
"@types/react": "^16.8.0",
"@types/react-dom": "^16.8.0",
"react": "^16.8.0",
"react-dom": "^16.8.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"rimraf": "^2.6.3",
"serve": "^11.3.2",
"shx": "^0.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"typescript": "^3.8.3"
},
"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/react-inline-edit-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"reactabular-table": "^8.14.0"
},
"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"devDependencies": {
"rimraf": "^2.6.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-integration/demo-app-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"dependencies": {
"@patternfly/react-core": "^4.86.1",
"react": "^16.8.0",
"react-dom": "^16.8.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/react-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
"url": "https://github.com/patternfly/patternfly-react/issues"
},
"homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/react-table#readme",
"devDependencies": {
"rimraf": "^2.6.2",
"typescript": "^3.8.3"
},
"scripts": {
"build:umd": "rollup -c && rollup -c --environment IS_PRODUCTION",
"clean": "rimraf dist"
Expand All @@ -43,8 +39,12 @@
"lodash": "^4.17.19",
"tslib": "1.13.0"
},
"devDependencies": {
"rimraf": "^2.6.2",
"typescript": "^3.8.3"
},
"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
}
}
Loading

0 comments on commit 7fbafcc

Please sign in to comment.