Skip to content

Commit 32a4360

Browse files
authored
React 19 support (#6437)
* React 19 support
1 parent 81ecc5e commit 32a4360

File tree

449 files changed

+1049
-835
lines changed

Some content is hidden

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

449 files changed

+1049
-835
lines changed

.circleci/comment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async function run() {
7676
body: `Build successful! 🎉
7777
7878
* [View the storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html)
79-
* [View the storybook-canary](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-canary/index.html)
79+
* [View the storybook-19](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-19/index.html)
8080
* [View the storybook-17](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-17/index.html)
8181
* [View the storybook-16](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-16/index.html)
8282
* [View the documentation](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/docs/index.html)`

.circleci/config.yml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@ orbs:
1919
executors:
2020
rsp:
2121
docker:
22-
- image: cimg/node:18.17.1
22+
- image: cimg/node:18.20.3
2323
environment:
2424
CACHE_VERSION: v1
2525
working_directory: ~/react-spectrum
2626

2727
rsp-large:
2828
docker:
29-
- image: cimg/node:18.17.1
29+
- image: cimg/node:18.20.3
3030
resource_class: large
3131
environment:
3232
CACHE_VERSION: v1
3333
working_directory: ~/react-spectrum
3434

3535
rsp-xlarge:
3636
docker:
37-
- image: cimg/node:18.17.1
37+
- image: cimg/node:18.20.3
3838
resource_class: xlarge
3939
environment:
4040
CACHE_VERSION: v1
4141
working_directory: ~/react-spectrum
4242

4343
rsp-xlarge-nodeupdate:
4444
docker:
45-
- image: cimg/node:18.17.1
45+
- image: cimg/node:18.20.3
4646
resource_class: xlarge
4747
environment:
4848
CACHE_VERSION: v1
@@ -121,7 +121,7 @@ jobs:
121121
- ~/react-spectrum
122122
key: react-spectrum17-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
123123

124-
install-canary:
124+
install-19:
125125
executor: rsp-large
126126
steps:
127127
- checkout
@@ -134,12 +134,12 @@ jobs:
134134
- run:
135135
name: build
136136
command: |
137-
yarn install --pure-lockfile --cache-folder ~/.cache/yarn && yarn install-canary --cache-folder ~/.cache/yarn
137+
yarn install --pure-lockfile --cache-folder ~/.cache/yarn && yarn install-19 --cache-folder ~/.cache/yarn
138138
139139
- save_cache:
140140
paths:
141141
- ~/react-spectrum
142-
key: react-spectrum-canary-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
142+
key: react-spectrum-19-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
143143

144144
test-ssr:
145145
executor: rsp-xlarge
@@ -199,11 +199,11 @@ jobs:
199199
command: |
200200
yarn test:ssr
201201
202-
test-ssr-canary:
202+
test-ssr-19:
203203
executor: rsp-xlarge
204204
steps:
205205
- restore_cache:
206-
key: react-spectrum-canary-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
206+
key: react-spectrum-19-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
207207

208208
- run:
209209
name: test ssr
@@ -258,12 +258,12 @@ jobs:
258258
- store_artifacts:
259259
path: ~/junit
260260

261-
test-canary:
261+
test-19:
262262
parallelism: 3
263263
executor: rsp-xlarge
264264
steps:
265265
- restore_cache:
266-
key: react-spectrum-canary-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
266+
key: react-spectrum-19-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
267267

268268
- run: mkdir ~/junit
269269

@@ -272,10 +272,10 @@ jobs:
272272
command: |
273273
shopt -s globstar
274274
TESTFILES=$(circleci tests glob "packages/**/*.test.[tj]{s,sx}" | circleci tests split --split-by=timings)
275-
JEST_JUNIT_OUTPUT_NAME="junit-canary.xml" yarn test ${TESTFILES}
275+
JEST_JUNIT_OUTPUT_NAME="junit-19.xml" yarn test ${TESTFILES}
276276
277277
- run:
278-
command: cp junit-canary.xml ~/junit/
278+
command: cp junit-19.xml ~/junit/
279279
when: always
280280
- store_test_results:
281281
path: ~/junit
@@ -412,20 +412,20 @@ jobs:
412412
paths:
413413
- '*/storybook-17/'
414414

415-
storybook-canary:
415+
storybook-19:
416416
executor: rsp-large
417417
steps:
418418
- restore_cache:
419-
key: react-spectrum-canary-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
419+
key: react-spectrum-19-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
420420

421421
- run:
422-
name: build storybook-canary
423-
command: make storybook-canary
422+
name: build storybook-19
423+
command: make storybook-19
424424

425425
- persist_to_workspace:
426426
root: dist
427427
paths:
428-
- '*/storybook-canary/'
428+
- '*/storybook-19/'
429429

430430
docs:
431431
executor: rsp-xlarge
@@ -547,7 +547,7 @@ workflows:
547547
- install
548548
- install-16
549549
- install-17
550-
- install-canary
550+
- install-19
551551
- test-ssr:
552552
requires:
553553
- install
@@ -566,6 +566,12 @@ workflows:
566566
- test-17:
567567
requires:
568568
- install-17
569+
- test-19:
570+
requires:
571+
- install-19
572+
- test-ssr-19:
573+
requires:
574+
- install-19
569575
- test-esm:
570576
requires:
571577
- install
@@ -603,9 +609,9 @@ workflows:
603609
- storybook-17:
604610
requires:
605611
- install-17
606-
- storybook-canary:
612+
- storybook-19:
607613
requires:
608-
- install-canary
614+
- install-19
609615
- docs:
610616
requires:
611617
- install
@@ -628,7 +634,7 @@ workflows:
628634
- storybook
629635
- storybook-16
630636
- storybook-17
631-
- storybook-canary
637+
- storybook-19
632638
- docs
633639
- deploy-verdaccio:
634640
requires:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ storybook-16:
8181
storybook-17:
8282
yarn build:storybook-17
8383

84-
storybook-canary:
85-
yarn build:storybook-canary
84+
storybook-19:
85+
yarn build:storybook-19
8686

8787
# for now doesn't have deploy since v3 doesn't have a place for docs and stuff yet
8888
ci:

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"check-types": "tsc && tsc-strict",
1313
"install-16": "yarn add -W react@^16.8.0 react-dom@^16.8.0 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 && node scripts/oldReactSupport.mjs",
1414
"install-17": "yarn add -W react@^17 react-dom@^17 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 && node scripts/oldReactSupport.mjs",
15-
"install-canary": "yarn add -W react@canary react-dom@canary",
15+
"install-19": "node ./scripts/install-react-19.mjs && yarn add -W react@next react-dom@next",
1616
"start": "cross-env NODE_ENV=storybook storybook dev -p 9003 --ci -c '.storybook'",
1717
"build:storybook": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook",
1818
"build:storybook-16": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook-16",
1919
"build:storybook-17": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook-17",
20-
"build:storybook-canary": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook-canary",
20+
"build:storybook-19": "storybook build -c .storybook -o dist/$(git rev-parse HEAD)/storybook-19",
2121
"start:chromatic": "CHROMATIC=1 NODE_ENV=storybook storybook dev -p 9004 --ci -c '.chromatic'",
2222
"build:chromatic": "CHROMATIC=1 storybook build -c .chromatic -o dist/$(git rev-parse HEAD)/chromatic",
2323
"start:chromatic-fc": "CHROMATIC=1 NODE_ENV=storybook storybook dev -p 9005 --ci -c '.chromatic-fc'",
@@ -105,8 +105,8 @@
105105
"@testing-library/jest-dom": "^5.16.5",
106106
"@testing-library/react": "^15.0.0",
107107
"@testing-library/user-event": "^14.5.2",
108-
"@types/react": "^18.3.0",
109-
"@types/react-dom": "^18.3.0",
108+
"@types/react": "npm:[email protected].0",
109+
"@types/react-dom": "npm:[email protected].0",
110110
"@types/storybook__react": "^4.0.2",
111111
"@typescript-eslint/eslint-plugin": "^6.7.5",
112112
"@typescript-eslint/parser": "^6.7.5",
@@ -140,7 +140,7 @@
140140
"eslint-plugin-rulesdir": "^0.2.2",
141141
"fast-check": "^2.19.0",
142142
"fast-glob": "^3.1.0",
143-
"framer-motion": "^10.16.4",
143+
"framer-motion": "^11.3.0-alpha.0",
144144
"fs-extra": "^10.0.0",
145145
"full-icu": "^1.3.0",
146146
"glob-promise": "^6.0.5",
@@ -221,7 +221,9 @@
221221
"@parcel/rust": "2.12.1-dev.3224",
222222
"@parcel/types": "2.0.0-dev.1601",
223223
"@parcel/utils": "2.0.0-dev.1601",
224-
"@parcel/workers": "2.0.0-dev.1601"
224+
"@parcel/workers": "2.0.0-dev.1601",
225+
"@types/react": "npm:[email protected]",
226+
"@types/react-dom": "npm:[email protected]"
225227
},
226228
"@parcel/transformer-css": {
227229
"cssModules": {

packages/@adobe/react-spectrum/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"access": "public"
102102
},
103103
"peerDependencies": {
104-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
105-
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
104+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
105+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
106106
}
107107
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"@swc/helpers": "^0.5.0"
3232
},
3333
"peerDependencies": {
34-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
35-
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
34+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
35+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
3636
},
3737
"publishConfig": {
3838
"access": "public"

packages/@react-aria/accordion/src/useAccordion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface AccordionItemAria {
3434
regionProps: DOMAttributes
3535
}
3636

37-
export function useAccordionItem<T>(props: AccordionItemAriaProps<T>, state: TreeState<T>, ref: RefObject<HTMLButtonElement>): AccordionItemAria {
37+
export function useAccordionItem<T>(props: AccordionItemAriaProps<T>, state: TreeState<T>, ref: RefObject<HTMLButtonElement | null>): AccordionItemAria {
3838
let {item} = props;
3939
let buttonId = useId();
4040
let regionId = useId();
@@ -65,7 +65,7 @@ export function useAccordionItem<T>(props: AccordionItemAriaProps<T>, state: Tre
6565
};
6666
}
6767

68-
export function useAccordion<T>(props: AriaAccordionProps<T>, state: TreeState<T>, ref: RefObject<HTMLDivElement>): AccordionAria {
68+
export function useAccordion<T>(props: AriaAccordionProps<T>, state: TreeState<T>, ref: RefObject<HTMLDivElement | null>): AccordionAria {
6969
let {listProps} = useSelectableList({
7070
...props,
7171
...state,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"@swc/helpers": "^0.5.0"
3333
},
3434
"peerDependencies": {
35-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
36-
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
35+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
36+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
3737
},
3838
"publishConfig": {
3939
"access": "public"

packages/@react-aria/actiongroup/src/useActionGroup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface ActionGroupAria {
2828
actionGroupProps: DOMAttributes
2929
}
3030

31-
export function useActionGroup<T>(props: AriaActionGroupProps<T>, state: ListState<T>, ref: RefObject<FocusableElement>): ActionGroupAria {
31+
export function useActionGroup<T>(props: AriaActionGroupProps<T>, state: ListState<T>, ref: RefObject<FocusableElement | null>): ActionGroupAria {
3232
let {
3333
isDisabled,
3434
orientation = 'horizontal' as Orientation

packages/@react-aria/actiongroup/src/useActionGroupItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const BUTTON_ROLES = {
3131
};
3232

3333
// eslint-disable-next-line @typescript-eslint/no-unused-vars
34-
export function useActionGroupItem<T>(props: AriaActionGroupItemProps, state: ListState<T>, ref?: RefObject<FocusableElement>): ActionGroupItemAria {
34+
export function useActionGroupItem<T>(props: AriaActionGroupItemProps, state: ListState<T>, ref?: RefObject<FocusableElement | null>): ActionGroupItemAria {
3535
let selectionMode = state.selectionManager.selectionMode;
3636
let buttonProps = {
3737
role: BUTTON_ROLES[selectionMode]

0 commit comments

Comments
 (0)