Skip to content

Commit dca0482

Browse files
branchseerclaude
andauthored
fix: disable cache for synthetic dev/preview commands (#588)
Update SyntheticPlanRequest to use new cache_config field from vite-task. Synthetic dev and preview commands now explicitly use UserCacheConfig::disabled() so they are never cached, even when cacheScripts is enabled. - Bump vite-task to 9338d15d (adds cache_config to SyntheticPlanRequest) - Use UserCacheConfig::with_config/disabled helpers for all subcommands - Add rustc-hash dep for FxHashMap compatibility with vite-task - Add snap tests validating cache disabled behavior for synthetic commands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 152f783 commit dca0482

21 files changed

Lines changed: 219 additions & 90 deletions

File tree

Cargo.lock

Lines changed: 21 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ dunce = "1.0.5"
6868
fast-glob = "1.0.0"
6969
flate2 = { version = "=1.1.5", features = ["zlib-rs"] }
7070
form_urlencoded = "1.2.1"
71-
fspy = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "6e3aa68cef28ba447647e98874ad56df2c612ad3" }
71+
fspy = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
7272
futures = "0.3.31"
7373
futures-util = "0.3.31"
7474
glob = "0.3.2"
@@ -155,14 +155,14 @@ vfs = "0.12.1"
155155
vite_command = { path = "crates/vite_command" }
156156
vite_error = { path = "crates/vite_error" }
157157
vite_js_runtime = { path = "crates/vite_js_runtime" }
158-
vite_glob = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "6e3aa68cef28ba447647e98874ad56df2c612ad3" }
158+
vite_glob = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
159159
vite_install = { path = "crates/vite_install" }
160160
vite_migration = { path = "crates/vite_migration" }
161161
vite_shared = { path = "crates/vite_shared" }
162-
vite_path = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "6e3aa68cef28ba447647e98874ad56df2c612ad3" }
163-
vite_str = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "6e3aa68cef28ba447647e98874ad56df2c612ad3" }
164-
vite_task = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "6e3aa68cef28ba447647e98874ad56df2c612ad3" }
165-
vite_workspace = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "6e3aa68cef28ba447647e98874ad56df2c612ad3" }
162+
vite_path = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
163+
vite_str = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
164+
vite_task = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
165+
vite_workspace = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
166166
walkdir = "2.5.0"
167167
wax = "0.6.0"
168168
which = "8.0.0"

bench/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2024"
77
anyhow = { workspace = true }
88
async-trait = { workspace = true }
99
criterion = { workspace = true }
10+
rustc-hash = { workspace = true }
1011
tokio = { workspace = true, features = ["rt"] }
1112
vite_path = { workspace = true }
1213
vite_task = { workspace = true }

bench/benches/workspace_load.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use std::{collections::HashMap, ffi::OsStr, hint::black_box, path::PathBuf, sync::Arc};
1+
use std::{ffi::OsStr, hint::black_box, path::PathBuf, sync::Arc};
22

33
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
4+
use rustc_hash::FxHashMap;
45
use tokio::runtime::Runtime;
56
use vite_path::{AbsolutePath, AbsolutePathBuf};
67
use vite_task::{
@@ -67,7 +68,7 @@ fn bench_workspace_load(c: &mut Criterion) {
6768
b.iter(|| {
6869
runtime.block_on(async {
6970
let mut owned_callbacks = BenchSessionCallbacks::default();
70-
let envs: HashMap<Arc<OsStr>, Arc<OsStr>> = HashMap::new();
71+
let envs: FxHashMap<Arc<OsStr>, Arc<OsStr>> = FxHashMap::default();
7172
let mut session = Session::init_with(
7273
envs,
7374
fixture_path.clone().into(),
@@ -85,7 +86,7 @@ fn bench_workspace_load(c: &mut Criterion) {
8586
b.iter(|| {
8687
runtime.block_on(async {
8788
let mut owned_callbacks = BenchSessionCallbacks::default();
88-
let envs: HashMap<Arc<OsStr>, Arc<OsStr>> = HashMap::new();
89+
let envs: FxHashMap<Arc<OsStr>, Arc<OsStr>> = FxHashMap::default();
8990
let mut session =
9091
Session::init_with(envs, path.clone().into(), owned_callbacks.as_callbacks())
9192
.expect("Failed to create session");

packages/cli/binding/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ rolldown = ["dep:rolldown_binding"]
1414
anyhow = { workspace = true }
1515
async-trait = { workspace = true }
1616
clap = { workspace = true, features = ["derive"] }
17+
rustc-hash = { workspace = true }
1718
napi = { workspace = true }
1819
napi-derive = { workspace = true }
1920
serde = { workspace = true, features = ["derive"] }

0 commit comments

Comments
 (0)