voidzero-dev / voidzero-dev/vite-task

Define precise disableCache trigger points for uncacheable operations

オープン
#482 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Rust
スター
466
フォーク
42
平均マージ
1日 15時間
マージ済み PR(30日)
19

説明

Problem

disableCache() currently has an imprecise contract in practice. Tool integrations can call it while configuring a server because the configuration may later lead to an uncacheable operation. That is too early.

The observed failure mode is Vite/Vitest: a task can create a Vite server for transforms or test execution without actually listening on a port or watching the filesystem. If disableCache() fires during server/config setup, cacheable tasks such as vitest run are reported as Not cached: the task opted out of caching even though no uncacheable operation happened.

Principle

disableCache() should be called immediately before the concrete operation that makes the task uncacheable, not when reading configuration that might eventually lead to such an operation.

Concrete examples:

  • Listening on a port should disable caching immediately before the listen/bind operation.
  • Observing the filesystem should disable caching immediately before the watcher starts observing paths.
  • Creating/configuring an object that might later listen or watch should not disable caching by itself.

Temporary workaround

PR #481 makes vite_task_client::Client::disable_cache() a no-op so false opt-outs stop affecting downstream task caching while the real fix is designed and shipped.

Real solution

Move the Vite/Vitest integration points to operation boundaries:

  • In Vite, call disableCache() from the HTTP server start/listen path immediately before binding a port.
  • In Vite, call disableCache() from the watcher start path immediately before filesystem observation begins.
  • Do not call disableCache() from generic server creation/config resolution paths.
  • Verify Vitest run without watch/API does not listen or watch and therefore remains cacheable.
  • Verify Vitest API/server mode and watch mode still opt out because they perform uncacheable operations.

After those semantics are implemented and covered, revert the vite-task client no-op workaround and restore disableCache() as an effective client request.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Vite HTTP サーバーの start/listen パス、watcher の start パス、汎用的なサーバー作成/設定パス、および vite_task_client::Client::disable_cache() を追跡します。cacheable Vitest run モードが listening も watching も行わないことを確認し、API/server および watch モードがそれぞれの操作境界でオプトアウトすることを確認します。セマンティクスを確認したら、PR #481 の no-op workaround を元に戻し、有効な client request を復元します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, rust
領域
build-system, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
52/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。