Repository navigation
Commit 9fa4963
committed
fix(compiler): track const/let function-expression hooks in Strong setup graph
autoMemoModuleFunctionDeclarations only collected FunctionDeclaration
nodes, so a same-module `const useTheme = () => useContext(...)` was
never entered into the setup-hook dependency graph.
autoMemoCallExecutesSetupHook then returned false for calls to such
hooks, letting Strong mode cache/project the result and freeze the
underlying context, state, or effect value.
Extend the collection to VariableDeclaration statements whose
declarators have ArrowFunctionExpression or FunctionExpression
initializers, storing the function node so the existing walk logic
correctly descends into its body while still skipping nested functions.1 parent 7a8ab83 commit 9fa4963
3 files changed
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4280 | 4280 | | |
4281 | 4281 | | |
4282 | 4282 | | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
| 4286 | + | |
| 4287 | + | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
| 4291 | + | |
| 4292 | + | |
4283 | 4293 | | |
4284 | 4294 | | |
4285 | 4295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
267 | 285 | | |
268 | 286 | | |
269 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
687 | 688 | | |
688 | 689 | | |
689 | 690 | | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
690 | 705 | | |
691 | 706 | | |
692 | 707 | | |
| |||
0 commit comments