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: use react-inline-svg-unique-id plugin for fix svg id issue in runtime #616

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

yutingzhao1991
Copy link
Collaborator

close #581

Copy link

changeset-bot bot commented Mar 8, 2024

🦋 Changeset detected

Latest commit: 8178ec8

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

This PR includes changesets to release 5 packages
Name Type
@ant-design/web3-icons Patch
@ant-design/web3 Patch
@ant-design/web3-assets Patch
@ant-design/web3-solana Patch
@ant-design/web3-wagmi 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

vercel bot commented Mar 8, 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 Mar 8, 2024 6:28am

Copy link

github-actions bot commented Mar 8, 2024

@yutingzhao1991
Copy link
Collaborator Author

之前的 id 避免重复的方案是构建时加前缀,但是同一个文件的前缀是一样的,所以当一个 icon 多次使用的时候 id 还是会有问题。通过 https://github.com/laleksiunas/inline-svg-unique-id 插件改为运行时修改,每次的 id 都不一样,就不会有这个问题了。

@yutingzhao1991
Copy link
Collaborator Author

更多讨论可以参考 svg/svgo#674 这个 issue

@jeasonstudio
Copy link
Collaborator

@jeasonstudio
Copy link
Collaborator

vitest 配置还是用的 svgo,看看需不需要也改一下:
https://github.com/ant-design/ant-design-web3/blob/main/vitest.config.mts#L13

Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (2602aca) to head (8178ec8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #616   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          649       649           
  Lines        17430     17430           
  Branches      1054      1055    +1     
=========================================
  Hits         17430     17430           

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

@yutingzhao1991
Copy link
Collaborator Author

文档也应配套修改下:https://preview-616-ant-design-web3.surge.sh/guide/contribute-icons-cn#%E6%B7%BB%E5%8A%A0%E5%9B%BE%E6%A0%87-svg

直接去掉了,现在应该 id 可以随便搞了

@yutingzhao1991
Copy link
Collaborator Author

vitest 配置还是用的 svgo,看看需不需要也改一下: https://github.com/ant-design/ant-design-web3/blob/main/vitest.config.mts#L13

vitest 上我试了下用这个插件,好像没啥用,不知道是不是和 vitest 构建的逻辑不兼容,现在测试和构建用的不是一套基础构建方案,不太好保持一致。

@yutingzhao1991
Copy link
Collaborator Author

image

CI 又出现这个问题了

@yutingzhao1991
Copy link
Collaborator Author

image CI 又出现这个问题了

仔细看了下,好像这个只是错误日志,并不是 CI 挂了的原因。

image

@thinkasany
Copy link
Collaborator

image CI 又出现这个问题了

仔细看了下,好像这个只是错误日志,并不是 CI 挂了的原因。

image

最近看到好多次这个ci挂的都是因为这个,但是我本地跑的时候都是过的。
image

image

image

@jeasonstudio
Copy link
Collaborator

这个 ci 错误是一个深层依赖导致的,而且偶发,我尝试解决一下:

wagmi 2.5.7
└─┬ @wagmi/connectors 4.1.14
  └── @coinbase/wallet-sdk 3.9.1

@yutingzhao1991
Copy link
Collaborator Author

这个 ci 错误是一个深层依赖导致的,而且偶发,我尝试解决一下:

wagmi 2.5.7
└─┬ @wagmi/connectors 4.1.14
  └── @coinbase/wallet-sdk 3.9.1

感觉把 coinbase 这个 mock 下应该能行

@yutingzhao1991 yutingzhao1991 merged commit 0958090 into main Mar 8, 2024
12 checks passed
@yutingzhao1991 yutingzhao1991 deleted the fix/icon branch March 8, 2024 09:26
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.

ConnectModal SVG Icons show incorrectly
4 participants