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 26 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 6 lines in your changes missing coverage. Please review.

Project coverage is 14.65%. Comparing base (616cccf) to head (73383ad).
Report is 1 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% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #15340       +/-   ##
============================================
- Coverage    44.15%   14.65%   -29.50%     
============================================
  Files         1613      771      -842     
  Lines       168364    68871    -99493     
  Branches      4137     1238     -2899     
============================================
- Hits         74340    10096    -64244     
+ Misses       93551    58355    -35196     
+ Partials       473      420       -53     

☔ 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
@kakkokari-gtyih kakkokari-gtyih removed this from the v2025.2.1 milestone Feb 23, 2025
@kakkokari-gtyih kakkokari-gtyih added this to the [DO NOT MERGE THESE YET] v2025.3.0~ milestone Feb 23, 2025
@kakkokari-gtyih
Copy link
Contributor Author

コンフリクト解消

@kakkokari-gtyih kakkokari-gtyih removed this from the [DO NOT MERGE THESE YET] milestone Mar 3, 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