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

Add noUncheckedIndexedAccess: true in dashboard tsconfig and fix all issues #5084

Conversation

MananTank
Copy link
Member

@MananTank MananTank commented Oct 18, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR introduces several code improvements, including enhanced null checks, type safety adjustments, and optimizations in various components and hooks. It aims to improve code reliability and prevent potential runtime errors.

Detailed summary

  • Added noUncheckedIndexedAccess in tsconfig.json.
  • Enhanced cookie handling in SyncStoreToCookies.tsx.
  • Simplified ecosystem checks in EcosystemLandingPage.tsx.
  • Added null checks for chains in allChains.ts.
  • Improved metadata handling in useDashboardContractMetadata.tsx.
  • Added optional chaining for balance checks in distribute-button.tsx.
  • Specified frame types in connect-frames.ts.
  • Added fallback for token URI returns in tokenUri.ts.
  • Improved file upload handling in image-upload.tsx.
  • Enhanced wallet distribution color handling in WalletDistributionChartCard.tsx.
  • Added safety checks in search utility functions.
  • Handled potential null values in various components and hooks.
  • Updated published contract checks to return null if not found.
  • Improved error handling in IPFS upload components.
  • Enhanced contract function handling with type safety.
  • Cleaned up currency definitions to use native token structures.

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

Copy link

vercel bot commented Oct 18, 2024

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 Oct 19, 2024 2:56am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Oct 19, 2024 2:56am
thirdweb_playground ⬜️ Skipped (Inspect) Oct 19, 2024 2:56am
wallet-ui ⬜️ Skipped (Inspect) Oct 19, 2024 2:56am

@vercel vercel bot temporarily deployed to Preview – wallet-ui October 18, 2024 19:52 Inactive
Copy link

changeset-bot bot commented Oct 18, 2024

⚠️ No Changeset found

Latest commit: 5da500e

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

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 18, 2024 19:52 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 18, 2024 19:52 Inactive
Copy link

graphite-app bot commented Oct 18, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

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

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 18, 2024
Copy link
Member Author

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

Join @MananTank and the rest of your teammates on Graphite Graphite

@MananTank MananTank force-pushed the 10-19-add_nouncheckedindexedaccess_true_in_dashboard_tsconfig_and_fix_all_issues branch from 8efe7af to d027088 Compare October 18, 2024 19:53
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 18, 2024 19:53 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 18, 2024 19:53 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 18, 2024 19:53 Inactive
@MananTank MananTank marked this pull request as ready for review October 18, 2024 19:53
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.29%. Comparing base (4542a48) to head (5da500e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5084   +/-   ##
=======================================
  Coverage   45.29%   45.29%           
=======================================
  Files        1059     1059           
  Lines       54729    54729           
  Branches     3956     3956           
=======================================
  Hits        24791    24791           
  Misses      29247    29247           
  Partials      691      691           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 4542a48
packages 40.23% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Copy link
Contributor

github-actions bot commented Oct 18, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 42.81 KB (0%) 857 ms (0%) 739 ms (+44.68% 🔺) 1.6 s
thirdweb (cjs) 102.66 KB (0%) 2.1 s (0%) 1.2 s (-12.68% 🔽) 3.3 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 147 ms (+96.89% 🔺) 243 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 186 ms (+609.39% 🔺) 196 ms
thirdweb/react (minimal + tree-shaking) 17.36 KB (0%) 348 ms (0%) 189 ms (+11.03% 🔺) 536 ms

@MananTank MananTank force-pushed the 10-19-add_nouncheckedindexedaccess_true_in_dashboard_tsconfig_and_fix_all_issues branch from d027088 to da7a821 Compare October 18, 2024 19:57
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 18, 2024 19:57 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 18, 2024 19:57 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 18, 2024 19:57 Inactive
@MananTank MananTank force-pushed the 10-19-add_nouncheckedindexedaccess_true_in_dashboard_tsconfig_and_fix_all_issues branch from da7a821 to 36350b7 Compare October 18, 2024 23:55
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 18, 2024 23:55 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 18, 2024 23:55 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 18, 2024 23:55 Inactive
@MananTank MananTank requested a review from jnsdls October 18, 2024 23:56
Copy link

graphite-app bot commented Oct 19, 2024

Merge activity

…issues (#5084)

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces various enhancements and bug fixes across multiple files, focusing on improving type safety, handling undefined values, and refining conditions to prevent errors. It also updates the handling of cookies, contract metadata, and native token definitions.

### Detailed summary
- Added `"noUncheckedIndexedAccess": true` in `tsconfig.json`.
- Updated cookie retrieval to check for `_val` in `SyncStoreToCookies.tsx`.
- Modified ecosystem redirection condition in `EcosystemLandingPage.tsx`.
- Added checks for undefined chains in `allChains.ts`.
- Improved handling of optional values in various components.
- Enhanced error handling for uploaded files in `IconUpload.tsx`.
- Refactored native token definitions for better clarity and maintainability.
- Checked for existence of items before accessing properties in several components.
- Ensured consistent handling of optional chaining to avoid runtime errors.
- Updated metadata handling in various contract-related components.

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

<!-- end pr-codex -->
@MananTank MananTank force-pushed the 10-19-add_nouncheckedindexedaccess_true_in_dashboard_tsconfig_and_fix_all_issues branch from 36350b7 to 5da500e Compare October 19, 2024 02:46
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 19, 2024 02:46 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 19, 2024 02:46 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 19, 2024 02:46 Inactive
@graphite-app graphite-app bot merged commit 5da500e into main Oct 19, 2024
31 checks passed
@graphite-app graphite-app bot deleted the 10-19-add_nouncheckedindexedaccess_true_in_dashboard_tsconfig_and_fix_all_issues branch October 19, 2024 02:56
@vercel vercel bot temporarily deployed to Production – thirdweb_playground October 19, 2024 02:56 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui October 19, 2024 02:56 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 October 19, 2024 02:56 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.

2 participants