Skip to content

Commit 9ab43db

Browse files
committed
Tweak wording of cell update logic
1 parent 4ec6d4c commit 9ab43db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

turbopack/crates/turbo-tasks/src/vc/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ Transparent wrapper types that use [`#[turbo_tasks::value(transparent)]`][value-
4141

4242
Every time a task runs, its cells are re-constructed.
4343

44-
When `.cell()` or `Vc::cell` is called, the value is compared to the previous execution's using `PartialEq`. If it differs, the cell is updated, and all dependent tasks are invalidated. This behavior [can be overridden to always invalidate using the `cell = "new"` argument][value-macro].
44+
When `.cell()` or `Vc::cell` is called, the cell counter for the `ValueTypeId` is incremented, and the value is compared to the previous execution's using `PartialEq`. If the value with that index differs, the cell is updated, and all dependent tasks are invalidated.
45+
46+
The compare-then-update behavior [can be overridden to always update and invalidate using the `cell = "new"` argument][value-macro].
4547

4648
Because cells are keyed by a combination of their type and construction order, **task functions should have a deterministic execution order**. A function with inconsistent ordering may result in wasted work by invalidating additional cells, though it will still give correct results.
4749

0 commit comments

Comments
 (0)