Commit 4f68951
fix(gxt-backend): compare _templateFn for route template identity
GXT's runtime template factory returns a fresh wrapper object on every
`templateFactory(owner)` invocation, and `buildRenderState` calls the
factory on each route render. The root-outlet re-render fast-path used
strict object identity (`lastRouteTemplate !== newTemplate`) to detect a
template swap, so even renders of the SAME route template were treated
as a swap and forced a full re-render (innerHTML = ''). That destroyed
DOM node identity across `/colors/red -> /colors/green` style transitions
and broke the "stable DOM when the model changes" invariant.
Compare the underlying `_templateFn` (the compiled function shared across
fresh wrappers) so two wrappers around the same template stay on the
in-place fast-path. Falls back to object identity for non-runtime
templates so the test-helpers fresh-compile case (different `_templateFn`)
still triggers a full re-render.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 03c4948 commit 4f68951
1 file changed
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1008 | 1008 | | |
1009 | 1009 | | |
1010 | 1010 | | |
1011 | | - | |
1012 | | - | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1013 | 1030 | | |
1014 | 1031 | | |
1015 | 1032 | | |
| |||
0 commit comments