CSS Modules classes are compiled as dynamic/reactive variables rather than static strings (Optimization)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- typescript, vite
調査の方向性
まず Solid Babel plugin と Vite CSS Modules の処理順序を追跡します。issue では比較対象として custom Vite plugin が提供されています。処理順序の変更をこのリポジトリと Vite のどちらに実装すべきかを判断し、CSS Module class strings が workaround なしで静的かつ非リアクティブな DOM テキストとしてコンパイルされることを完了条件とします。
索引モデルが issue の本文から書いたものです。
説明
@ryansolid Just following up on the issue we discussed during your Friday stream.
CSS Module classes are substituted for static strings by Vite AFTER the Solid babel plugin runs, so the CSS class strings are not compiled into static text directly in the DOM strings. This has a considerable performance effect because it breaks up long strings that would otherwise be inserted into the DOM at once statically.
This can be alleviated slightly with a custom Vite plugin like this one, which adds @once to at least compile these without reactivity:
{
name: 'vite-plugin-optimize-solid-css-modules',
enforce: 'pre',
transform: {
handler: code => ({
code: code.replace(/class=\{([a-zA-Z '"`[\].-]+|(?:`(?:\$\{[a-zA-Z '"`[\].-]+\}\s*)+)`)\}/g, 'class={/*@once*/$1}'),
map: null,
}),
filter: { id: /\.[mc]?[jt]sx$/ },
},
}
But without a modification to the order that CSS modules are processed, getting CSS modules to match the performance of plain CSS won’t be possible. I’ve taken a stab at fixing it myself, but the fix may need to be contributed to Vite. Needs some further investigation.
- 主要言語
- TypeScript
- スター
- 522
- フォーク
- 72
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid-vite-plugin のほかの issue
-
Test environment detection doesn't consider Vitest workspaces対応中かも @carloitaben が 43 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
solidjs/solid-vite-plugin#205 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
solidjs/solid-vite-plugin#394 ·
メンテナーはふだん 1 日以内に返信
-
Catch-all route chunks are named `_...404_-<hash>.js`; the `..` trips path-traversal guards and breaks the lazy preload対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
solidjs/solid-vite-plugin#391 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
solidjs/solid-vite-plugin#390 ·
メンテナーはふだん 1 日以内に返信
-
Start mode: generated entries render without the CSP nonce, and there is no per-request seam to supply one対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
solidjs/solid-vite-plugin#388 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
solidjs/solid-vite-plugin の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug:new
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
callstackincubator/simlock#350 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openwatersio/maritime-zones#33 ·
メンテナーはふだん 1 日以内に返信
-
Booking email verification fails for plus aliases with impersonation protection enabled対応中かも @kankadev が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
calcom/cal.diy#30293 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AOSSIE-Org/DebateAI#611 ·
メンテナーはふだん 3 日以内に返信