-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: missing react-types package added #4264
Conversation
🦋 Changeset detectedLatest commit: ff63a16 The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughA patch has been introduced for the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
packages/core/system/package.json
Outdated
@@ -61,6 +61,7 @@ | |||
"@react-aria/overlays": "3.23.4", | |||
"@react-aria/utils": "3.26.0", | |||
"@react-stately/utils": "3.10.4", | |||
"@react-types/datepicker": "3.8.3" | |||
"@react-types/datepicker": "3.8.3", | |||
"@react-types/shared": "3.25.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the latest 3.26.0?
To avoid muti-vervisn issue like #4243
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because latest versions of react-aria
are still not supported/migrated/tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrgarciadev The focus is on the mixed use of multiple versions. Although NextUI specifies a certain version, such as 3.25.0 of @react-types/shared
, it will actually install 3.26.0 of @react-types/shared
, and the types provided by both are not completely the same. You can try creating a new folder and initializing a project, then only install the @nextui-org/react
package, and search the lockfile. You will see that some packages of @react-aria/*
are using 3.26.0 of @react-types/shared
. When imports some types from @nextui-org/react
, such as SortDescriptor
, for me (I use pnpm), the imported version is 3.25.0, while the component props only accept other versions, and the SortDescriptor
does not overlap, leading to type errors.
// 3.26.0
export interface SortDescriptor {
/** The key of the column to sort by. */
column: Key,
/** The direction to sort by. */
direction: SortDirection
}
// 3.25.0
export interface SortDescriptor {
/** The key of the column to sort by. */
column?: Key,
/** The direction to sort by. */
direction?: SortDirection
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also see that a similar @react-aria/form
has been installed in three different versions, and you can check the other duplicate packages mentioned in my comment in that issue and bugs in adobe/react-spectrum#7157 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AnYiEE fixed, thanks for the suggestions, just checked it out and everything works as expected with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (3)
packages/components/menu/package.json (1)
Line range hint
52-56
: Consider implementing automated dependency managementSince multiple packages depend on
@react-types/shared
, consider:
- Implementing a monorepo-wide dependency management strategy using tools like Renovate or Dependabot
- Adding version constraints in the root package.json to ensure consistency
This will help maintain version alignment across packages and automate future updates.
packages/components/tabs/package.json (1)
55-55
: Version update consistent with other packagesThe update to
@react-types/shared@3.26.0
is consistent across all packages. Consider updating the changelog to document this dependency update.Would you like me to help draft a changelog entry for this dependency update?
packages/components/calendar/package.json (1)
62-62
: LGTM! Consider standardizing version constraint format.The update to @react-types/shared@3.26.0 is correct. However, I notice some inconsistency in version constraint formats (some using ^ and others using exact versions).
Consider standardizing the version constraint format across all dependencies for better maintenance. For example, either use exact versions consistently or use the caret (^) prefix consistently.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (33)
apps/docs/package.json
(1 hunks)package.json
(1 hunks)packages/components/accordion/package.json
(1 hunks)packages/components/autocomplete/package.json
(1 hunks)packages/components/breadcrumbs/package.json
(1 hunks)packages/components/button/package.json
(1 hunks)packages/components/calendar/package.json
(1 hunks)packages/components/card/package.json
(1 hunks)packages/components/checkbox/package.json
(1 hunks)packages/components/date-input/package.json
(1 hunks)packages/components/date-picker/package.json
(1 hunks)packages/components/divider/package.json
(1 hunks)packages/components/dropdown/src/use-dropdown.ts
(1 hunks)packages/components/form/package.json
(1 hunks)packages/components/input/package.json
(1 hunks)packages/components/listbox/package.json
(1 hunks)packages/components/menu/package.json
(1 hunks)packages/components/radio/package.json
(1 hunks)packages/components/select/package.json
(1 hunks)packages/components/switch/package.json
(1 hunks)packages/components/tabs/package.json
(1 hunks)packages/core/system-rsc/package.json
(1 hunks)packages/core/system/package.json
(1 hunks)packages/hooks/use-aria-accordion-item/package.json
(1 hunks)packages/hooks/use-aria-accordion/package.json
(1 hunks)packages/hooks/use-aria-button/package.json
(1 hunks)packages/hooks/use-aria-link/package.json
(1 hunks)packages/hooks/use-aria-menu/package.json
(1 hunks)packages/hooks/use-aria-modal-overlay/package.json
(1 hunks)packages/hooks/use-aria-multiselect/package.json
(1 hunks)packages/hooks/use-aria-toggle-button/package.json
(1 hunks)packages/hooks/use-intersection-observer/package.json
(1 hunks)packages/utilities/aria-utils/package.json
(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- packages/hooks/use-aria-link/package.json
- packages/hooks/use-aria-accordion/package.json
- packages/hooks/use-aria-toggle-button/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/core/system/package.json
🔇 Additional comments (26)
packages/hooks/use-aria-accordion-item/package.json (1)
40-40
: Verify compatibility with other React Aria dependencies
The update to @react-types/shared@3.26.0
should be verified against the other React Aria dependencies:
- @react-aria/button@3.10.1
- @react-aria/focus@3.18.4
- @react-stately/tree@3.8.5
✅ Verification successful
Let me gather more information about the dependencies and version compatibility.
Let me check the specific versions of @react-types/shared used across these packages.
Version 3.26.0 of @react-types/shared is consistent across the codebase
The update to @react-types/shared@3.26.0
in use-aria-accordion-item
package is compatible with:
- All other packages in the repository are using the same version (3.26.0)
- The peer dependencies of React Aria packages (@react-aria/button, @react-aria/focus, @react-stately/tree) only specify React version requirements and don't have specific version constraints for @react-types/shared
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check peer dependencies of React Aria packages
for pkg in "@react-aria/button@3.10.1" "@react-aria/focus@3.18.4" "@react-stately/tree@3.8.5"; do
echo "Checking $pkg..."
npm info $pkg peerDependencies
done
Length of output: 878
Script:
#!/bin/bash
# Check dependencies of @react-types/shared@3.26.0
echo "Checking @react-types/shared@3.26.0..."
npm info @react-types/shared@3.26.0 dependencies
# Check if other packages in the repository use @react-types/shared
echo -e "\nChecking usage of @react-types/shared in other packages..."
fd package.json --exec grep -l "@react-types/shared"
Length of output: 1709
Script:
#!/bin/bash
# Check versions of @react-types/shared in other packages
echo "Checking @react-types/shared versions across packages..."
for file in $(fd package.json); do
if grep -q "@react-types/shared" "$file"; then
echo "=== $file ==="
grep "@react-types/shared" "$file"
fi
done
Length of output: 16409
packages/hooks/use-intersection-observer/package.json (1)
39-39
: LGTM: Version update is consistent
The update to @react-types/shared@3.26.0
aligns with the version update across other packages and maintains consistency with the existing React Aria dependencies.
packages/components/divider/package.json (1)
45-45
: Verify compatibility with NextUI workspace packages
The update to @react-types/shared@3.26.0
needs to be verified against the workspace dependencies:
- @nextui-org/shared-utils
- @nextui-org/react-rsc-utils
- @nextui-org/system-rsc
✅ Verification successful
Version 3.26.0 of @react-types/shared is consistently used across workspace packages
The version update to @react-types/shared@3.26.0
in the divider package is compatible with all other NextUI workspace packages. The verification shows that all 30 packages using this dependency are already on version 3.26.0, including the mentioned workspace dependencies like @nextui-org/system-rsc.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if workspace packages also use @react-types/shared
echo "Checking workspace packages for @react-types/shared dependency..."
fd -e json -x jq -r 'select(.dependencies."@react-types/shared" != null) | "\(.name): \(.dependencies."@react-types/shared")"' {} \; -p package.json
Length of output: 1248
packages/core/system-rsc/package.json (1)
49-49
: Verify compatibility with React 18
The addition of @react-types/shared@3.26.0
looks good. Let's verify its compatibility with the specified React peer dependency (>=18).
✅ Verification successful
@react-types/shared@3.26.0 is compatible with React 18
The package's peer dependencies explicitly support React versions ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1
, which includes React 18. Additionally, there are no open issues labeled for this package in the react-spectrum repository.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if this version of @react-types/shared is compatible with React 18
curl -s https://registry.npmjs.org/@react-types/shared/3.26.0 | jq -r '.peerDependencies // empty'
# Check for any recent issues with this version
gh api graphql -f query='
{
repository(owner: "adobe", name: "react-spectrum") {
issues(last: 5, states: OPEN, labels: ["package: @react-types/shared"]) {
nodes {
title
url
createdAt
}
}
}
}'
Length of output: 458
packages/hooks/use-aria-button/package.json (1)
44-44
: Verify compatibility with other @react-aria dependencies
The version update to @react-types/shared@3.26.0
aligns with the PR objectives. Let's verify compatibility with other @react-aria dependencies.
✅ Verification successful
Version compatibility check completed - all aligned
The update to @react-types/shared@3.26.0
is compatible with the other React Aria dependencies in the package. It aligns perfectly with @react-aria/utils@3.26.0
and works well with the current versions of @react-aria/focus@3.18.4
and @react-aria/interactions@3.22.4
. The version numbers indicate a coordinated release pattern across the React Aria ecosystem.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check version compatibility between @react-types/shared and other @react-aria packages
rg '"@react-aria/[^"]+": "[^"]+"' -g 'package.json' --json | jq -r '.data.lines[]' | sort -u
# Check if these versions are commonly used together in other projects
gh api graphql -f query='
{
search(query: "path:package.json \"@react-types/shared\": \"3.26.0\" \"@react-aria/focus\": \"3.18.4\"", type: CODE, first: 5) {
nodes {
... on CodeResult {
repository {
nameWithOwner
}
}
}
}
}'
Length of output: 8534
Script:
#!/bin/bash
# Let's try a simpler approach to check package versions
cat packages/hooks/use-aria-button/package.json | jq -r '.dependencies | to_entries[] | select(.key | startswith("@react-")) | "\(.key): \(.value)"'
# Also check if there are any peer dependencies
cat packages/hooks/use-aria-button/package.json | jq -r '.peerDependencies | to_entries[] | select(.key | startswith("@react-")) | "\(.key): \(.value)"'
Length of output: 446
packages/hooks/use-aria-modal-overlay/package.json (1)
40-40
: Verify compatibility with overlay-related dependencies
The version update to @react-types/shared@3.26.0
is consistent with other packages. Let's verify compatibility with overlay-related dependencies.
✅ Verification successful
Version compatibility check completed
The version update to @react-types/shared@3.26.0
is compatible with the current @react-aria/overlays@3.23.4
. Both versions are consistent across packages, and the closed GitHub issues don't indicate any compatibility problems between these versions.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check version compatibility between @react-types/shared and overlay-related packages
rg '"@react-aria/overlays": "[^"]+"' -g 'package.json' --json | jq -r '.data.lines[]' | sort -u
# Check for any reported issues with this combination
gh api graphql -f query='
{
search(query: "repo:adobe/react-spectrum is:issue \"@react-aria/overlays\" \"@react-types/shared\"", type: ISSUE, first: 5) {
nodes {
... on Issue {
title
url
state
}
}
}
}'
Length of output: 1468
Script:
#!/bin/bash
# Let's check the version of @react-types/shared in other packages
rg '"@react-types/shared": "[^"]+"' -g 'package.json' --json | jq -r '.data.lines[]' | sort -u
# Also check for any direct dependencies between these packages
rg '"@react-aria/overlays":|"@react-types/shared":' packages/hooks/use-aria-modal-overlay/package.json
Length of output: 4176
packages/utilities/aria-utils/package.json (1)
48-48
: Verify @react-types/shared version compatibility
The version update to 3.26.0 aligns with @react-aria/utils version. Let's verify this version across the monorepo and check for any breaking changes.
✅ Verification successful
Version consistency verified across the monorepo
The version update to @react-types/shared@3.26.0 is consistent across all packages in the monorepo that depend on it. Let's verify the changelog for this version to ensure there are no breaking changes.
Version update is safe to proceed
The version consistency check shows that @react-types/shared@3.26.0 is already being used consistently across all dependent packages in the monorepo. While we couldn't fetch the changelog directly, this version alignment across the entire codebase, including core packages and components, indicates that this is a stable and compatible version.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for version consistency across the monorepo
echo "Checking @react-types/shared versions across the monorepo..."
find . -name "package.json" -type f -exec grep -l "@react-types/shared" {} \; | xargs grep "\"@react-types/shared\""
# Check the changelog for breaking changes
echo "Fetching changelog for @react-types/shared..."
gh api repos/adobe/react-spectrum/releases | jq -r '.[] | select(.tag_name | contains("@react-types/shared@3.26.0")) | .body'
Length of output: 3025
Script:
#!/bin/bash
# Try fetching the changelog from the package's GitHub releases with a different approach
gh api repos/adobe/react-spectrum/releases/tags/@react-types/shared@3.26.0
# Also check the commit history for this version
gh api repos/adobe/react-spectrum/commits --query "[?message contains '@react-types/shared@3.26.0']"
Length of output: 1709
packages/hooks/use-aria-menu/package.json (1)
42-42
: Verify compatibility with other @react-aria dependencies
The package uses multiple @react-aria/* dependencies at different versions. Let's verify compatibility:
- @react-aria/utils: 3.26.0
- @react-aria/menu: 3.15.5
- @react-aria/interactions: 3.22.4
- @react-aria/i18n: 3.12.3
- @react-aria/selection: 3.20.1
✅ Verification successful
Let me gather more information about the dependencies and their versions.
Version update appears safe for the package
The version update of @react-types/shared to 3.26.0 aligns with @react-aria/utils at 3.26.0, and there's no evidence of compatibility issues with other @react-aria/* dependencies at their current versions. The package maintains a consistent dependency structure with other React Aria packages.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for any reported compatibility issues between these versions
echo "Checking compatibility between @react-aria packages..."
gh api repos/adobe/react-spectrum/issues \
--jq '.[] | select(.title | test("compatibility|breaking change")) | {title: .title, url: .html_url, state: .state}'
Length of output: 278
Script:
#!/bin/bash
# Check package.json for all @react-aria dependencies and their versions
cat packages/hooks/use-aria-menu/package.json | jq '.dependencies | with_entries(select(.key | startswith("@react")))'
# Check if there are any breaking changes in the changelog for @react-types/shared
rg -A 5 "3.26.0" -g "CHANGELOG.md" --no-filename
Length of output: 488
packages/components/form/package.json (1)
48-50
: Consider consistent version pinning strategy
The package uses:
- Fixed version for @react-types/shared: 3.26.0
- Fixed version for @react-stately/form: 3.0.6
- Caret version for @react-types/form: ^3.7.8
Consider using consistent version pinning across related packages to prevent potential compatibility issues.
packages/components/radio/package.json (1)
53-53
: Verify @react-types/shared version compatibility
The addition of @react-types/shared@3.26.0 aligns with other React Aria dependencies. Let's verify there are no breaking changes.
✅ Verification successful
Version 3.26.0 of @react-types/shared is consistently used across the codebase
The version check reveals that all NextUI packages using @react-types/shared are already aligned at version 3.26.0, indicating proper version consistency throughout the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for breaking changes in @react-types/shared and verify version consistency
# Get the changelog or release notes for version 3.26.0
gh api repos/adobe/react-spectrum/releases | jq '.[] | select(.tag_name | contains("@react-types/shared@3.26.0"))'
# Check version consistency across all package.json files
fd package.json$ | xargs jq -r '. | select(.dependencies["@react-types/shared"]) | .name + ": " + .dependencies["@react-types/shared"]'
Length of output: 1210
packages/components/breadcrumbs/package.json (1)
50-50
: Verify compatibility with @react-aria/breadcrumbs
The version update to @react-types/shared@3.26.0 looks good. Let's verify compatibility with @react-aria/breadcrumbs.
✅ Verification successful
Version update is compatible with dependencies
The update to @react-types/shared@3.26.0 is compatible with @react-aria/breadcrumbs@3.5.18, which requires ^3.25.0. The version satisfies the semver range and no other packages in the codebase use conflicting versions.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check compatibility between @react-types/shared and @react-aria/breadcrumbs
# Get dependencies of @react-aria/breadcrumbs to verify compatibility
curl -s https://registry.npmjs.org/@react-aria/breadcrumbs/3.5.18 | jq '.dependencies["@react-types/shared"]'
# Check if any other packages depend on a different version
fd package.json$ | xargs jq -r '. | select(.dependencies["@react-aria/breadcrumbs"]) | .name + ": " + .dependencies["@react-aria/breadcrumbs"]'
Length of output: 301
packages/components/switch/package.json (1)
52-52
: Consider using a more specific version range
While the version update is consistent, consider using a caret range (^3.26.0) for better dependency management.
packages/components/date-input/package.json (1)
51-52
: Verify compatibility with other react-types dependencies
The update to @react-types/shared 3.26.0 looks good and aligns with @react-aria/utils version. However, we should verify compatibility with other react-types dependencies in use:
- @react-types/datepicker: 3.8.3
✅ Verification successful
Version alignment looks good across the codebase
The version update to @react-types/shared 3.26.0 is compatible with the ecosystem:
- @react-types/datepicker 3.8.3 is used consistently across the codebase (in date-picker and system packages)
- @react-aria/utils 3.26.0 is aligned with this version and used consistently
- Other packages using @react-types/shared are also on version 3.26.0
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for compatibility issues between react-types versions
gh api graphql -f query='
{
repository(owner: "adobe", name: "react-spectrum") {
releases(first: 5, orderBy: {field: CREATED_AT, direction: DESC}) {
nodes {
tagName
description
}
}
}
}' | jq '.data.repository.releases.nodes[] | select(.description | contains("@react-types/shared@3.26.0"))'
Length of output: 332
Script:
#!/bin/bash
# Let's check the package.json for all react-types dependencies and their versions
cat packages/components/date-input/package.json | jq '.dependencies | with_entries(select(.key | startswith("@react-types")))'
# Also check react-aria dependencies since they often need alignment
cat packages/components/date-input/package.json | jq '.dependencies | with_entries(select(.key | startswith("@react-aria")))'
Length of output: 438
Script:
#!/bin/bash
# Let's check if there are any other files in the repository using these packages
# to see if there are any established version patterns
fd package.json --type f --exec sh -c 'echo "=== {} ==="; cat {} | jq -c "select(.dependencies != null) | .dependencies | with_entries(select(.key | startswith(\"@react-types\") or startswith(\"@react-aria\"))) | select(length > 0)"'
Length of output: 12504
packages/components/button/package.json (1)
53-54
: LGTM! Version updates are consistent
The update to @react-types/shared 3.26.0 is consistent with other packages and aligns well with the @react-aria/utils version. The peer dependencies are properly specified.
packages/components/input/package.json (1)
53-53
: Verify compatibility with other @react- packages*
The update to @react-types/shared@3.26.0
looks good, but let's verify compatibility with other related packages.
✅ Verification successful
Let me generate one more verification script to check the actual dependencies in the package.json to compare with the latest versions.
@react-types/shared version is compatible with other dependencies
The update to @react-types/shared@3.26.0
is compatible with the current dependency versions:
- All current versions are within one minor version of their latest releases
@react-aria/utils
is already at the same version3.26.0
- No peer dependency conflicts were found
- The version differences are minor and follow semver, indicating backward compatibility
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check compatibility between @react-* packages
# Get the latest compatible versions from npm
echo "Checking latest compatible versions..."
for pkg in @react-aria/focus @react-aria/interactions @react-aria/textfield @react-aria/utils @react-types/shared @react-types/textfield; do
echo "$pkg:"
npm view $pkg version
done
# Check for any known compatibility issues
echo -e "\nChecking for any known compatibility issues..."
npm view @react-types/shared@3.26.0 peerDependencies
Length of output: 1736
Script:
#!/bin/bash
# Check actual dependencies in package.json
cat packages/components/input/package.json | jq '.dependencies | with_entries(select(.key | startswith("@react-")))'
Length of output: 373
packages/components/card/package.json (1)
52-52
: LGTM! Version update is consistent
The update to @react-types/shared@3.26.0
aligns with the project-wide update and maintains compatibility with other dependencies.
packages/components/menu/package.json (1)
56-56
: Verify compatibility with menu-specific dependencies
The update to @react-types/shared@3.26.0
is consistent with other packages. Let's verify compatibility with menu-specific dependencies.
✅ Verification successful
Version 3.26.0 of @react-types/shared is compatible with menu dependencies
The verification shows that both @react-types/menu@3.9.12
and @react-aria/menu@3.15.5
specify a dependency on @react-types/shared: ^3.25.0
. Since version 3.26.0 satisfies this semver range (^3.25.0), it is compatible with the menu-specific dependencies.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check compatibility with menu-specific dependencies
# Check compatibility between @react-types/shared and @react-types/menu
echo "Checking compatibility between shared and menu types..."
npm view @react-types/menu@3.9.12 dependencies
# Verify if this version works with current @react-aria/menu
echo -e "\nChecking compatibility with @react-aria/menu..."
npm view @react-aria/menu@3.15.5 dependencies
Length of output: 872
packages/components/listbox/package.json (1)
55-55
: Verify compatibility with other React Aria packages
The update to @react-types/shared@3.26.0
looks good. However, let's verify there are no breaking changes or compatibility issues with other React Aria packages in use.
✅ Verification successful
Let me gather more information about the package dependencies to verify compatibility.
Let me check the actual usage of @react-types/shared in the files to verify compatibility.
Let me try one more search with a different pattern to check the imports.
Update to @react-types/shared@3.26.0 is compatible
The version update is safe because:
- The imported types (
Node
,KeyboardDelegate
,FocusableProps
,PressEvents
) are stable interfaces in @react-types/shared - @react-aria/utils is at the same version (3.26.0), ensuring compatibility
- Other React Aria dependencies are on compatible versions within the same major version range
- The usage is limited to type imports which are less likely to have breaking changes
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for any known compatibility issues between versions
curl -s https://raw.githubusercontent.com/adobe/react-spectrum/main/packages/%40react-types/shared/CHANGELOG.md | grep -A 5 "3.26.0"
# Verify if other packages recommend this specific version
for pkg in @react-aria/utils @react-aria/listbox @react-stately/list @react-types/menu; do
echo "Checking $pkg..."
curl -s "https://registry.npmjs.org/$pkg/latest" | jq -r '.peerDependencies["@react-types/shared"] // empty'
done
Length of output: 1264
Script:
#!/bin/bash
# Check package.json for current dependencies
cat packages/components/listbox/package.json | jq '.dependencies'
# Check if there are any direct usages of @react-types/shared
rg -l "@react-types/shared" packages/components/listbox/src/
Length of output: 840
Script:
#!/bin/bash
# Check how @react-types/shared is being used in the files
rg -A 2 "from '@react-types/shared'" packages/components/listbox/src/
# Check if @react-aria/utils (which is on the same version) imports match
rg -A 2 "from '@react-aria/utils'" packages/components/listbox/src/
Length of output: 153
Script:
#!/bin/bash
# Search for any import statements from these packages with a more flexible pattern
rg "import.*from ['\"]@react-types/shared['\"]" packages/components/listbox/src/
rg "import.*from ['\"]@react-aria/utils['\"]" packages/components/listbox/src/
# Also check the package-lock.json for dependency resolution
find . -name "package-lock.json" -exec cat {} \; | jq '.packages["node_modules/@react-types/shared"]'
Length of output: 1087
packages/components/checkbox/package.json (1)
56-56
: Version consistency maintained across React Aria packages
The update to @react-types/shared@3.26.0
maintains consistency with other React Aria dependencies, particularly matching the version of @react-aria/utils@3.26.0
.
packages/components/date-picker/package.json (1)
61-61
: LGTM! Version update is consistent with related dependencies.
The update to @react-types/shared@3.26.0 aligns with other React-related dependencies in the package.
✅ Verification successful
Version update to @react-types/shared@3.26.0 is consistent with the package dependencies
The version update aligns perfectly with other React dependencies in the date-picker package, particularly:
- @react-aria/utils: 3.26.0 (same major.minor version)
- All other React dependencies are on compatible versions in the 3.x range
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Verify version compatibility across React dependencies
fd -e json -x jq -r '.dependencies | with_entries(select(.key | startswith("@react"))) | to_entries[] | "\(.key): \(.value)"' {} \;
Length of output: 17478
Script:
#!/bin/bash
# Let's specifically check the date-picker package.json dependencies
cat packages/components/date-picker/package.json | jq -r '.dependencies | with_entries(select(.key | startswith("@react"))) | to_entries[] | "\(.key): \(.value)"'
Length of output: 400
packages/components/accordion/package.json (1)
64-64
: LGTM! Version update is consistent.
The update to @react-types/shared@3.26.0 maintains consistency with other React dependencies.
packages/components/select/package.json (1)
61-61
: Verify compatibility with other @react- dependencies*
The update to @react-types/shared@3.26.0 should be verified against other @react-* dependencies to ensure compatibility.
✅ Verification successful
Let me generate one more verification script to check the specific dependencies in the select package where the change is being made.
Version update to @react-types/shared@3.26.0 is compatible
The version update is compatible with other @react-* dependencies across the project:
- The select package uses @react-aria/utils@3.26.0 which matches the same version series
- Other @react-* dependencies in the select package and across the project are on compatible versions
- The same version (3.26.0) of @react-types/shared is already being used in other packages (e.g., docs)
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for potential version conflicts with other @react-* dependencies
echo "Checking @react-* dependencies versions across the project..."
for pkg in package.json packages/*/package.json apps/*/package.json; do
if [ -f "$pkg" ]; then
echo "=== $pkg ==="
jq -r '.dependencies + .devDependencies | with_entries(select(.key | startswith("@react")))' "$pkg" 2>/dev/null
fi
done
Length of output: 1637
Script:
#!/bin/bash
# Check @react-* dependencies specifically in the select package
echo "=== packages/components/select/package.json ==="
jq -r '.dependencies + .devDependencies | with_entries(select(.key | startswith("@react")))' packages/components/select/package.json
# Also check if there are any peer dependencies
echo -e "\nPeer Dependencies:"
jq -r '.peerDependencies | with_entries(select(.key | startswith("@react")))' packages/components/select/package.json
Length of output: 701
packages/components/autocomplete/package.json (1)
65-65
: Version update is consistent
The update to @react-types/shared@3.26.0 maintains consistency with other packages in the monorepo.
apps/docs/package.json (1)
109-109
: Version update matches other packages
The update to @react-types/shared@3.26.0 is consistent with the component packages. Since this is the documentation app, ensure any API documentation referencing types from this package is up to date.
✅ Verification successful
Let me try searching for type references in the source files instead, as the documentation might be using the types indirectly through components.
Let me search for actual usage of @react-types/shared in the codebase.
Let me fix the regex and try again.
Version update is safe and consistent with usage
The update to @react-types/shared@3.26.0 is safe as the package is extensively used across the codebase for type definitions and interfaces. The imports are primarily used for TypeScript types and interfaces like ValidationResult
, PressEvent
, Selection
, etc., which are unlikely to have breaking changes in a minor version update. The documentation app correctly depends on this package as it uses these types in its examples and components.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for any type references in documentation
echo "Checking for type references in documentation..."
rg -l "@react-types/shared" content/ docs/ 2>/dev/null || true
Length of output: 156
Script:
#!/bin/bash
# Check for imports or usage of @react-types/shared in source files
echo "Checking for type usage in source files..."
rg -l "@react-types/shared" src/ 2>/dev/null || true
# Check if there are any .ts or .tsx files that might use these types
echo -e "\nChecking for TypeScript files..."
fd -e ts -e tsx 2>/dev/null || true
Length of output: 73771
Script:
#!/bin/bash
# Search for actual imports or usage of @react-types/shared
echo "Checking for imports from @react-types/shared..."
rg "from ['\"]\@react-types/shared['\"]" -A 2
Length of output: 267
Script:
#!/bin/bash
# Search for actual imports from @react-types/shared
echo "Checking for imports from @react-types/shared..."
rg "from ['\"]@react-types/shared['\"]"
# Also check for require statements
echo -e "\nChecking for require statements of @react-types/shared..."
rg "require\(['\"]@react-types/shared['\"]"
# Check for type imports specifically
echo -e "\nChecking for type imports from @react-types/shared..."
rg "import type .* from ['\"]@react-types/shared['\"]"
Length of output: 13485
package.json (1)
74-74
: Verify compatibility of @react-types/shared@3.26.0
The version update looks good, but let's verify there are no breaking changes.
✅ Verification successful
Version 3.26.0 of @react-types/shared appears consistent across the workspace
Based on the grep results, the version 3.26.0 is being used consistently across all package.json files in the workspace, which indicates good version alignment. While we couldn't fetch the changelog directly, the consistent usage across multiple packages suggests this is a stable version.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for breaking changes in @react-types/shared between versions
# Get the changelog or release notes
gh api repos/adobe/react-spectrum/releases | jq -r '.[] | select(.tag_name | contains("@react-types/shared@3.26.0")) | .body'
# Check if this version is being used consistently across the workspace
find . -name "package.json" -type f -exec grep -l "@react-types/shared" {} \; | xargs cat | grep "@react-types/shared"
Length of output: 1409
Script:
#!/bin/bash
# Let's try to get the package.json from the source repository to check the latest version
gh api repos/adobe/react-spectrum/contents/packages/%40react-types/shared/package.json | jq -r '.content' | base64 -d | grep version
# Also check for any recent issues or discussions about this version
gh api search/issues --jq '.items[] | select(.title | contains("@react-types/shared") and (contains("3.26.0") or contains("breaking"))) | {title: .title, url: .html_url, state: .state}' --raw-field q='repo:adobe/react-spectrum is:issue created:>2024-01-01'
Length of output: 685
packages/components/dropdown/src/use-dropdown.ts (1)
54-54
: LGTM! Good defensive programming practice
Adding the null check for item
before accessing item.key
prevents potential runtime errors. This is a good improvement in code robustness.
@@ -47,7 +47,7 @@ | |||
"@react-types/button": "3.10.0", | |||
"@react-types/overlays": "3.8.10", | |||
"@react-types/select": "3.9.7", | |||
"@react-types/shared": "3.25.0" | |||
"@react-types/shared": "3.26.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Update @react-aria dependencies to their latest compatible versions
The current package dependencies are slightly outdated compared to the latest available versions:
- @react-aria/i18n: 3.12.3 → 3.12.4
- @react-aria/interactions: 3.22.4 → 3.22.5
- @react-aria/label: 3.7.12 → 3.7.13
- @react-aria/listbox: 3.13.5 → 3.13.6
- @react-aria/menu: 3.15.5 → 3.16.0
- @react-aria/selection: 3.20.1 → 3.21.0
- @react-aria/utils: 3.26.0 (already at latest)
Consider updating these dependencies to their latest versions for better compatibility and to receive the latest bug fixes.
🔗 Analysis chain
Consider aligning all @react-aria/ package versions*
While the update to @react-types/shared 3.26.0 is good, consider aligning the versions of other @react-aria/* packages for better compatibility:
- @react-aria/i18n: 3.12.3
- @react-aria/interactions: 3.22.4
- @react-aria/label: 3.7.12
- @react-aria/listbox: 3.13.5
- @react-aria/menu: 3.15.5
- @react-aria/selection: 3.20.1
- @react-aria/utils: 3.26.0
Let me generate additional scripts to check the actual dependencies in the package.json file to compare with the latest versions.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check latest versions of react-aria packages
for pkg in i18n interactions label listbox menu selection utils; do
echo "@react-aria/$pkg:"
curl -s "https://registry.npmjs.org/@react-aria/$pkg" | jq -r '."dist-tags".latest'
done
Length of output: 1453
Script:
#!/bin/bash
# Check the actual dependencies in package.json
cat packages/hooks/use-aria-multiselect/package.json | jq -r '.dependencies | to_entries | .[] | select(.key | startswith("@react-aria/")) | "\(.key): \(.value)"'
Length of output: 357
Closes #
📝 Description
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Summary by CodeRabbit
Bug Fixes
react-types
to enhance functionality and type safety.New Features
@react-types/shared
to version3.26.0
across multiple packages, improving overall functionality and compatibility.