Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Apr 18, 2025


PR-Codex overview

This PR focuses on enhancing the handling of the ThirdwebClient across various components by introducing a unified client instantiation method that includes options for JWT and team ID. It also refactors components to utilize this new client setup.

Detailed summary

  • Introduced getThirdwebClient to accept options for jwt and teamId.
  • Updated components to use the new client instantiation.
  • Added constants for last used project and team IDs.
  • Refactored various components to pass the client prop explicitly.
  • Adjusted cookie handling for tracking last used team ID.
  • Enhanced client usage in API calls and UI components for consistency.

The following files were skipped due to too many changes: apps/dashboard/src/app/team/[team_slug]/(team)/~/usage/overview/components/SponsoredTransactionsTableUI.stories.tsx, apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/components/published-contracts.tsx, apps/dashboard/src/app/team/[team_slug]/[project_slug]/components/Transactions/index.tsx, apps/dashboard/src/components/configure-networks/ConfigureNetworkForm.tsx, apps/dashboard/src/components/contract-components/contract-table/index.tsx, apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/page.tsx, apps/dashboard/src/app/(dashboard)/(bridge)/routes/components/server/routelist-card.tsx, apps/dashboard/src/app/(dashboard)/(bridge)/routes/components/server/routes-table.tsx, apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/page.tsx, apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/resolveAddressAndEns.tsx, apps/dashboard/src/app/team/components/TeamHeader/TeamSelectorMobileMenuButton.tsx, apps/dashboard/src/app/team/components/TeamHeader/TeamHeaderUI.stories.tsx, apps/dashboard/src/app/(dashboard)/contracts/deploy/[compiler_uri]/page.tsx, apps/dashboard/src/app/(dashboard)/(bridge)/routes/components/server/routelist-row.tsx, apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx, apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/members/TeamMembersSettingsPage.stories.tsx, apps/dashboard/src/app/(dashboard)/published-contract/[publisher]/[contract_id]/page.tsx, apps/dashboard/src/components/contract-components/contract-publish-form/index.tsx, apps/dashboard/src/app/nebula-app/(app)/components/ExecuteTransactionCard.stories.tsx, apps/dashboard/src/lib/wallet/nfts/alchemy.ts, apps/dashboard/src/lib/wallet/nfts/moralis.ts, apps/dashboard/src/app/(dashboard)/contracts/publish/[publish_uri]/page.tsx, apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/metadata-header.tsx, apps/dashboard/src/app/team/components/TeamHeader/team-header-logged-in.client.tsx, apps/dashboard/src/components/contract-components/fetchPublishedContracts.ts, apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/getModuleInstalledParams.ts, apps/dashboard/src/app/nebula-app/(app)/components/Chats.stories.tsx, apps/dashboard/src/components/explore/contract-card/index.tsx, apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx, apps/dashboard/src/app/(dashboard)/(chain)/chainlist/components/server/chainlist-row.tsx, apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/components/PublishedContractTable.tsx, apps/dashboard/src/app/(dashboard)/(chain)/chainlist/components/server/chainlist-card.tsx, apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/ProfileUI.tsx, apps/dashboard/src/components/contract-components/fetch-contracts-with-versions.ts, apps/dashboard/src/app/team/[team_slug]/(team)/layout.tsx, apps/dashboard/src/@/components/blocks/Avatars/ProjectAvatar.stories.tsx, apps/dashboard/src/app/(dashboard)/published-contract/components/publish-based-deploy.tsx, apps/dashboard/src/app/team/components/TeamHeader/team-header.tsx, apps/dashboard/src/app/team/[team_slug]/[project_slug]/components/Transactions/TransactionCharts.tsx, apps/dashboard/src/app/team/[team_slug]/[project_slug]/layout.tsx, apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/cross-chain/data-table.tsx, apps/dashboard/src/app/(dashboard)/published-contract/[publisher]/[contract_id]/utils/getPublishedContractsWithPublisherMapping.ts, apps/dashboard/src/app/(dashboard)/published-contract/[publisher]/[contract_id]/[version]/page.tsx, apps/dashboard/src/@/components/blocks/Avatars/GradientAvatar.stories.tsx, apps/dashboard/src/app/team/[team_slug]/[project_slug]/page.tsx, apps/dashboard/src/components/contract-components/hooks.ts

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

@vercel vercel bot temporarily deployed to Preview – docs-v2 April 18, 2025 21:42 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 18, 2025 21:42 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 18, 2025 21:42 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 18, 2025 21:42 Inactive
@vercel
Copy link

vercel bot commented Apr 18, 2025

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

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 18, 2025 10:38pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Apr 18, 2025 10:38pm
login ⬜️ Skipped (Inspect) Apr 18, 2025 10:38pm
thirdweb_playground ⬜️ Skipped (Inspect) Apr 18, 2025 10:38pm
wallet-ui ⬜️ Skipped (Inspect) Apr 18, 2025 10:38pm

@changeset-bot
Copy link

changeset-bot bot commented Apr 18, 2025

⚠️ No Changeset found

Latest commit: 5715da2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@MananTank MananTank marked this pull request as ready for review April 18, 2025 21:43
@MananTank MananTank requested review from a team as code owners April 18, 2025 21:43
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Apr 18, 2025
Copy link
Member Author

MananTank commented Apr 18, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov
Copy link

codecov bot commented Apr 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.18%. Comparing base (f7f179c) to head (ac8b09f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6775   +/-   ##
=======================================
  Coverage   55.18%   55.18%           
=======================================
  Files         896      896           
  Lines       56924    56924           
  Branches     3943     3943           
=======================================
  Hits        31412    31412           
  Misses      25416    25416           
  Partials       96       96           
Flag Coverage Δ
packages 55.18% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 18, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 50.71 KB (0%) 1.1 s (0%) 132 ms (+74.42% 🔺) 1.2 s
thirdweb (cjs) 138.82 KB (0%) 2.8 s (0%) 221 ms (+37.7% 🔺) 3 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 113 ms (0%) 46 ms (+989.23% 🔺) 158 ms
thirdweb/chains (tree-shaking) 514 B (0%) 11 ms (0%) 23 ms (+993.21% 🔺) 33 ms
thirdweb/react (minimal + tree-shaking) 19.37 KB (0%) 388 ms (0%) 70 ms (+439.6% 🔺) 457 ms

@MananTank MananTank force-pushed the 04-19-dashboard_add_team_id_to_thirdweb_client branch from 70eea22 to 1dd8b19 Compare April 18, 2025 21:56
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 18, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 18, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 18, 2025 21:56 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 18, 2025 21:56 Inactive
@MananTank MananTank force-pushed the 04-19-dashboard_add_team_id_to_thirdweb_client branch from 1dd8b19 to 8f51e87 Compare April 18, 2025 22:04
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 18, 2025 22:04 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 18, 2025 22:04 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 18, 2025 22:04 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 18, 2025 22:04 Inactive
@MananTank MananTank force-pushed the 04-19-dashboard_add_team_id_to_thirdweb_client branch from 8f51e87 to 8bb47ce Compare April 18, 2025 22:07
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 18, 2025 22:07 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 18, 2025 22:07 Inactive
Copy link
Member

@jnsdls jnsdls left a comment

Choose a reason for hiding this comment

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

LGTM

@MananTank MananTank force-pushed the 04-19-dashboard_add_team_id_to_thirdweb_client branch from 8bb47ce to 667a360 Compare April 18, 2025 22:14
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 18, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 18, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 18, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 18, 2025 22:14 Inactive
@MananTank MananTank force-pushed the 04-19-dashboard_add_team_id_to_thirdweb_client branch from 667a360 to 5715da2 Compare April 18, 2025 22:19
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 18, 2025 22:19 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 18, 2025 22:19 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 18, 2025 22:19 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 18, 2025 22:19 Inactive
@graphite-app
Copy link
Contributor

graphite-app bot commented Apr 18, 2025

Merge activity

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating the usage of the `getThirdwebClient` function throughout the codebase, transitioning to using an options object that includes `jwt` and `teamId`. This change enhances client initialization consistency and improves the handling of team-related functionality.

### Detailed summary
- Updated `getThirdwebClient` to accept an options object with `jwt` and `teamId`.
- Modified several components to pass the new client structure.
- Added constants for `LAST_USED_PROJECT_ID` and `LAST_USED_TEAM_ID`.
- Enhanced various components to include `client` as a prop, improving flexibility.
- Adjusted several pages and components to handle team IDs better.
- Improved cookie management for storing and retrieving the last used team ID.
- Updated storybook examples to utilize the new client structure.

> The following files were skipped due to too many changes: `apps/dashboard/src/app/team/[team_slug]/(team)/~/usage/overview/components/SponsoredTransactionsTableUI.stories.tsx`, `apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/components/published-contracts.tsx`, `apps/dashboard/src/app/team/[team_slug]/[project_slug]/components/Transactions/index.tsx`, `apps/dashboard/src/components/configure-networks/ConfigureNetworkForm.tsx`, `apps/dashboard/src/components/contract-components/contract-table/index.tsx`, `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/page.tsx`, `apps/dashboard/src/app/(dashboard)/(bridge)/routes/components/server/routelist-card.tsx`, `apps/dashboard/src/app/(dashboard)/(bridge)/routes/components/server/routes-table.tsx`, `apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/page.tsx`, `apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/resolveAddressAndEns.tsx`, `apps/dashboard/src/app/team/components/TeamHeader/TeamSelectorMobileMenuButton.tsx`, `apps/dashboard/src/app/team/components/TeamHeader/TeamHeaderUI.stories.tsx`, `apps/dashboard/src/app/(dashboard)/contracts/deploy/[compiler_uri]/page.tsx`, `apps/dashboard/src/app/(dashboard)/(bridge)/routes/components/server/routelist-row.tsx`, `apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx`, `apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/members/TeamMembersSettingsPage.stories.tsx`, `apps/dashboard/src/app/(dashboard)/published-contract/[publisher]/[contract_id]/page.tsx`, `apps/dashboard/src/components/contract-components/contract-publish-form/index.tsx`, `apps/dashboard/src/app/nebula-app/(app)/components/ExecuteTransactionCard.stories.tsx`, `apps/dashboard/src/lib/wallet/nfts/alchemy.ts`, `apps/dashboard/src/lib/wallet/nfts/moralis.ts`, `apps/dashboard/src/app/(dashboard)/contracts/publish/[publish_uri]/page.tsx`, `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/_layout/metadata-header.tsx`, `apps/dashboard/src/app/team/components/TeamHeader/team-header-logged-in.client.tsx`, `apps/dashboard/src/components/contract-components/fetchPublishedContracts.ts`, `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/getModuleInstalledParams.ts`, `apps/dashboard/src/app/nebula-app/(app)/components/Chats.stories.tsx`, `apps/dashboard/src/components/explore/contract-card/index.tsx`, `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx`, `apps/dashboard/src/app/(dashboard)/(chain)/chainlist/components/server/chainlist-row.tsx`, `apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/components/PublishedContractTable.tsx`, `apps/dashboard/src/app/(dashboard)/(chain)/chainlist/components/server/chainlist-card.tsx`, `apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/ProfileUI.tsx`, `apps/dashboard/src/components/contract-components/fetch-contracts-with-versions.ts`, `apps/dashboard/src/app/team/[team_slug]/(team)/layout.tsx`, `apps/dashboard/src/@/components/blocks/Avatars/ProjectAvatar.stories.tsx`, `apps/dashboard/src/app/(dashboard)/published-contract/components/publish-based-deploy.tsx`, `apps/dashboard/src/app/team/components/TeamHeader/team-header.tsx`, `apps/dashboard/src/app/team/[team_slug]/[project_slug]/components/Transactions/TransactionCharts.tsx`, `apps/dashboard/src/app/team/[team_slug]/[project_slug]/layout.tsx`, `apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/cross-chain/data-table.tsx`, `apps/dashboard/src/app/(dashboard)/published-contract/[publisher]/[contract_id]/utils/getPublishedContractsWithPublisherMapping.ts`, `apps/dashboard/src/app/(dashboard)/published-contract/[publisher]/[contract_id]/[version]/page.tsx`, `apps/dashboard/src/@/components/blocks/Avatars/GradientAvatar.stories.tsx`, `apps/dashboard/src/app/team/[team_slug]/[project_slug]/page.tsx`, `apps/dashboard/src/components/contract-components/hooks.ts`

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

<!-- end pr-codex -->
@graphite-app graphite-app bot force-pushed the 04-19-dashboard_add_team_id_to_thirdweb_client branch from 5715da2 to ac8b09f Compare April 18, 2025 22:30
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 18, 2025 22:31 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 18, 2025 22:31 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 18, 2025 22:31 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 18, 2025 22:31 Inactive
@graphite-app graphite-app bot merged commit ac8b09f into main Apr 18, 2025
23 checks passed
@graphite-app graphite-app bot deleted the 04-19-dashboard_add_team_id_to_thirdweb_client branch April 18, 2025 22:39
@vercel vercel bot temporarily deployed to Production – login April 18, 2025 22:39 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground April 18, 2025 22:39 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui April 18, 2025 22:39 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 April 18, 2025 22:39 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants