Commit 9b0277f
authored
Turbopack: Pass asset_suffix_path as Vc (#89899)
## Summary
- Pass `asset_suffix_path` as `Vc<Option<RcStr>>` instead of eagerly resolving it to `Option<RcStr>` in the chunking context option structs
- Add filesystem cache size growth assertions to e2e tests to detect unbounded cache growth regressions
## Why
Previously, `css_url_suffix` was eagerly awaited in `project.rs` before being passed into `ClientChunkingContextOptions`, `ServerChunkingContextOptions`, and `EdgeChunkingContextOptions`. This caused a new chunking context `Vc` to be created for every build, duplicating the entire build in cache and recompiling it.
By keeping it as a `Vc`, the chunking context identity is stable across builds, preventing unnecessary cache duplication.
## How
- Changed `css_url_suffix` field from `Option<RcStr>` to `Vc<Option<RcStr>>` in all three chunking context option structs
- Removed `.owned().await?.clone()` in `project.rs` (3 call sites), passing the `Vc` directly
- Added `.owned().await?` at the point of use in the 5 context builder functions
- Added cache size measurements to `filesystem-cache.test.ts`: normal changes limited to 10% growth, renames allow up to 50% due to dead cache entries1 parent 6627734 commit 9b0277f
File tree
5 files changed
+78
-23
lines changed- crates
- next-api/src
- next-core/src
- next_client
- next_edge
- next_server
- test/e2e/filesystem-cache
5 files changed
+78
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
| 1443 | + | |
1449 | 1444 | | |
1450 | 1445 | | |
1451 | 1446 | | |
| |||
1474 | 1469 | | |
1475 | 1470 | | |
1476 | 1471 | | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
| 1472 | + | |
1483 | 1473 | | |
1484 | 1474 | | |
1485 | 1475 | | |
| |||
1513 | 1503 | | |
1514 | 1504 | | |
1515 | 1505 | | |
1516 | | - | |
1517 | | - | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
| 1506 | + | |
1522 | 1507 | | |
1523 | 1508 | | |
1524 | 1509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
452 | | - | |
| 452 | + | |
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| 478 | + | |
478 | 479 | | |
479 | 480 | | |
480 | 481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| |||
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
| 330 | + | |
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1035 | 1035 | | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | | - | |
| 1038 | + | |
1039 | 1039 | | |
1040 | 1040 | | |
1041 | 1041 | | |
| |||
1062 | 1062 | | |
1063 | 1063 | | |
1064 | 1064 | | |
| 1065 | + | |
1065 | 1066 | | |
1066 | 1067 | | |
1067 | 1068 | | |
| |||
1159 | 1160 | | |
1160 | 1161 | | |
1161 | 1162 | | |
| 1163 | + | |
1162 | 1164 | | |
1163 | 1165 | | |
1164 | 1166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
4 | 27 | | |
5 | 28 | | |
6 | 29 | | |
| |||
46 | 69 | | |
47 | 70 | | |
48 | 71 | | |
49 | | - | |
| 72 | + | |
50 | 73 | | |
| 74 | + | |
51 | 75 | | |
| 76 | + | |
52 | 77 | | |
53 | 78 | | |
54 | 79 | | |
| |||
66 | 91 | | |
67 | 92 | | |
68 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
69 | 100 | | |
70 | 101 | | |
71 | 102 | | |
| |||
95 | 126 | | |
96 | 127 | | |
97 | 128 | | |
98 | | - | |
| 129 | + | |
99 | 130 | | |
100 | 131 | | |
101 | 132 | | |
| |||
141 | 172 | | |
142 | 173 | | |
143 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
144 | 187 | | |
145 | 188 | | |
146 | 189 | | |
| |||
171 | 214 | | |
172 | 215 | | |
173 | 216 | | |
| 217 | + | |
174 | 218 | | |
175 | 219 | | |
176 | 220 | | |
| |||
199 | 243 | | |
200 | 244 | | |
201 | 245 | | |
| 246 | + | |
202 | 247 | | |
203 | 248 | | |
204 | 249 | | |
| |||
265 | 310 | | |
266 | 311 | | |
267 | 312 | | |
| 313 | + | |
268 | 314 | | |
269 | 315 | | |
270 | 316 | | |
271 | 317 | | |
272 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
273 | 322 | | |
274 | 323 | | |
275 | 324 | | |
| |||
294 | 343 | | |
295 | 344 | | |
296 | 345 | | |
| 346 | + | |
297 | 347 | | |
298 | 348 | | |
299 | 349 | | |
| |||
313 | 363 | | |
314 | 364 | | |
315 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
316 | 381 | | |
317 | 382 | | |
318 | 383 | | |
| |||
0 commit comments