Skip to content

Conversation

@tractorss
Copy link
Contributor

@tractorss tractorss commented Feb 7, 2025

PR-Codex overview

This PR focuses on updating dependencies, specifically integrating @reown/appkit and its related packages, while also making adjustments in the web/src/components/ConnectWallet/index.tsx and web/src/context/Web3Provider.tsx files to accommodate these changes.

Detailed summary

  • Added @reown/appkit and @reown/appkit-adapter-wagmi to package.json.
  • Updated @tanstack/react-query from 5.59.20 to 5.66.0.
  • Replaced useWeb3Modal and useWeb3ModalState with useAppKit and useAppKitState in ConnectWallet/index.tsx.
  • Updated imports in Web3Provider.tsx to use @reown/appkit.
  • Adjusted types in functions to use AppKitNetwork instead of Chain.
  • Modified wagmi and viem versions in package.json.
  • Removed @web3modal/react from dependencies.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

This release improves wallet connection and network switching, providing a smoother, more flexible experience while enhancing overall performance.

• Chores
 – Updated core dependencies to boost compatibility and performance.

• Refactor
 – Streamlined wallet connectivity and chain switching for a more reliable experience.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2025

Walkthrough

The changes update the project’s dependency management and wallet connection flows. In package.json, new dependencies are added, some package versions updated, and an obsolete dependency removed. The ConnectWallet component now imports hooks from @reown/appkit instead of using @Web3Modal. In the Web3Provider, function signatures and parameter types are modified to accept more flexible values, and the adapter configuration is updated by integrating WagmiAdapter and createAppKit. These updates standardize library usage and configuration.

Changes

File(s) Change Summary
web/package.json Added dependencies: "@reown/appkit", "@reown/appkit-adapter-wagmi" (v^1.6.6); updated "@tanstack/react-query" (from ^5.59.20 to ^5.66.0), "viem" (from ^2.21.51 to ^2.22.22), "wagmi" (from ^2.13.0 to ^2.14.10); removed dependency "@web3modal/react".
web/src/.../ConnectWallet/index.tsx, web/src/.../Web3Provider.tsx Replaced imports from "@web3modal/wagmi/react" with "@reown/appkit/react"; in Web3Provider, updated function signatures (chainId now accepts number

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant CW as ConnectWallet
  participant AK as AppKit
  participant WA as WagmiAdapter

  U->>CW: Click Connect button
  CW->>AK: Invoke useAppKit()
  AK->>WA: Initialize connection
  WA-->>AK: Return connection status
  AK-->>CW: Provide wallet state
  CW-->>U: Render connection status
Loading
sequenceDiagram
  participant WP as Web3Provider
  participant WA as WagmiAdapter
  participant AK as AppKit

  WP->>WA: Create WagmiAdapter with config
  WP->>AK: Call createAppKit(...)
  WA-->>WP: Adapter configured
  AK-->>WP: AppKit setup complete
Loading

Suggested reviewers

  • alcercu

Poem

I'm a bunny coder with a joyful beat,
Hopping through updates with nimble little feet.
Old libraries nibbled away, replaced so neat,
With AppKit and Wagmi, my code's complete.
I twitch my ears for every bug that meets defeat,
Celebrating fresh commits with a happy, prickly tweet!


🪧 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. (Beta)
  • @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 or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@netlify
Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for curate-v2 ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/curate-v2/deploys/67a5f69d223ad4f8fca3457d
😎 Deploy Preview https://deploy-preview-72--curate-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
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

🧹 Nitpick comments (4)
web/src/context/Web3Provider.tsx (2)

29-31: Use consistent type checks when calling getChainRpcUrl.
Expanding chainId handling is beneficial, but be consistent in how chainId is passed throughout the codebase to minimize type conversion overhead and potential errors.


67-67: Z-index update for the overlay is valid.
Increasing z-index to 10000 is a big jump; make sure no other overlays or modals inadvertently overlay this one.

web/src/components/ConnectWallet/index.tsx (2)

6-6: Swapping from useWeb3Modal to useAppKit is valid.
This aligns with the new library import. Ensure all references to old hooks have been removed from the project.


33-34: Avoid naming collisions with open.
Renaming “open” from useAppKitState to something like “isModalOpen” or similar could improve readability, as you already use open from useAppKit as a function.

Apply this diff to clarify:

-  const { open: isOpen } = useAppKitState();
+  const { open: isModalOpen } = useAppKitState();
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c075eb and d265744.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • web/package.json (2 hunks)
  • web/src/components/ConnectWallet/index.tsx (2 hunks)
  • web/src/context/Web3Provider.tsx (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - curate-v2
  • GitHub Check: Header rules - curate-v2
  • GitHub Check: Pages changed - curate-v2
🔇 Additional comments (10)
web/src/context/Web3Provider.tsx (7)

3-6: Imports from the new libraries look good.
These updated imports effectively transition from older libraries to the new AppKit ecosystem. Everything appears correctly referenced; no issues identified.


26-27: Great flexibility added with (number | string) for chainId.
Accepting either number or string for chainId allows more robust usage with different chain representations. Ensure that all calling sites provide valid values (e.g., numeric strings) to avoid potential runtime confusion.


38-39: Transports switching for fallback URLs is appropriate.
The new AppKitNetwork parameter is correct, aligning with the new library’s type definitions. Everything here seems coherent.


49-49: Casting ALL_CHAINS to [AppKitNetwork, ...AppKitNetwork[]] is acceptable.
This ensures at least one chain is always present while matching the types required by createAppKit. Good approach!


52-56: Adapter initialization is aligned with the new WagmiAdapter.
The networks, projectId, and transports look well-structured. Consider implementing error handling for missing or invalid projectId in non-production environments.


58-61: createAppKit configuration is well-structured.
Defining adapters, networks, and defaultNetwork seamlessly integrates the new library. If additional networks beyond Arbitrum or Arbitrum Sepolia become supported, ensure they’re appended properly to networks.


71-71: WagmiProvider usage looks correct.
Integrating the wagmiConfig into the preserves existing functionality, transitioning to the new adapter. This is a clean approach with minimal disruption.

web/package.json (3)

75-76: New AppKit dependencies look aligned with usage.
The addition of “@reown/appkit” and “@reown/appkit-adapter-wagmi” at ^1.6.6 is consistent with the new imports in Web3Provider.


79-79: Upgrading @tanstack/react-query is a good move.
Keep an eye on potential API changes or deprecations in this minor jump. Run your test suite to ensure no breakage.


109-110: Bumping viem & wagmi to newer versions.
These updates look compatible, but confirm that no features you rely on have breaking changes. Checking release notes is recommended.

@jaybuidl jaybuidl linked an issue Feb 10, 2025 that may be closed by this pull request
@jaybuidl jaybuidl merged commit a596f10 into master Feb 10, 2025
7 checks passed
@jaybuidl jaybuidl deleted the chore/migrate-to-reown branch February 10, 2025 21:05
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.

Migration from WalletConnect to Reown

3 participants