Skip to content

fix(deps): bump @nextui-org/theme in peerDependencies#4334

Merged
jrgarciadev merged 4 commits into
canaryfrom
fix/eng-1711
Dec 11, 2024
Merged

fix(deps): bump @nextui-org/theme in peerDependencies#4334
jrgarciadev merged 4 commits into
canaryfrom
fix/eng-1711

Conversation

@wingkwong
Copy link
Copy Markdown
Member

@wingkwong wingkwong commented Dec 11, 2024

Closes #4332

📝 Description

In PR #4311, a new slot hiddenInput has been added to checkbox, radio, toggle in theme package. Therefore, the corresponding peerDependencies should be also updated so that users can upgrade @nextui-org/theme package automatically.

⛳️ Current behavior (updates)

when users run nextui upgrade --all, @nextui-org/theme is not upgraded because of the peerDependencies.

🚀 New behavior

💣 Is this a breaking change (Yes/No):

📝 Additional Information

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Updated the peer dependency for the theme package to ensure compatibility.
  • Bug Fixes

    • Adjusted version constraints for the theme package to improve stability.

@linear
Copy link
Copy Markdown

linear Bot commented Dec 11, 2024

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Dec 11, 2024

🦋 Changeset detected

Latest commit: 1111783

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@nextui-org/switch Patch
@nextui-org/react Patch

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 3:57pm
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 3:57pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 11, 2024

Walkthrough

This pull request introduces a patch version update for the @nextui-org/checkbox, @nextui-org/switch, and @nextui-org/radio packages. It also modifies the peer dependency for @nextui-org/theme, updating the version requirement from >=2.4.0 to >=2.4.3. These changes reflect an adjustment in the dependency management of the project to ensure compatibility with the updated theme package.

Changes

File Change Summary
.changeset/famous-avocados-run.md Introduced patch version updates for @nextui-org/checkbox, @nextui-org/switch, and @nextui-org/radio, and updated peer dependency for @nextui-org/theme.
packages/components/switch/package.json Updated peer dependency version for @nextui-org/theme from >=2.4.0 to >=2.4.3.
packages/components/checkbox/package.json Updated package version to 2.3.6 and peer dependency for @nextui-org/theme from >=2.4.0 to >=2.4.3.
packages/components/radio/package.json Updated peer dependency for @nextui-org/theme from >=2.4.0 to >=2.4.3.

Assessment against linked issues

Objective Addressed Explanation
The component should render without throwing any errors (#4332) The changes do not directly address the bug reported.

Possibly related PRs

Suggested reviewers

  • jrgarciadev

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0b117e5 and 1111783.

📒 Files selected for processing (3)
  • .changeset/famous-avocados-run.md (1 hunks)
  • packages/components/checkbox/package.json (1 hunks)
  • packages/components/radio/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/famous-avocados-run.md
🔇 Additional comments (2)
packages/components/radio/package.json (1)

39-40: LGTM! Peer dependency update looks correct.

The update to @nextui-org/theme peer dependency (>=2.4.3) aligns with the PR objectives to support the new hiddenInput slot. The version constraint is appropriate as it:

  • Ensures users get at least version 2.4.3 which includes the required slot
  • Maintains flexibility for future updates
packages/components/checkbox/package.json (1)

38-41: LGTM! Peer dependency update is consistent.

The update to @nextui-org/theme peer dependency (>=2.4.3) matches the changes in the radio package and supports the new hiddenInput slot.

Let's verify this change is applied consistently across all affected components:

✅ Verification successful

Inconsistency found in theme peer dependency version

The verification reveals that only checkbox, radio, and switch components have been updated to require @nextui-org/theme version >=2.4.3, while all other components still use >=2.4.0. Since these three components share similar input functionality with the hiddenInput slot, this appears to be intentional and correct.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistency of @nextui-org/theme peer dependency across components
# that might use the hiddenInput slot (checkbox, radio, switch, toggle)

# Search for package.json files in component directories
fd --type f "package.json" packages/components/ --exec grep -l "@nextui-org/theme" {} \; | \
while read -r file; do
  echo "=== $file ==="
  grep -A 1 "@nextui-org/theme" "$file"
done

Length of output: 15239


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@wingkwong wingkwong marked this pull request as draft December 11, 2024 15:48
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
packages/components/switch/package.json (1)

39-39: LGTM! Consider adding migration notes

The version bump to >=2.4.3 looks appropriate to fix the TypeError. However, since this is a more restrictive peer dependency that could affect users on versions 2.4.0-2.4.2:

  1. Consider adding a note in the changelog about the potential impact
  2. Update the component's documentation to mention the minimum required theme version
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 76a72a9 and 0b117e5.

📒 Files selected for processing (2)
  • .changeset/famous-avocados-run.md (1 hunks)
  • packages/components/switch/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/famous-avocados-run.md
🔇 Additional comments (1)
packages/components/switch/package.json (1)

39-39: Verify the theme package changes that necessitate this version bump

Let's verify the changes in the theme package between versions 2.4.0 and 2.4.3 to ensure this fixes the slots.hiddenInput TypeError.

✅ Verification successful

Based on the review of the code and changelog, I can now provide a definitive response about the theme version bump:

Version bump is necessary to fix the hiddenInput implementation

The change from >=2.4.0 to >=2.4.3 is justified based on the following findings:

  • Version 2.4.3 contains critical fixes for interactive elements and build issues
  • Version 2.4.2 specifically fixed issues #4252 and #4260 related to interactive elements not working properly
  • The theme package exports hiddenInputClasses from utils/index.ts which is used in the toggle component
  • The toggle component provides the base implementation for the switch component's hidden input functionality
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for relevant changes in the theme package

# Look for hiddenInput related changes in the theme package
rg -A 5 "hiddenInput" packages/components/theme/

# Check for breaking changes or fixes in theme package
rg -l "fix.*switch|break.*switch" .changeset/

Length of output: 163


Script:

#!/bin/bash
# Let's try different paths and approaches

# First, find the theme package location
fd -t d "theme$" packages

# Look for switch-related files and changes
rg -l "switch" packages

# Look for hiddenInput in all files
rg -l "hiddenInput" packages

# Check for any recent changesets
fd -e md .changeset

Length of output: 2169


Script:

#!/bin/bash
# Let's examine the switch component and theme implementation

# Check the switch component implementation
cat packages/components/switch/src/switch.tsx

# Check the theme's toggle component (which might be used for switch)
cat packages/core/theme/src/components/toggle.ts

# Look for recent changes in theme package
cat packages/core/theme/CHANGELOG.md

Length of output: 45390

@wingkwong wingkwong changed the title fix(switch): bump @nextui-org/theme in peerDependencies fix(deps): bump @nextui-org/theme in peerDependencies Dec 11, 2024
@wingkwong wingkwong marked this pull request as ready for review December 11, 2024 15:54
@wingkwong wingkwong added this to the v2.6.9 milestone Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] - slots.hiddenInput is not a function in ThemeSwitch

2 participants