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

fix: set sideEffects false for enable treeshaking #879

Merged
merged 3 commits into from
May 15, 2024
Merged

Conversation

yutingzhao1991
Copy link
Collaborator

💡 Background and solution

除了 web3-icons 以外,其它包也都需要支持 treeshaking

🔗 Related issue link

#858

Copy link

vercel bot commented May 15, 2024

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

Name Status Preview Comments Updated (UTC)
ant-design-web3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 7:16am

Copy link

changeset-bot bot commented May 15, 2024

🦋 Changeset detected

Latest commit: 4655cf8

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

This PR includes changesets to release 10 packages
Name Type
@ant-design/web3-bitcoin Patch
@ant-design/web3-assets Patch
@ant-design/web3-common Patch
@ant-design/web3-ethers Patch
@ant-design/web3-ethers-v5 Patch
@ant-design/web3-solana Patch
@ant-design/web3-wagmi Patch
@ant-design/web3 Patch
@example/ethers-v5 Patch
@example/ethers Patch

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

Copy link

github-actions bot commented May 15, 2024

Preview is ready

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (823f46e) to head (4655cf8).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #879   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          707       707           
  Lines        21365     21365           
  Branches      1198      1198           
=========================================
  Hits         21365     21365           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kiner-tang kiner-tang left a comment

Choose a reason for hiding this comment

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

有没有试一下添加 sideEffect 后,打包出来的产物提交小了多少呀,我们这边没有加 size-limit 的 action 没有太直观的感受。可以把本地打包产物的体积截个图放到 pr 上

@gin-lsl
Copy link
Collaborator

gin-lsl commented May 15, 2024

是不是整个 beta 包,然后测试一下

@jeasonstudio
Copy link
Collaborator

有没有试一下添加 sideEffect 后,打包出来的产物提交小了多少呀,我们这边没有加 size-limit 的 action 没有太直观的感受。可以把本地打包产物的体积截个图放到 pr 上

标注 sideEffect false 后对我们自己 lib 的产物不会有影响,对于项目的影响也取决于项目使用了多少组件以及对应的 bundler 是否支持 tree-shaking;
我觉得只要验证最小可行即可,比如上个 PR 对 icon 包加了配置后,是否能够在项目中把未用到的 icons 给 shaking 掉。cc @gin-lsl

@jeasonstudio jeasonstudio merged commit 02e74aa into main May 15, 2024
12 checks passed
@jeasonstudio jeasonstudio deleted the fix/sideEffects branch May 15, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants