Skip to content

Commit 471eba3

Browse files
authored
Upgrade support for react 17 (#1040)
1 parent 3385b6d commit 471eba3

File tree

188 files changed

+485
-568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+485
-568
lines changed

.circleci/comment.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ async function run() {
1919
body: `Build successful! 🎉
2020
2121
* [View the storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html)
22+
* [View the storybook-17](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-17/index.html)
2223
* [View the documentation](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/docs/index.html)`
2324
});
2425
}

.circleci/config.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ jobs:
5151
name: test
5252
command: yarn ci-test
5353

54+
test_17:
55+
docker:
56+
- image: circleci/node:12.10
57+
58+
working_directory: ~/react-spectrum
59+
steps:
60+
- restore_cache:
61+
key: react-spectrum-{{ .Environment.CIRCLE_SHA1 }}
62+
63+
- run:
64+
name: test
65+
command: yarn ci-test-17
66+
5467
lint:
5568
docker:
5669
- image: circleci/node:12.10
@@ -82,6 +95,26 @@ jobs:
8295
root: dist
8396
paths:
8497
- '*/storybook/'
98+
99+
storybook-17:
100+
docker:
101+
- image: circleci/node:12.10
102+
resource_class: large
103+
104+
working_directory: ~/react-spectrum
105+
steps:
106+
- restore_cache:
107+
key: react-spectrum-{{ .Environment.CIRCLE_SHA1 }}
108+
109+
- run:
110+
name: build storybook-17
111+
command: make storybook-17
112+
113+
- persist_to_workspace:
114+
root: dist
115+
paths:
116+
- '*/storybook-17/'
117+
85118
docs:
86119
docker:
87120
- image: circleci/node:12.10
@@ -182,12 +215,18 @@ workflows:
182215
- test:
183216
requires:
184217
- install
218+
- test_17:
219+
requires:
220+
- install
185221
- lint:
186222
requires:
187223
- install
188224
- storybook:
189225
requires:
190226
- install
227+
- storybook-17:
228+
requires:
229+
- install
191230
- docs:
192231
requires:
193232
- install
@@ -201,7 +240,9 @@ workflows:
201240
requires:
202241
- lint
203242
- test
243+
- test_17
204244
- storybook
245+
- storybook-17
205246
- docs
206247
- deploy-production:
207248
filters:

.storybook/layout.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export function VerticalCenter({children, className, style}) {
77
className={ clsx('react-spectrum-story', className) }
88
style={style}
99
>
10+
<span style={{position: 'absolute', top: 0, left: 0}}>{REACT_VERSION}</span>
1011
{ children }
1112
</div>
1213
);

.storybook/webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const path = require('path');
22
const webpack = require('webpack');
33
const md5 = require('md5');
44
const fs = require('fs');
5+
const reactVersion = require('react/package.json').version;
56

67
const fileHashMemo = {};
78

@@ -27,6 +28,7 @@ module.exports = ({config}, env) => {
2728
// see https://github.com/storybooks/storybook/issues/1570
2829
config.plugins = config.plugins.filter(plugin => plugin.constructor.name !== 'UglifyJsPlugin')
2930
}
31+
config.plugins.push(new webpack.DefinePlugin({REACT_VERSION: JSON.stringify(reactVersion)}));
3032

3133
config.resolve.extensions.push('.ts', '.tsx');
3234

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ icons: packages/@spectrum-icons/workflow/src packages/@spectrum-icons/color/src
6969
storybook:
7070
NODE_ENV=production yarn build:storybook
7171

72+
storybook-17:
73+
yarn build:storybook-17
74+
7275
# for now doesn't have deploy since v3 doesn't have a place for docs and stuff yet
7376
ci:
7477
$(MAKE) publish

jest.ssr.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ module.exports = {
3333
'packages/'
3434
],
3535

36+
testTimeout: 30000,
37+
3638
globalSetup: require.resolve('@react-spectrum/test-utils/src/ssrSetup'),
3739
globalTeardown: require.resolve('@react-spectrum/test-utils/src/ssrTeardown'),
3840

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
"check-types": "tsc",
1818
"start": "cross-env NODE_ENV=storybook start-storybook -p 9003 --ci -c '.storybook'",
1919
"build:storybook": "build-storybook -c .storybook -o dist/$(git rev-parse HEAD)/storybook",
20+
"build:storybook-17": "yarn add -W [email protected] [email protected] && NODE_ENV=production build-storybook -c .storybook -o dist/$(git rev-parse HEAD)/storybook-17",
2021
"start:chromatic": "NODE_ENV=storybook start-storybook -p 9004 --ci -c '.chromatic'",
2122
"build:chromatic": "build-storybook -c .chromatic -o dist/$(git rev-parse HEAD)/chromatic",
2223
"start:docs": "PARCEL_WORKER_BACKEND=process DOCS_ENV=dev parcel 'packages/@react-{spectrum,aria,stately}/*/docs/*.mdx' 'packages/dev/docs/pages/**/*.mdx'",
2324
"build:docs": "PARCEL_WORKER_BACKEND=process DOCS_ENV=staging parcel build 'packages/@react-{spectrum,aria,stately}/*/docs/*.mdx' 'packages/dev/docs/pages/**/*.mdx' --no-scope-hoist",
2425
"test": "yarn jest",
2526
"test:ssr": "yarn jest --config jest.ssr.config.js",
2627
"ci-test": "yarn jest --maxWorkers=2 && yarn test:ssr --runInBand",
28+
"ci-test-17": "yarn add -W [email protected] [email protected] && yarn jest --maxWorkers=2 && yarn test:ssr --runInBand",
2729
"lint": "yarn check-types && eslint packages --ext .js,.ts,.tsx && node scripts/lint-packages.js",
2830
"jest": "node scripts/jest.js",
2931
"copyrights": "babel-node --presets @babel/env ./scripts/addHeaders.js",
@@ -114,7 +116,7 @@
114116
"ignore-styles": "^5.0.1",
115117
"jest": "^26.4.2",
116118
"jest-matchmedia-mock": "^1.0.0",
117-
"jsdom": "^16.2.2",
119+
"jsdom": "^16.3.0",
118120
"lerna": "^3.13.2",
119121
"lfcdn": "^0.4.2",
120122
"md5": "^2.2.1",
@@ -137,9 +139,9 @@
137139
"postcss-svg": "^3.0.0",
138140
"prop-types": "^15.6.0",
139141
"raf": "^3.4.0",
140-
"react": "^0.14 || ^15 || ^16",
142+
"react": "^16.8.0 || ^17.0.0-rc.1",
141143
"react-axe": "^3.0.2",
142-
"react-dom": "^0.14 || ^15 || ^16",
144+
"react-dom": "^16.8.0 || ^17.0.0-rc.1",
143145
"react-overlays": "0.8.3",
144146
"react-test-renderer": "^16.9.0",
145147
"recursive-readdir": "^2.2.2",
@@ -161,6 +163,8 @@
161163
"resolutions": {
162164
"@babel/core": "7.9.0",
163165
"@babel/runtime": "7.9.0",
164-
"postcss-calc": "6.0.2"
166+
"postcss-calc": "6.0.2",
167+
"jest-environment-jsdom": "26.3.0",
168+
"jsdom": "16.3.0"
165169
}
166170
}

packages/@react-aria/actiongroup/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@react-types/shared": "^3.1.0"
2929
},
3030
"peerDependencies": {
31-
"react": "^16.8.0"
31+
"react": "^16.8.0 || ^17.0.0-rc.1"
3232
},
3333
"publishConfig": {
3434
"access": "public"

packages/@react-aria/aria-modal-polyfill/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"aria-hidden": "^1.1.1"
2323
},
2424
"peerDependencies": {
25-
"react": "^16.8.0"
25+
"react": "^16.8.0 || ^17.0.0-rc.1"
2626
},
2727
"publishConfig": {
2828
"access": "public"

packages/@react-aria/breadcrumbs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@react-types/shared": "^3.1.0"
2727
},
2828
"peerDependencies": {
29-
"react": "^16.8.0"
29+
"react": "^16.8.0 || ^17.0.0-rc.1"
3030
},
3131
"publishConfig": {
3232
"access": "public"

0 commit comments

Comments
 (0)