Skip to content

Conversation

@kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Dec 9, 2024

CNCT-2584

  • add custom resolver methods
  • add better test coverage
  • add caching for the getNFT method
  • small fix: handling falsy values

PR-Codex overview

This PR focuses on enhancing the NFT components in the thirdweb library by adding custom resolver methods, improving performance through caching, and increasing test coverage.

Detailed summary

  • Added custom resolver methods to NFTMedia, NFTName, and NFTDescription.
  • Implemented caching for the NFT info retrieval method.
  • Fixed handling of falsy values for NFT media properties.
  • Improved test coverage by extracting internal logic for testing.

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

@vercel
Copy link

vercel bot commented Dec 9, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 11:43am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 11:43am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 11:43am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 11:43am

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2024

🦋 Changeset detected

Latest commit: f69d1aa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
thirdweb Minor

Not sure what this means? Click here to learn what changesets are.

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 9, 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 packages SDK Involves changes to the thirdweb SDK labels Dec 9, 2024
Copy link
Contributor Author

kien-ngo commented Dec 9, 2024

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

@codecov
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 81.36646% with 30 lines in your changes missing coverage. Please review.

Project coverage is 50.72%. Comparing base (f680496) to head (f69d1aa).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/thirdweb/src/react/web/ui/prebuilt/NFT/media.tsx 76.92% 12 Missing ⚠️
...dweb/src/react/web/ui/prebuilt/NFT/description.tsx 76.92% 9 Missing ⚠️
...es/thirdweb/src/react/web/ui/prebuilt/NFT/name.tsx 77.50% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5655      +/-   ##
==========================================
+ Coverage   50.64%   50.72%   +0.07%     
==========================================
  Files        1091     1092       +1     
  Lines       57098    57213     +115     
  Branches     4591     4630      +39     
==========================================
+ Hits        28916    29019     +103     
- Misses      27466    27478      +12     
  Partials      716      716              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from f680496
packages 47.20% <81.36%> (+0.10%) ⬆️

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

Files with missing lines Coverage Δ
...es/thirdweb/src/react/web/ui/prebuilt/NFT/utils.ts 100.00% <100.00%> (ø)
...dweb/src/react/web/ui/prebuilt/NFT/description.tsx 77.35% <76.92%> (ø)
...es/thirdweb/src/react/web/ui/prebuilt/NFT/name.tsx 77.35% <77.50%> (+5.92%) ⬆️
...s/thirdweb/src/react/web/ui/prebuilt/NFT/media.tsx 70.00% <76.92%> (+12.42%) ⬆️

... and 1 file with indirect coverage changes

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 41.13 KB (0%) 823 ms (0%) 951 ms (+13.19% 🔺) 1.8 s
thirdweb (cjs) 104.48 KB (0%) 2.1 s (0%) 2 s (-1.76% 🔽) 4.1 s
thirdweb (minimal + tree-shaking) 4.37 KB (0%) 88 ms (0%) 172 ms (+107.27% 🔺) 259 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 43 ms (-36% 🔽) 53 ms
thirdweb/react (minimal + tree-shaking) 16.99 KB (0%) 340 ms (0%) 674 ms (+16.74% 🔺) 1.1 s

Copy link
Contributor Author

kien-ngo commented Dec 9, 2024

CNCT-2584

@kien-ngo kien-ngo force-pushed the kien/nft-components-resolver-fn branch from dcb17ba to 67d0972 Compare December 9, 2024 10:56
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 9, 2024

Merge activity

CNCT-2584

- add custom resolver methods
- add better test coverage
- add caching for the getNFT method
- small fix: handling falsy values

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the NFT components in the `thirdweb` library by improving functionality, performance, and test coverage. It introduces custom resolver methods and caching mechanisms, along with fixes for handling falsy values.

### Detailed summary
- Added custom resolver methods to `NFTMedia`, `NFTName`, and `NFTDescription`.
- Implemented caching for the NFT info getter to improve performance.
- Fixed handling of falsy values for NFT media `src`, `name`, and `description`.
- Enhanced test coverage by extracting internal logic for testing.

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

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants