Skip to content

Upgrade Controller#294

Merged
starknetdev merged 2 commits intomainfrom
feat/controller-update
May 6, 2025
Merged

Upgrade Controller#294
starknetdev merged 2 commits intomainfrom
feat/controller-update

Conversation

@starknetdev
Copy link
Member

@starknetdev starknetdev commented May 6, 2025

Summary by CodeRabbit

  • Chores

    • Updated and added several dependencies to support enhanced blockchain integrations and tooling.
  • Refactor

    • Consolidated theme and color mode settings into a single preset option for a more streamlined configuration.

@vercel
Copy link

vercel bot commented May 6, 2025

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

Name Status Preview Comments Updated (UTC)
loot-survivor ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 6, 2025 9:55pm

@coderabbitai
Copy link

coderabbitai bot commented May 6, 2025

Walkthrough

This update revises the ControllerConnector configuration in the UI provider by consolidating theme and color mode settings into a single preset property. Additionally, several dependencies in ui/package.json are upgraded or added, including blockchain-related packages and tooling, reflecting broader support for new integrations and features.

Changes

File(s) Change Summary
ui/package.json Upgraded @cartridge/connector and @cartridge/controller to 0.7.14-alpha.1. Updated starknet to ^6.21.0. Added @metamask/sdk, @solana/web3.js, open, and starknetkit as new dependencies.
ui/src/app/provider.tsx Modified ControllerConnector config: replaced theme and colorMode with unified preset property.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant ControllerConnector

    App->>ControllerConnector: Initialize with { preset: "loot-survivor" }
    ControllerConnector-->>App: Apply unified theme and color mode
Loading

Possibly related PRs

  • Upgrade Controller #204: Also involves upgrading @cartridge/connector and restructuring connector initialization, indicating related changes to controller and connector setup.

Poem

In the garden of code where updates bloom,
A preset now brightens the UI room.
Dependencies hop to versions anew,
Blockchain bunnies—Solana and Starknet too!
With every fresh nibble and package delight,
The interface shines, oh what a sight!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

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.

@starknetdev starknetdev marked this pull request as ready for review May 6, 2025 21:56
@starknetdev starknetdev changed the title WIP Controller Upgrade Upgrade Controller May 6, 2025
@starknetdev starknetdev merged commit be8a9fc into main May 6, 2025
9 of 10 checks passed
Copy link

@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 (1)
ui/src/app/provider.tsx (1)

17-90: Consider extracting configuration to a separate file

The ControllerConnector configuration is quite extensive and contains multiple detailed objects. To improve maintainability, consider extracting this configuration to a separate file (similar to networkConfig).

This would make the provider component more focused on its core responsibility and make the configuration easier to update independently.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ce52723 and 7d3a65f.

⛔ Files ignored due to path filters (1)
  • ui/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • ui/package.json (3 hunks)
  • ui/src/app/provider.tsx (1 hunks)
🔇 Additional comments (5)
ui/package.json (4)

17-20: Notable expansion of blockchain support

The addition of @metamask/sdk, @solana/web3.js, and starknetkit indicates an expansion to support multiple blockchain networks (Ethereum, Solana, and enhanced Starknet support).

This multi-chain approach aligns well with the WIP controller upgrade mentioned in the PR title, but ensure that these integrations are properly tested across environments.

Also applies to: 55-55


43-43: New dependency: open package

The open package was added, which is typically used to open URLs, files, or executables. Ensure this is only used in a controlled manner, as it could potentially be a security concern if misused with user-controlled input.


13-14:

Details

❓ Verification inconclusive

Be cautious with alpha version dependencies in production

You've updated @cartridge/connector and @cartridge/controller to alpha versions (0.7.14-alpha.1) from stable versions (^0.5.8). This is a significant version jump that includes alpha-stage code, which may introduce instability or breaking changes.

Consider pinning to specific versions during testing and carefully validate behavior before deploying to production.


🏁 Script executed:

#!/bin/bash
# Check the release notes or changelog for these packages to verify major changes
npm view @cartridge/connector@0.7.14-alpha.1 repository.url
npm view @cartridge/controller@0.7.14-alpha.1 repository.url

Length of output: 124


To verify that these alpha versions actually exist and see how they’re tagged, let’s list all published versions and dist-tags for each package:


🏁 Script executed:

#!/bin/bash
# List all available versions to confirm 0.7.14-alpha.1 exists
npm view @cartridge/connector versions --json
npm view @cartridge/controller versions --json

# Show dist-tags to see if an “alpha” or similar tag is in use
npm dist-tag ls @cartridge/connector
npm dist-tag ls @cartridge/controller

Length of output: 3942


Caution: using prerelease dependencies in production
You’ve pinned both @cartridge/connector and @cartridge/controller to 0.7.14-alpha.1 (dist-tag “prerelease”), whereas the latest stable release is 0.7.13. Jumping from a stable to an alpha version can introduce instability or breaking changes.

• Validate these packages extensively in a non-production environment.
• If this upgrade is for testing only, consider reverting production to the stable 0.7.13.
• Before any production rollout, ensure you’ve covered all integration and regression tests.


53-53:

Details

❓ Verification inconclusive

Version constraint change for starknet package

The starknet package has been updated from fixed version 6.11.0 to a caret range ^6.21.0. While this allows for compatible updates, blockchain packages sometimes introduce subtle changes even in minor versions.

Consider documenting the specific breaking changes between 6.11.0 and 6.21.0 that prompted this update.


🏁 Script executed:

#!/bin/bash
# Check for breaking changes between versions
npm view starknet@6.11.0 version time
npm view starknet@6.21.0 version time

Length of output: 19847


🏁 Script executed:

#!/bin/bash
# Retrieve repository URL and homepage for the starknet package
npm view starknet repository.url homepage

Length of output: 176


🏁 Script executed:

#!/bin/bash
# Fetch changelog entries between v6.11.0 and v6.21.0
curl -sL https://raw.githubusercontent.com/starknet-io/starknet.js/main/CHANGELOG.md \
  | sed -n '/## \[6\.21\.0\]/,/## \[6\.11\.0\]/p'

Length of output: 134


🏁 Script executed:

#!/bin/bash
# List root directory of the starknet.js repo to locate changelog file
curl -s https://api.github.com/repos/starknet-io/starknet.js/contents | jq -r '.[].name'

Length of output: 386


Review and document breaking changes for starknet upgrade
Please verify the changelog for any breaking changes introduced between versions 6.11.0 and 6.21.0 and document them alongside this dependency bump.

File: ui/package.json (line 53)
From: "starknet": "6.11.0"
To: "starknet": "^6.21.0"

• Review https://github.com/starknet-io/starknet.js/blob/main/CHANGELOG.md for entries under 6.21.0 down to 6.11.0.
• Note any breaking or subtle behavioral changes and add a brief summary in your project’s CHANGELOG or a comment in package.json.
• If no breaking changes exist, a short confirmation comment will suffice.

ui/src/app/provider.tsx (1)

82-82:

Details

❓ Verification inconclusive

Configuration simplification with preset property

You've consolidated the theme and color mode settings into a single preset: "loot-survivor" property, which aligns with the updated controller package. This simplification improves code readability.

Verify that this preset properly handles both theming and color mode that were previously set separately. The alpha version of the connector packages may have changed how these settings work.


🏁 Script executed:

#!/bin/bash
# Search for documentation or examples of the new preset property
rg -A 5 "preset.*loot-survivor" --glob "*.{tsx,ts,js,jsx}"

Length of output: 409


Confirm that the “loot-survivor” preset still applies both theme and color mode settings

Please double-check that the new preset: "loot-survivor" configuration in the updated controller package indeed replaces your previous separate theme and colorMode settings. The alpha connector may bundle these differently than before, so review its documentation or TypeScript definitions for the “loot-survivor” preset to ensure:

  • Theme tokens (colors, typography, etc.) are correctly applied
  • Color mode (light/dark) defaults and toggles behave as expected

Location to verify:

  • ui/src/app/provider.tsx: line 82 (preset: "loot-survivor",)

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.

1 participant