Skip to content

build: Vite 8 & Lightning CSS#5090

Draft
uni-kakurenbo wants to merge 1 commit into
masterfrom
deps/vite-v8
Draft

build: Vite 8 & Lightning CSS#5090
uni-kakurenbo wants to merge 1 commit into
masterfrom
deps/vite-v8

Conversation

@uni-kakurenbo
Copy link
Copy Markdown
Contributor

@uni-kakurenbo uni-kakurenbo commented Mar 24, 2026

概要

  • vite-plugin-pwa の Vite 8 対応を待つ必要がある
  • targets が blowserslist のデフォルトから Vite のデフォルト (baseline-widely-available) になっていることに注意

Summary by CodeRabbit

リリースノート

  • Chores

    • ビルドツールチェーンを最適化し、CSS圧縮パイプラインを改善しました。
    • 開発用依存関係を更新し、Viteを8.0.1にアップグレードしました。
    • Sass コンパイラAPIを最新版に切り替えました。
  • Refactor

    • オーディオプレイヤーおよびフォーム範囲スライダーコンポーネントのスタイリングアーキテクチャを再構成しました。

@github-actions
Copy link
Copy Markdown

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 24, 2026

📝 Walkthrough

Walkthrough

CSSミニフィケーションパイプラインをesbuildからlightningcssに置き換え、viteを^7.3.1から^8.0.1にアップグレード、autoprefixerとesbuildプラグインを削除してlightningcssを追加。複数のVueコンポーネントでスタイルをモジュールスコープのグローバルブロックから専用の非モジュールスタイルブロックへリファクタリング。Vite設定からESBuildターゲットとPostCSS autoprefixerを削除し、SCSS compilerをモダンAPIに切り替え。

Changes

Cohort / File(s) Summary
ビルドツール設定
build/gen-mplus.js, package.json
esbuildからlightningcssへのCSS処理パイプライン置き換え。関連する依存関係を削除し、lightningcssを追加。ヘルパー関数downloadAndtransformdownloadAndTransformにリネーム。
Vite設定
vite.config.ts
ESBuildターゲット設定とPostCSS autoprefixerプラグインを削除。SCSS preprocessorオプションにapi: 'modern-compiler'を追加。lightningcssからの新しいヘルパーをインポートするが現在未使用。
Vueコンポーネント - スタイルリファクタリング
src/components/UI/AudioPlayer/AudioPlayerTimeSlider.vue, src/components/UI/AudioPlayer/AudioPlayerVolumeSlider.vue, src/components/UI/FormRangeWithValue.vue
ルート要素に新しいグローバルクラスを追加。vue-slider-componentテーマCSSの読み込みをCSS-modulスコープのグローバルブロックから、専用の非モジュール<style>ブロックに移行。テーマスタイルを新しいグローバルクラスセレクター配下に配置。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning リポジトリの PR テンプレートで要求されている複数の必須セクション(概要の詳細説明、PR 実施理由、動作確認手順、UI スクリーンショット、チェックリスト等)が不足しており、実装内容の追加同意確認や動作確認プロセスの記録がありません。 提供されたテンプレートに従い、具体的な「なぜこの PR を入れたいのか」の詳細説明、実施した動作確認手順、該当する場合は UI 変更のスクリーンショット、そして PR 出前チェックリストの完成を追加してください。
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed タイトルは主な変更内容(Vite v8 アップグレードと Lightning CSS の導入)を明確かつ簡潔に表現しており、ファイル変更リストや不要な装飾がなく、良好な状態です。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deps/vite-v8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/UI/FormRangeWithValue.vue (1)

3-12: ⚠️ Potential issue | 🟠 Major

form-range-slider クラスが DOM に到達しません。

ASlider コンポーネントは class 属性をルート要素にフォワードしません。関連コードスニペット(ASlider.vue)を確認すると、VueSlider を直接レンダリングしており、:class バインディングがありません。そのため、form-range-slider クラスは実際の DOM 要素に適用されず、テーマスタイルが機能しません。

他のファイル(AudioPlayerTimeSlider.vueAudioPlayerVolumeSlider.vue)では、クラスをラッパー <div> に適用しています。同様のパターンを使用してください。

🐛 修正案: ASlider をラッパー div で囲む
 <template>
   <div :class="$style.container">
-    <ASlider
-      v-model="modelValue"
-      :class="[$style.range, 'form-range-slider']"
-      :min="min"
-      :max="max"
-      :disabled="disabled"
-      :tooltip="'none'"
-      :interval="interval"
-      :style="{ padding: '24px 0' }"
-    />
+    <div :class="[$style.range, 'form-range-slider']">
+      <ASlider
+        v-model="modelValue"
+        :min="min"
+        :max="max"
+        :disabled="disabled"
+        :tooltip="'none'"
+        :interval="interval"
+        :style="{ padding: '24px 0' }"
+      />
+    </div>
     <SemiFixedSizeText

.range の CSS も確認し、flex: 1 1 が新しいラッパー div に正しく適用されることを確認してください。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/UI/FormRangeWithValue.vue` around lines 3 - 12, ASlider's
:class binding (including 'form-range-slider') isn't forwarded to the rendered
DOM because ASlider.vue renders VueSlider directly; wrap the ASlider usage in
FormRangeWithValue.vue with a wrapper element (e.g., a <div>) and move the
:class="[$style.range, 'form-range-slider']" and the inline style/padding onto
that wrapper so the class reaches the DOM (mimic
AudioPlayerTimeSlider.vue/AudioPlayerVolumeSlider.vue pattern), and verify the
.range CSS (flex: 1 1) still applies to the new wrapper.
🧹 Nitpick comments (4)
src/components/UI/AudioPlayer/AudioPlayerVolumeSlider.vue (1)

57-103: 未使用の @use 'sass:meta' が残っています。

:global() は CSS Modules の構文であり、Sass の meta モジュールとは関係ありません。meta.load-css が非モジュールスタイルに移動したため、このインポートは削除できます。

♻️ 修正案
 <style lang="scss" module>
-@use 'sass:meta';
-
 $afterVolumeSliderWidth: 48px;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/UI/AudioPlayer/AudioPlayerVolumeSlider.vue` around lines 57 -
103, Remove the unused Sass module import by deleting the line "@use
'sass:meta';" at the top of the stylesheet; ensure the rest of the rules (e.g.,
$afterVolumeSliderWidth, .volume, .volumeSlider,
:global(.vue-slider-dot-handle)) remain unchanged since :global() is a CSS
Modules construct and not dependent on the meta module.
src/components/UI/FormRangeWithValue.vue (1)

47-59: 未使用の @use 'sass:meta' が残っています。

meta.load-css が非モジュールスタイルブロックに移動したため、このインポートは不要です。

♻️ 修正案
 <style lang="scss" module>
-@use 'sass:meta';
-
 .container {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/UI/FormRangeWithValue.vue` around lines 47 - 59, Remove the
unused Sass module import by deleting the line "@use 'sass:meta';" from the
<style lang="scss" module> block in FormRangeWithValue.vue; the rest of the
.container and .range rules can remain unchanged since meta.load-css was moved
to non-module styles, so simply drop the `@use` declaration to eliminate the dead
import.
src/components/UI/AudioPlayer/AudioPlayerTimeSlider.vue (1)

48-67: 未使用の @use 'sass:meta' が残っています。

meta.load-css が非モジュールの <style> ブロックに移動したため、モジュールスタイル内の @use 'sass:meta' は不要になりました。

♻️ 修正案
 <style lang="scss" module>
-@use 'sass:meta';
-
 .timeSlider {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/UI/AudioPlayer/AudioPlayerTimeSlider.vue` around lines 48 -
67, Remove the unused Sass module import: delete the line "@use 'sass:meta';"
from the <style lang="scss" module> block in AudioPlayerTimeSlider.vue (the
block that defines .timeSlider and :global(.vue-slider-dot-handle)); confirm
there are no remaining references to meta.* in that file (e.g., meta.load-css)
and run the build/lint to ensure no other stylesheet usages remain.
vite.config.ts (1)

80-92: Lightning CSS の明示的な設定が不足している可能性があります。

PR の説明によると、ビルドターゲットが従来の Browserslist デフォルトから Vite のデフォルト (baseline-widely-available) に変わります。もしカスタムターゲットが必要な場合は、css.lightningcss の設定を追加することを検討してください。

Vite 8 のデフォルト動作で問題なければ、現状の設定で十分です。

css: {
  // Lightning CSS のターゲットを明示的に設定する場合:
  // lightningcss: {
  //   targets: browserslistToTargets(browserslist('your query here'))
  // },
  preprocessorOptions: {
    // ...
  }
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@vite.config.ts` around lines 80 - 92, PR notes warn that Vite’s default build
target changed, so update the css configuration by adding a lightningcss entry
(under the existing css / preprocessorOptions block) when you need a custom
target: add css.lightningcss with a targets value produced via
browserslistToTargets(browserslist('...')) so Lightning CSS compiles to your
desired browsers; if you intentionally rely on Vite 8 defaults, no change is
required.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@build/gen-mplus.js`:
- Line 162: There is a typo: the identifier `ligtningcss` used when calling
`browserslistToTargets` is undefined; rename it to the correct `lightningcss`
everywhere it's used (e.g., the call that assigns `targets`) and ensure the
module import/require that provides `lightningcss` matches that identifier so
`lightningcss.browserslistToTargets(...)` resolves correctly.

In `@package.json`:
- Line 93: Update the Vite version constraint in package.json: change the "vite"
dependency from "^8.0.1" to the available release "^8.0.0" so the project
references the actual npm-published version (leave "lightningcss": "^1.32.0"
unchanged).

In `@vite.config.ts`:
- Around line 7-8: Remove the unused imports by deleting the import statements
for browserslist and browserslistToTargets (the symbols "browserslist" and
"browserslistToTargets") from vite.config.ts; ensure no other code in the file
references these symbols and run typecheck/linters to confirm no remaining
references before committing.

---

Outside diff comments:
In `@src/components/UI/FormRangeWithValue.vue`:
- Around line 3-12: ASlider's :class binding (including 'form-range-slider')
isn't forwarded to the rendered DOM because ASlider.vue renders VueSlider
directly; wrap the ASlider usage in FormRangeWithValue.vue with a wrapper
element (e.g., a <div>) and move the :class="[$style.range,
'form-range-slider']" and the inline style/padding onto that wrapper so the
class reaches the DOM (mimic
AudioPlayerTimeSlider.vue/AudioPlayerVolumeSlider.vue pattern), and verify the
.range CSS (flex: 1 1) still applies to the new wrapper.

---

Nitpick comments:
In `@src/components/UI/AudioPlayer/AudioPlayerTimeSlider.vue`:
- Around line 48-67: Remove the unused Sass module import: delete the line "@use
'sass:meta';" from the <style lang="scss" module> block in
AudioPlayerTimeSlider.vue (the block that defines .timeSlider and
:global(.vue-slider-dot-handle)); confirm there are no remaining references to
meta.* in that file (e.g., meta.load-css) and run the build/lint to ensure no
other stylesheet usages remain.

In `@src/components/UI/AudioPlayer/AudioPlayerVolumeSlider.vue`:
- Around line 57-103: Remove the unused Sass module import by deleting the line
"@use 'sass:meta';" at the top of the stylesheet; ensure the rest of the rules
(e.g., $afterVolumeSliderWidth, .volume, .volumeSlider,
:global(.vue-slider-dot-handle)) remain unchanged since :global() is a CSS
Modules construct and not dependent on the meta module.

In `@src/components/UI/FormRangeWithValue.vue`:
- Around line 47-59: Remove the unused Sass module import by deleting the line
"@use 'sass:meta';" from the <style lang="scss" module> block in
FormRangeWithValue.vue; the rest of the .container and .range rules can remain
unchanged since meta.load-css was moved to non-module styles, so simply drop the
`@use` declaration to eliminate the dead import.

In `@vite.config.ts`:
- Around line 80-92: PR notes warn that Vite’s default build target changed, so
update the css configuration by adding a lightningcss entry (under the existing
css / preprocessorOptions block) when you need a custom target: add
css.lightningcss with a targets value produced via
browserslistToTargets(browserslist('...')) so Lightning CSS compiles to your
desired browsers; if you intentionally rely on Vite 8 defaults, no change is
required.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 01873e07-2af8-4154-9647-627eda928a7e

📥 Commits

Reviewing files that changed from the base of the PR and between 86d1ed2 and 57f6940.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • build/gen-mplus.js
  • package.json
  • src/components/UI/AudioPlayer/AudioPlayerTimeSlider.vue
  • src/components/UI/AudioPlayer/AudioPlayerVolumeSlider.vue
  • src/components/UI/FormRangeWithValue.vue
  • vite.config.ts

Comment thread build/gen-mplus.js
const { code: minifiedCssText, warnings } = await esbuild.transform(cssText, {
loader: 'css',

const targets = ligtningcss.browserslistToTargets(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

重大なタイポ: ligtningcsslightningcss であるべきです。

ligtningcss は未定義のため、このスクリプト実行時に ReferenceError が発生します。

🐛 修正案
-  const targets = ligtningcss.browserslistToTargets(
+  const targets = lightningcss.browserslistToTargets(
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const targets = ligtningcss.browserslistToTargets(
const targets = lightningcss.browserslistToTargets(
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@build/gen-mplus.js` at line 162, There is a typo: the identifier
`ligtningcss` used when calling `browserslistToTargets` is undefined; rename it
to the correct `lightningcss` everywhere it's used (e.g., the call that assigns
`targets`) and ensure the module import/require that provides `lightningcss`
matches that identifier so `lightningcss.browserslistToTargets(...)` resolves
correctly.

Comment thread package.json
"fake-indexeddb": "^6.2.5",
"fonteditor-core": "^2.6.3",
"jsdom": "^27.4.0",
"lightningcss": "^1.32.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Vite 8.0 release date and changelog

💡 Result:

Vite 8.0.0 was released on March 12, 2026. Key highlights from the official announcement and changelog: - Replaces esbuild (dev) and Rollup (prod) with a single unified Rust-based bundler called Rolldown, providing up to 10-30x faster production builds while maintaining full Rollup/Vite plugin compatibility. - Uses Oxc for parsing, transforming, and minification, unifying the toolchain. - Updated default browser target (build.target): Chrome/Edge 107->111, Firefox 104->114, Safari 16.0->16.4 (aligns with baseline widely-available features as of 2026). - Built-in support for tsconfig paths (resolve.tsconfigPaths: true), warns if vite-tsconfig-paths plugin is used. - New Vite Devtools for debugging. - Node.js requirement unchanged: 20.19+ or 22.12+. - Install size increased by ~15MB (lightningcss now core dep, Rolldown binary). Breaking changes: - Removed import.meta.hot.accept resolution fallback. - build.rollupOptions renamed to build.rolldownOptions (deprecated, will be removed). - Dependency optimizer now uses Rolldown instead of esbuild. - Some plugin hooks changed (e.g., shouldTransformCachedModule, resolveImportMeta). Migration: Most projects upgrade directly with npm i vite@latest. For complex setups, use gradual path via rolldown-vite first. See official migration guide: https://vite.dev/guide/migration#migration-from-v7. Full changelog: https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md (8.0.0 section lists features like Rolldown updates to 1.0.0-rc.9, v2 native plugins enabled by default, etc.). Announcement blog: https://vite.dev/blog/announcing-vite8 GitHub release: https://github.com/vitejs/vite/releases/tag/v8.0.0

Citations:


🌐 Web query:

lightningcss 1.32.0 release date npm package

💡 Result:

The npm package lightningcss version 1.32.0 was published on March 9, 2026.

Citations:


🏁 Script executed:

# Check npm registry for Vite versions to confirm 8.0.1 exists
curl -s "https://registry.npmjs.org/vite" | jq '.versions | keys[] | select(startswith("8.0"))' 2>/dev/null | head -20

Repository: traPtitech/traQ_S-UI

Length of output: 365


🏁 Script executed:

# Check npm registry for lightningcss versions around 1.32.0
curl -s "https://registry.npmjs.org/lightningcss" | jq '.versions | keys[] | select(startswith("1.32"))' 2>/dev/null

Repository: traPtitech/traQ_S-UI

Length of output: 72


Vite のバージョン制約を修正してください。

package.json の Vite バージョンが ^8.0.1 となっていますが、npm レジストリに 8.0.1 リリースは存在しません。利用可能なバージョンは 8.0.0 です(2026年3月12日リリース)。^8.0.0 に修正してください。lightningcss ^1.32.0 は正しく、2026年3月9日にリリースされています。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 93, Update the Vite version constraint in package.json:
change the "vite" dependency from "^8.0.1" to the available release "^8.0.0" so
the project references the actual npm-published version (leave "lightningcss":
"^1.32.0" unchanged).

Comment thread vite.config.ts
Comment on lines 7 to +8
import browserslist from 'browserslist'
import { resolveToEsbuildTarget } from 'esbuild-plugin-browserslist'
import { browserslistToTargets } from 'lightningcss'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# vite.config.ts 内で browserslist と browserslistToTargets の使用箇所を検索
rg -n 'browserslist|browserslistToTargets' vite.config.ts | grep -v 'import'

Repository: traPtitech/traQ_S-UI

Length of output: 46


🏁 Script executed:

head -20 vite.config.ts

Repository: traPtitech/traQ_S-UI

Length of output: 749


未使用のインポートを削除してください

browserslistbrowserslistToTargets はインポートされていますが、ファイル内で使用されていません。

削除対象のインポート
-import browserslist from 'browserslist'
-import { browserslistToTargets } from 'lightningcss'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import browserslist from 'browserslist'
import { resolveToEsbuildTarget } from 'esbuild-plugin-browserslist'
import { browserslistToTargets } from 'lightningcss'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@vite.config.ts` around lines 7 - 8, Remove the unused imports by deleting the
import statements for browserslist and browserslistToTargets (the symbols
"browserslist" and "browserslistToTargets") from vite.config.ts; ensure no other
code in the file references these symbols and run typecheck/linters to confirm
no remaining references before committing.

@uni-kakurenbo uni-kakurenbo self-assigned this Mar 24, 2026
@uni-kakurenbo uni-kakurenbo added dependencies Pull requests that update a dependency file need discussion 実装すべきかどうか、どうやって実装するかを考える必要がある labels Mar 24, 2026
@uni-kakurenbo uni-kakurenbo moved this from Inbox to Need Discussion in traQ Client Mar 24, 2026
@uni-kakurenbo uni-kakurenbo changed the title build: Vite v8 & Lightning CSS build: Vite 8 & Lightning CSS Mar 24, 2026
@uni-kakurenbo uni-kakurenbo marked this pull request as draft March 24, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file need discussion 実装すべきかどうか、どうやって実装するかを考える必要がある

Projects

Status: Need Discussion

Development

Successfully merging this pull request may close these issues.

1 participant