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

feat(frontend): tabler-iconsのサブセット化 #15340

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

kakkokari-gtyih
Copy link
Contributor

@kakkokari-gtyih kakkokari-gtyih commented Jan 25, 2025

What

  • 本番ビルド時にfrontend/frontend-embedそれぞれのti-*クラスを抜き出し、使用されていないアイコンを除いたフォントを生成するように
  • 開発モードではtabler-iconsがそのまま使用される

Why

クライアント読み込みの高速化

フォントファイル

  • frontend: 869kB → 56kB (93%削減)
  • frontend-embed: 869kB → 6kB (99.4%削減)

CSS

  • frontend: 241kB → 11.1kB (95%削減)
  • frontend-embed: 241kB → 1.5kB (99.3%削減)

Additional info (optional)

  • tabler-iconsのフォントファイルの形式が不正なためtablerのをそのまま使うと正常にビルドできなかったので暫定的に自前のものを使用しています。
  • 現時点では無かったので特に問題ありませんが、ti-${someVar} のようにアイコン名部分だけを動的に変化させるような書き方をするとアイコンが表示できなくなります(CONTRIBUTING.mdに追記済み)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/frontend Client side specific issue/PR label Jan 25, 2025
Copy link

codecov bot commented Jan 25, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 18.83%. Comparing base (a3d236c) to head (4f765b0).
Report is 560 commits behind head on develop.

Files with missing lines Patch % Lines
packages/frontend/src/_boot_.ts 0.00% 5 Missing ⚠️
...ackages/frontend/src/components/MkDrive.folder.vue 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #15340       +/-   ##
============================================
- Coverage    41.74%   18.83%   -22.92%     
============================================
  Files         1549      764      -785     
  Lines       196555   111029    -85526     
  Branches      2767     1233     -1534     
============================================
- Hits         82055    20907    -61148     
+ Misses      113939    89535    -24404     
- Partials       561      587       +26     

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

@kakkokari-gtyih kakkokari-gtyih marked this pull request as ready for review January 25, 2025 07:50
@kakkokari-gtyih
Copy link
Contributor Author

ready

@kakkokari-gtyih
Copy link
Contributor Author

※フォールバックが必要ないならcss自体も要らないクラスを削除できるため更に小さくできる

やるか

@kakkokari-gtyih
Copy link
Contributor Author

やった

フォントファイル

  • frontend: 869kB → 56kB (93%削減)
  • frontend-embed: 869kB → 6kB (99.4%削減)

CSS

  • frontend: 241kB → 11.1kB (95%削減)
  • frontend-embed: 241kB → 1.5kB (99.3%削減)

@kakkokari-gtyih
Copy link
Contributor Author

コンフリクト解消

@kakkokari-gtyih kakkokari-gtyih added this to the v2025.2.1 milestone Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/frontend Client side specific issue/PR
Projects
Development

Successfully merging this pull request may close these issues.

1 participant