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

Version Packages #5650

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Version Packages #5650

merged 1 commit into from
Dec 10, 2024

Conversation

jnsdls
Copy link
Member

@jnsdls jnsdls commented Dec 7, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

[email protected]

Minor Changes

  • #5533 43fbcac Thanks @kien-ngo! - The Connected-details button now shows USD value next to the token balance.

    Breaking change to the AccountBalance

    The formatFn props now takes in an object of type AccountBalanceInfo. The old formatFn was inflexible because it only allowed you to format the balance value.
    With this new version, you have access to both the balance and symbol.

    import { AccountBalance, type AccountBalanceInfo } from "thirdweb/react";
    
    <AccountBalance
      // Show the symbol in lowercase, before the balance
      formatFn={(props: AccountBalanceInfo) =>
        `${props.symbol.toLowerCase()} ${props.balance}`
      }
    />;

    AccountBalance now supports showing the token balance in fiat value (only USD supported at the moment)

    <AccountBalance showBalanceInFiat="USD" />

    The formatFn prop now takes in an object of type AccountBalanceInfo and outputs a string

    import { AccountBalance, type AccountBalanceInfo } from "thirdweb/react";
    
    <AccountBalance
      formatFn={(props: AccountBalanceInfo) =>
        `${props.balance}---${props.symbol.toLowerCase()}`
      }
    />;
    
    // Result: 11.12---eth

    ConnectButton also supports displaying balance in fiat since it uses AccountBalance internally

    <ConnectButton
      // Show USD value on the button
      detailsButton={{
        showBalanceInFiat: "USD",
      }}
      // Show USD value on the modal
      detailsModal={{
        showBalanceInFiat: "USD",
      }}
    />

    Export utils functions:

    formatNumber: Round up a number to a certain decimal place

    import { formatNumber } from "thirdweb/utils";
    const value = formatNumber(12.1214141, 1); // 12.1

    shortenLargeNumber: Shorten the string for large value. Mainly used for the AccountBalance's formatFn

    import { shortenLargeNumber } from "thirdweb/utils";
    const numStr = shortenLargeNumber(1_000_000_000);

    Fix to ConnectButton

    The social image of the Details button now display correctly for non-square image.

    Massive test coverage improvement for the Connected-button components

  • #5655 f69d1aa Thanks @kien-ngo! - Improve NFT Components

    • Add custom resolver methods to NFTMedia, NFTName and NFTDescription
    • Add caching for the NFT-info-getter method to improve performance
    • Small fix to handle falsy values for NFT media src, name and description
    • Improve test coverage by extracting internal logics and testing them

Patch Changes

@thirdweb-dev/[email protected]

Patch Changes


PR-Codex overview

This PR focuses on updating the version of thirdweb and @thirdweb-dev/service-utils, along with significant changes in their changelogs. It introduces new features, improvements, and fixes, particularly for the AccountBalance and ConnectButton components.

Detailed summary

  • Updated thirdweb version from 5.75.0 to 5.76.0.
  • Updated @thirdweb-dev/service-utils version from 0.4.51 to 0.4.52.
  • Added modelName, sessionId, requestId to usage in @thirdweb-dev/service-utils.
  • Enhanced AccountBalance component with new formatFn prop.
  • Introduced fiat value display in AccountBalance and ConnectButton.
  • Added utility functions: formatNumber and shortenLargeNumber.
  • Fixed social image display in ConnectButton.
  • Improved test coverage for Connected-button components.
  • Various bug fixes and improvements across components.

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

Copy link

graphite-app bot commented Dec 7, 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.

Copy link

vercel bot commented Dec 7, 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 10, 2024 2:29am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 2:29am
thirdweb-www ❌ Failed (Inspect) Dec 10, 2024 2:29am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 2:29am

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Dec 7, 2024
Copy link
Contributor

github-actions bot commented Dec 7, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 44.93 KB (0%) 899 ms (0%) 2.6 s (-14.7% 🔽) 3.5 s
thirdweb (cjs) 110.71 KB (0%) 2.3 s (0%) 4.9 s (-12.36% 🔽) 7.1 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 110 ms (-48.19% 🔽) 221 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 98 ms (+161.89% 🔺) 108 ms
thirdweb/react (minimal + tree-shaking) 19.01 KB (0%) 381 ms (0%) 296 ms (-60.18% 🔽) 676 ms

Copy link

codecov bot commented Dec 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.21%. Comparing base (d5a68c8) to head (7cb0141).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5650      +/-   ##
==========================================
- Coverage   51.22%   51.21%   -0.01%     
==========================================
  Files        1092     1092              
  Lines       57336    57336              
  Branches     4676     4674       -2     
==========================================
- Hits        29368    29364       -4     
- Misses      27252    27256       +4     
  Partials      716      716              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from d5a68c8
packages 47.82% <ø> (-0.01%) ⬇️

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

see 1 file with indirect coverage changes

@jnsdls jnsdls force-pushed the changeset-release/main branch from 4d42eb8 to d61d64c Compare December 7, 2024 02:42
@jnsdls jnsdls force-pushed the changeset-release/main branch from d61d64c to b30aecd Compare December 7, 2024 16:35
@jnsdls jnsdls force-pushed the changeset-release/main branch from b30aecd to 5c1c77c Compare December 9, 2024 09:10
@jnsdls jnsdls force-pushed the changeset-release/main branch from 5c1c77c to fd94e47 Compare December 9, 2024 09:20
@jnsdls jnsdls force-pushed the changeset-release/main branch from 3bbdf3c to 826ad2c Compare December 10, 2024 00:36
@jnsdls jnsdls force-pushed the changeset-release/main branch from 826ad2c to 2de0617 Compare December 10, 2024 01:06
@jnsdls jnsdls requested a review from arcoraven as a code owner December 10, 2024 01:06
@jnsdls jnsdls force-pushed the changeset-release/main branch from 2de0617 to ca68596 Compare December 10, 2024 01:29
@jnsdls jnsdls force-pushed the changeset-release/main branch from ca68596 to 2063842 Compare December 10, 2024 01:54
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.

2 participants