Repository navigation
Commit 444e069
committed
fix: invalidate cross-module fact caches in Rspack loader and Vite watchChange
The Rspack loader's process-scoped fact cache was never cleared, so after a
defining module changed from stable to unstable the old proof persisted and
importers kept omitting live captures from inferred dependency arrays.
Similarly, the Vite plugin only invalidated facts in the hotUpdate hook
(dev server). In vite build --watch, watchChange fires instead of hotUpdate,
leaving the cache stale across rebuilds.
- Import and call invalidateFactCache in the Rspack loader on every run,
keyed to the current module, so rebuilds read fresh facts.
- Call invalidateFactCache from watchChange when crossModuleHookFacts is on,
matching the hotUpdate path for build-watch parity.
- Add the missing invalidateFactCache stub to the loader test mock.1 parent 188c8aa commit 444e069
3 files changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
343 | 344 | | |
344 | 345 | | |
345 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
0 commit comments