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

chore: upgrade react-aria / React 19 & Next.js 15 support #3732

Merged
merged 5 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@codesandbox/sandpack-react": "^2.6.4",
"@iconify/icons-solar": "^1.2.3",
"@iconify/react": "^4.1.1",
"@internationalized/date": "^3.5.4",
"@internationalized/date": "3.5.5",
"@mapbox/rehype-prism": "^0.6.0",
"@nextui-org/aria-utils": "workspace:*",
"@nextui-org/badge": "workspace:*",
Expand Down Expand Up @@ -101,7 +101,7 @@
"@docusaurus/utils": "2.0.0-beta.3",
"@next/bundle-analyzer": "^13.4.6",
"@next/env": "^13.4.12",
"@react-types/shared": "3.23.1",
"@react-types/shared": "3.24.1",
"@tailwindcss/typography": "^0.5.9",
"@types/canvas-confetti": "^1.4.2",
"@types/lodash": "^4.14.194",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@commitlint/config-conventional": "^17.2.0",
"@react-bootstrap/babel-preset": "^2.1.0",
"@react-types/link": "^3.4.4",
"@react-types/shared": "3.23.1",
"@react-types/shared": "3.24.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ Codebase verification

React-aria dependencies are not in sync across the workspace

The verification reveals version inconsistencies in react-aria related packages across the workspace:

  • Most packages use @react-aria/[email protected], but there's an instance of 3.24.1
  • @react-aria/focus has both 3.18.2 and 3.17.1 versions
  • @react-aria/interactions has both 3.22.2 and 3.21.1 versions
  • @react-aria/ssr has both 3.9.5 and 3.9.4 versions

These version mismatches could lead to potential compatibility issues. Consider updating all react-aria related dependencies to their latest compatible versions to maintain consistency across the workspace.

πŸ”— Analysis chain

Verify completeness of react-aria upgrade.

The PR objective mentions upgrading react-aria, but only @react-types/shared is updated. Let's verify if other related dependencies need updating.


Let me generate another script to check the specific versions of react-aria related packages:

This will help us verify if there are any version mismatches or outdated packages in the workspace.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other react-aria related dependencies that might need updating

# Search for react-aria related dependencies in package.json
echo "Searching for react-aria related dependencies..."
rg -A 1 '@react-|react-aria' package.json

# Search for react-aria imports in the codebase to ensure we catch all usage
echo "Searching for react-aria imports in the codebase..."
rg -g '!{node_modules,dist,build}/*' -l '@react-|react-aria'

Length of output: 16654


Script:

#!/bin/bash
# Check for all @react-aria and @react-types packages and their versions
rg '"@react-(aria|types)/[^"]+": "[^"]+"' package.json

# Check if there are any @react-aria or @react-types dependencies in workspace packages
echo "Checking workspace packages..."
fd package.json -x rg '"@react-(aria|types)/[^"]+": "[^"]+"' {}

Length of output: 9023

"@storybook/react": "^7.4.6",
"@swc-node/jest": "^1.5.2",
"@swc/core": "^1.3.35",
Expand Down
14 changes: 7 additions & 7 deletions packages/components/accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
"@nextui-org/framer-utils": "workspace:*",
"@nextui-org/divider": "workspace:*",
"@nextui-org/use-aria-accordion": "workspace:*",
"@react-aria/interactions": "3.21.3",
"@react-aria/focus": "3.17.1",
"@react-aria/utils": "3.24.1",
"@react-stately/tree": "3.8.1",
"@react-aria/button": "3.9.5",
"@react-types/accordion": "3.0.0-alpha.21",
"@react-types/shared": "3.23.1"
"@react-aria/interactions": "3.22.2",
"@react-aria/focus": "3.18.2",
"@react-aria/utils": "3.25.2",
"@react-stately/tree": "3.8.4",
"@react-aria/button": "3.9.8",
"@react-types/accordion": "3.0.0-alpha.23",
"@react-types/shared": "3.24.1"
},
"devDependencies": {
"@nextui-org/theme": "workspace:*",
Expand Down
20 changes: 10 additions & 10 deletions packages/components/autocomplete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
"@nextui-org/spinner": "workspace:*",
"@nextui-org/use-aria-button": "workspace:*",
"@nextui-org/use-safe-layout-effect": "workspace:*",
"@react-aria/combobox": "3.9.1",
"@react-aria/focus": "3.17.1",
"@react-aria/i18n": "3.11.1",
"@react-aria/interactions": "3.21.3",
"@react-aria/utils": "3.24.1",
"@react-aria/visually-hidden": "3.8.12",
"@react-stately/combobox": "3.8.4",
"@react-types/combobox": "3.11.1",
"@react-types/shared": "3.23.1"
"@react-aria/combobox": "3.10.3",
"@react-aria/focus": "3.18.2",
"@react-aria/i18n": "3.12.2",
"@react-aria/interactions": "3.22.2",
"@react-aria/utils": "3.25.2",
"@react-aria/visually-hidden": "3.8.15",
"@react-stately/combobox": "3.9.2",
"@react-types/combobox": "3.12.1",
"@react-types/shared": "3.24.1"
},
"devDependencies": {
"@nextui-org/avatar": "workspace:*",
Expand All @@ -69,7 +69,7 @@
"@nextui-org/system": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@nextui-org/use-infinite-scroll": "workspace:*",
"@react-stately/data": "3.11.4",
"@react-stately/data": "3.11.6",
"clean-package": "2.2.0",
"framer-motion": "^11.0.28",
"react": "^18.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/components/avatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-utils": "workspace:*",
"@nextui-org/use-image": "workspace:*",
"@react-aria/interactions": "3.21.3",
"@react-aria/focus": "3.17.1",
"@react-aria/utils": "3.24.1"
"@react-aria/interactions": "3.22.2",
"@react-aria/focus": "3.18.2",
"@react-aria/utils": "3.25.2"
},
"devDependencies": {
"@nextui-org/theme": "workspace:*",
Expand Down
10 changes: 5 additions & 5 deletions packages/components/breadcrumbs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
"@nextui-org/react-utils": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/shared-icons": "workspace:*",
"@react-aria/focus": "3.17.1",
"@react-aria/breadcrumbs": "3.5.13",
"@react-aria/utils": "3.24.1",
"@react-types/breadcrumbs": "3.7.5",
"@react-types/shared": "3.23.1"
"@react-aria/focus": "3.18.2",
"@react-aria/breadcrumbs": "3.5.16",
"@react-aria/utils": "3.25.2",
"@react-types/breadcrumbs": "3.7.7",
"@react-types/shared": "3.24.1"
},
"devDependencies": {
"@nextui-org/theme": "workspace:*",
Expand Down
12 changes: 6 additions & 6 deletions packages/components/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
"@nextui-org/use-aria-button": "workspace:*",
"@nextui-org/ripple": "workspace:*",
"@nextui-org/spinner": "workspace:*",
"@react-aria/button": "3.9.5",
"@react-aria/interactions": "3.21.3",
"@react-aria/utils": "3.24.1",
"@react-aria/focus": "3.17.1",
"@react-types/shared": "3.23.1",
"@react-types/button": "3.9.4"
"@react-aria/button": "3.9.8",
"@react-aria/interactions": "3.22.2",
"@react-aria/utils": "3.25.2",
"@react-aria/focus": "3.18.2",
"@react-types/shared": "3.24.1",
"@react-types/button": "3.9.6"
},
"devDependencies": {
"@nextui-org/theme": "workspace:*",
Expand Down
24 changes: 12 additions & 12 deletions packages/components/calendar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@
"@nextui-org/use-aria-button": "workspace:*",
"@nextui-org/button": "workspace:*",
"lodash.debounce": "^4.0.8",
"@internationalized/date": "^3.5.4",
"@react-aria/calendar": "3.5.8",
"@react-aria/focus": "3.17.1",
"@react-aria/i18n": "3.11.1",
"@react-stately/calendar": "3.5.1",
"@react-types/button": "3.9.4",
"@react-aria/visually-hidden": "3.8.12",
"@react-aria/utils": "3.24.1",
"@react-stately/utils": "3.10.1",
"@react-types/calendar": "3.4.6",
"@react-aria/interactions": "3.21.3",
"@react-types/shared": "3.23.1",
"@internationalized/date": "3.5.5",
"@react-aria/calendar": "3.5.11",
"@react-aria/focus": "3.18.2",
"@react-aria/i18n": "3.12.2",
"@react-stately/calendar": "3.5.4",
"@react-types/button": "3.9.6",
"@react-aria/visually-hidden": "3.8.15",
"@react-aria/utils": "3.25.2",
"@react-stately/utils": "3.10.3",
"@react-types/calendar": "3.4.9",
"@react-aria/interactions": "3.22.2",
"@react-types/shared": "3.24.1",
"scroll-into-view-if-needed": "3.0.10",
"@types/lodash.debounce": "^4.0.7"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components/calendar/src/calendar-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ export function CalendarCell(originalProps: CalendarCellProps) {
!isDisabled && !isInvalid && state.isCellUnavailable(props.date.subtract({days: 1}));
const highlightedRange = "highlightedRange" in state && state.highlightedRange;
const isSelectionStart =
isSelected && highlightedRange && isSameDay(props.date, highlightedRange.start);
isSelected && highlightedRange ? isSameDay(props.date, highlightedRange.start) : false;
jrgarciadev marked this conversation as resolved.
Show resolved Hide resolved
const isSelectionEnd =
isSelected && highlightedRange && isSameDay(props.date, highlightedRange.end);
isSelected && highlightedRange ? isSameDay(props.date, highlightedRange.end) : false;
const {locale} = useLocale();
const dayOfWeek = getDayOfWeek(props.date, locale);
const isRangeStart =
Expand Down
2 changes: 1 addition & 1 deletion packages/components/calendar/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {DateValue, startOfYear} from "@internationalized/date";

export function getYearRange(start?: DateValue, end?: DateValue): DateValue[] {
export function getYearRange(start?: DateValue | null, end?: DateValue | null): DateValue[] {
jrgarciadev marked this conversation as resolved.
Show resolved Hide resolved
const years: DateValue[] = [];

if (!start || !end) {
Expand Down
10 changes: 5 additions & 5 deletions packages/components/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
"@nextui-org/react-utils": "workspace:*",
"@nextui-org/use-aria-button": "workspace:*",
"@nextui-org/ripple": "workspace:*",
"@react-aria/focus": "3.17.1",
"@react-aria/utils": "3.24.1",
"@react-aria/interactions": "3.21.3",
"@react-aria/button": "3.9.5",
"@react-types/shared": "3.23.1"
"@react-aria/focus": "3.18.2",
"@react-aria/utils": "3.25.2",
"@react-aria/interactions": "3.22.2",
"@react-aria/button": "3.9.8",
"@react-types/shared": "3.24.1"
},
"devDependencies": {
"@nextui-org/theme": "workspace:*",
Expand Down
18 changes: 9 additions & 9 deletions packages/components/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/use-callback-ref": "workspace:*",
"@nextui-org/use-safe-layout-effect": "workspace:*",
"@react-aria/checkbox": "3.14.3",
"@react-aria/focus": "3.17.1",
"@react-aria/interactions": "3.21.3",
"@react-aria/utils": "3.24.1",
"@react-aria/visually-hidden": "3.8.12",
"@react-stately/checkbox": "3.6.5",
"@react-stately/toggle": "3.7.4",
"@react-types/checkbox": "3.8.1",
"@react-types/shared": "3.23.1"
"@react-aria/checkbox": "3.14.6",
"@react-aria/focus": "3.18.2",
"@react-aria/interactions": "3.22.2",
"@react-aria/utils": "3.25.2",
"@react-aria/visually-hidden": "3.8.15",
"@react-stately/checkbox": "3.6.8",
"@react-stately/toggle": "3.7.7",
"@react-types/checkbox": "3.8.3",
"@react-types/shared": "3.24.1"
},
"devDependencies": {
"@nextui-org/chip": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/components/chip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
"@nextui-org/shared-icons": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-utils": "workspace:*",
"@react-aria/focus": "3.17.1",
"@react-aria/interactions": "3.21.3",
"@react-aria/utils": "3.24.1",
"@react-types/checkbox": "3.8.1"
"@react-aria/focus": "3.18.2",
"@react-aria/interactions": "3.22.2",
"@react-aria/utils": "3.25.2",
"@react-types/checkbox": "3.8.3"
},
"devDependencies": {
"@nextui-org/theme": "workspace:*",
Expand Down
14 changes: 7 additions & 7 deletions packages/components/date-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"dependencies": {
"@nextui-org/react-utils": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@internationalized/date": "^3.5.4",
"@react-aria/datepicker": "3.10.1",
"@react-aria/i18n": "3.11.1",
"@react-stately/datepicker": "3.9.4",
"@react-types/datepicker": "3.7.4",
"@react-types/shared": "3.23.1",
"@react-aria/utils": "3.24.1"
"@internationalized/date": "3.5.5",
"@react-aria/datepicker": "3.11.2",
"@react-aria/i18n": "3.12.2",
"@react-stately/datepicker": "3.10.2",
"@react-types/datepicker": "3.8.2",
"@react-types/shared": "3.24.1",
"@react-aria/utils": "3.25.2"
Comment on lines +45 to +51
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Potential semver violation detected

The PR objectives mention breaking changes (layoutNode property deprecation), but all dependency updates use minor version bumps. According to semver, breaking changes should increment the major version.

Please verify:

  1. Are these the correct versions that include the breaking change?
  2. Should we be updating to major versions instead?
  3. How will this affect downstream dependencies?

},
"devDependencies": {
"@nextui-org/system": "workspace:*",
Expand Down
6 changes: 0 additions & 6 deletions packages/components/date-input/src/date-input-segment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,8 @@ export const DateInputSegment: React.FC<DateInputSegmentProps> = ({
...otherProps
}) => {
const ref = useRef(null);

let {segmentProps} = useDateSegment(segment, state, ref);

// @ts-expect-error autoCapitalize is not a valid prop
// Removing autoCapitalize as it causes bugs in Firefox.
// See: https://github.com/adobe/react-spectrum/issues/5599
delete segmentProps.autoCapitalize;
Comment on lines -28 to -31
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the autoCapitalize prop has been removed, I also removed this process.
adobe/react-spectrum#6657


return (
<div
{...mergeProps(segmentProps, otherProps)}
Expand Down
3 changes: 2 additions & 1 deletion packages/components/date-input/src/use-date-input.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type {DateInputVariantProps, DateInputSlots, SlotsToClasses} from "@nextui-org/theme";
import type {AriaDateFieldProps} from "@react-types/datepicker";
import type {SupportedCalendars} from "@nextui-org/system";
import type {DateValue, Calendar} from "@internationalized/date";
import type {DateValue} from "@react-types/datepicker";
import type {Calendar} from "@internationalized/date";
import type {ReactRef} from "@nextui-org/react-utils";
import type {DOMAttributes, GroupDOMAttributes} from "@react-types/shared";
import type {DateInputGroupProps} from "./date-input-group";
Expand Down
18 changes: 9 additions & 9 deletions packages/components/date-picker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@
"react-dom": ">=18"
},
"dependencies": {
"@internationalized/date": "^3.5.4",
"@internationalized/date": "3.5.5",
jrgarciadev marked this conversation as resolved.
Show resolved Hide resolved
"@nextui-org/button": "workspace:*",
"@nextui-org/calendar": "workspace:*",
"@nextui-org/date-input": "workspace:*",
"@nextui-org/popover": "workspace:*",
"@nextui-org/react-utils": "workspace:*",
"@nextui-org/shared-icons": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@react-aria/datepicker": "3.10.1",
"@react-aria/i18n": "3.11.1",
"@react-aria/utils": "3.24.1",
"@react-stately/datepicker": "3.9.4",
"@react-stately/overlays": "3.6.7",
"@react-stately/utils": "3.10.1",
"@react-types/datepicker": "3.7.4",
"@react-types/shared": "3.23.1"
"@react-aria/datepicker": "3.11.2",
"@react-aria/i18n": "3.12.2",
"@react-aria/utils": "3.25.2",
"@react-stately/datepicker": "3.10.2",
"@react-stately/overlays": "3.6.10",
"@react-stately/utils": "3.10.3",
"@react-types/datepicker": "3.8.2",
"@react-types/shared": "3.24.1"
},
"devDependencies": {
"@nextui-org/radio": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/divider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-rsc-utils": "workspace:*",
"@nextui-org/system-rsc": "workspace:*",
"@react-types/shared": "3.23.1"
"@react-types/shared": "3.24.1"
},
"devDependencies": {
"@nextui-org/theme": "workspace:*",
Expand Down
10 changes: 5 additions & 5 deletions packages/components/dropdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
"@nextui-org/popover": "workspace:*",
"@nextui-org/react-utils": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@react-aria/focus": "3.17.1",
"@react-aria/menu": "3.14.1",
"@react-aria/utils": "3.24.1",
"@react-stately/menu": "3.7.1",
"@react-types/menu": "3.9.9"
"@react-aria/focus": "3.18.2",
"@react-aria/menu": "3.15.3",
"@react-aria/utils": "3.25.2",
"@react-stately/menu": "3.8.2",
"@react-types/menu": "3.9.11"
},
"devDependencies": {
"@nextui-org/avatar": "workspace:*",
Expand Down
14 changes: 7 additions & 7 deletions packages/components/input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
"@nextui-org/shared-icons": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/use-safe-layout-effect": "workspace:*",
"@react-aria/focus": "3.17.1",
"@react-aria/interactions": "3.21.3",
"@react-aria/textfield": "3.14.5",
"@react-aria/utils": "3.24.1",
"@react-stately/utils": "3.10.1",
"@react-types/shared": "3.23.1",
"@react-types/textfield": "3.9.3",
"@react-aria/focus": "3.18.2",
"@react-aria/interactions": "3.22.2",
"@react-aria/textfield": "3.14.8",
"@react-aria/utils": "3.25.2",
"@react-stately/utils": "3.10.3",
"@react-types/shared": "3.24.1",
"@react-types/textfield": "3.9.6",
"react-textarea-autosize": "^8.5.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/input/src/use-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ export function useInput<T extends HTMLInputElement | HTMLTextAreaElement = HTML
const getInputProps: PropGetter = useCallback(
(props = {}) => {
return {
ref: domRef,
"data-slot": "input",
"data-filled": dataAttr(isFilled),
"data-filled-within": dataAttr(isFilledWithin),
Expand All @@ -384,6 +383,7 @@ export function useInput<T extends HTMLInputElement | HTMLTextAreaElement = HTML
),
"aria-readonly": dataAttr(originalProps.isReadOnly),
onChange: chain(inputProps.onChange, onChange),
ref: domRef,
};
},
[
Expand Down
2 changes: 1 addition & 1 deletion packages/components/kbd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@nextui-org/system-rsc": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-utils": "workspace:*",
"@react-aria/utils": "3.24.1"
"@react-aria/utils": "3.25.2"
},
"devDependencies": {
"@nextui-org/theme": "workspace:*",
Expand Down
Loading