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

Feat/chakra v3 #1912

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Feat/chakra v3 #1912

merged 1 commit into from
Jan 21, 2025

Conversation

BLuEScioN
Copy link
Collaborator

@BLuEScioN BLuEScioN commented Nov 15, 2024

closes #1903

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

I am upgrading Chakra v2 to v3. Major upgrade!

My changes:

In v3, Chakra renamed many components and props. Therefore, there was a lot of renaming of components and props all across the app. In v3, Chakra also moved from closed components to open, compound components. Also, the structure of a lot of components just changed as well. Thus, I needed to update the JSX in a lot of places. Frequently, this required me to slightly update the logic of components, too.

sx was deprecated and replaced with css.

Referencing colors by their css variable name changed slightly.
Eg. var(--stacks-colors-borderPrimary) has become var(--stacks-colors-border-primary)

Due to Chakra deprecating Cacheprovider and the cookieSSRManager in v3, we need a new way of making sure what SSR generates matches what the client generates. We can do is by removing all uses of useColorMode and useColorModeValue, and no longer using these client side hooks moving forward. These hooks cause theme mistmaches between the server and client because they can only run on the client. On the server, the use of useTheme always returns undefined which causes the client side hooks to always return the dark theme color.

Existing bugs that were fixed as part of this PR:

  • outdated/null theme variables were updated

Code quality improvements:

  • px values were changed to unit values or theme vars

Testing Plan:

We have snapshot tests, but we do not have visual regression tests. In order to use those, we would need to investigate the options and do work to set that up for the project.

Considering that adding additional UI testing will take more time, and it's unclear if it will effectively catch UI regressions, I think the best we can do here is do manual testing for UI regressions. We should have a 1 hr. meeting where we go through the explorer and note any areas where there are or maybe regressions.

Things to check:

List of explorer pages:
Home page - http://localhost:3000/?chain=mainnet
Blocks page - http://localhost:3000/blocks?chain=mainnet
Block id page -
BTC block id page -
Tokens page - http://localhost:3000/tokens?chain=mainnet
Token page - http://localhost:3000/token/SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token?chain=mainnet (1 example)
Transactions page - http://localhost:3000/transactions?chain=mainnet
Transaction coinbase id page -
Transaction transfer id page - http://localhost:3000/txid/0x3b5c7aba50044a43ed577eff28027afa6c221e8c79e8e6c01f38752313b602e9?chain=mainnet (1 example)
Signers page - http://localhost:3000/signers?chain=mainnet
Signer id page - http://localhost:3000/signer/0x03b42ff50ea79b0dcee6a8e90610fb9f3cd00ce29769cc278dee2e446ab105722a?chain=mainnet (1 example)
Sandbox Deploy - http://localhost:3000/sandbox/deploy?chain=mainnet
Sandbox Faucet page -
Sandbox Contract Call -
Search page - http://localhost:3000/search?chain=mainnet&fromAddress=andre.btc&startTime=1735689600&endTime=1735862399 (1 example)

Light and dark mode.
Desktop vs mobile.
Do all the controls from Chakra UI behave the same?

  • Buttons
  • Links

How to handle errors and logging:

Issue ticket number and link

#1897

Checklist:

  • I have performed a self-review of my code.
  • I have tested the change on desktop and mobile.
  • [] I have added thorough tests where applicable.
  • [] I've added analytics and error logging where applicable.

Screenshots (if appropriate):

Copy link

vercel bot commented Nov 15, 2024

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

Name Status Preview Comments Updated (UTC)
explorer-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2025 6:31am
hiro-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2025 6:31am

@BLuEScioN BLuEScioN marked this pull request as ready for review December 6, 2024 06:26
@blockstack-devops
Copy link

🎉 This PR is included in version 1.243.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

upgrade Charkra UI to the latest verison
3 participants