Repository navigation
Commit 53af2cb
committed
fix(hydration): avoid template parse for pre-wrapped octane-frag arms during adoption
The compiler emits HTML multi-root @if/@switch arms pre-wrapped in
<octane-frag> with frag=0. During hydration, claimRoots called
templateRootCount which fell through to resolveLazyTemplate for these
templates (frag was 0), forcing a template parse on the first adoption
of every such arm — the exact work the lazy-template path was designed
to avoid.
Encode the root count as a negative frag value for pre-wrapped
templates so templateRootCount can read the count directly (absolute
value) without parsing. Adjust parseTemplate and
lazyFragmentRootMatches to use frag > 0 so negative values correctly
skip the raw-fragment wrapping and root-descriptor paths.1 parent 1e969db commit 53af2cb
2 files changed
Lines changed: 12 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26382 | 26382 | | |
26383 | 26383 | | |
26384 | 26384 | | |
26385 | | - | |
| 26385 | + | |
| 26386 | + | |
| 26387 | + | |
| 26388 | + | |
26386 | 26389 | | |
26387 | 26390 | | |
26388 | 26391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18388 | 18388 | | |
18389 | 18389 | | |
18390 | 18390 | | |
18391 | | - | |
| 18391 | + | |
| 18392 | + | |
| 18393 | + | |
18392 | 18394 | | |
18393 | 18395 | | |
18394 | 18396 | | |
| |||
18434 | 18436 | | |
18435 | 18437 | | |
18436 | 18438 | | |
18437 | | - | |
| 18439 | + | |
18438 | 18440 | | |
18439 | 18441 | | |
18440 | 18442 | | |
| |||
18510 | 18512 | | |
18511 | 18513 | | |
18512 | 18514 | | |
18513 | | - | |
18514 | | - | |
| 18515 | + | |
| 18516 | + | |
18515 | 18517 | | |
18516 | 18518 | | |
18517 | 18519 | | |
18518 | 18520 | | |
18519 | 18521 | | |
18520 | | - | |
| 18522 | + | |
18521 | 18523 | | |
18522 | 18524 | | |
18523 | 18525 | | |
| |||
18554 | 18556 | | |
18555 | 18557 | | |
18556 | 18558 | | |
18557 | | - | |
| 18559 | + | |
18558 | 18560 | | |
18559 | 18561 | | |
18560 | 18562 | | |
| |||
0 commit comments