Commit cb0ede4
fix(gxt-backend): refresh state.currentGetter on pool reuse so child each-rows see new args
When a parent component force-rerenders, its inner {{#each}} block builds a
fresh template subtree into a temp container that is later morphed onto the
live DOM. Each iteration claims a child component from the pool. The pool
match (by row identity or position) was correct, but the descriptor's
rcGet closure captured a getter from the FIRST createRenderContext call —
so `this.item` returned stale row data after the parent re-rendered.
Two fixes, both targeting the WeakMap state that survives descriptor
replacements:
1. updateInstanceWithNewArgs now updates state.currentGetter alongside
argGetters[key], so the rcGet closure's `g = state.currentGetter`
read sees the fresh per-row arg getter even when the descriptor lost
its __gxtRenderCtxArgGetter marker (e.g., via an upstream cellFor
reinstall) and createRenderContext's fast path is skipped.
2. createRenderContext's fast and slow paths both refresh state.currentGetter
(slow path was relying on the closure-captured `getter`, which is frozen
to the first install). The rcGet now reads `state.currentGetter || getter`
so the latest per-row getter wins.
Fixes 4 of the 7 remaining smoke failures:
- Components test: curly components / non-block with each rendering child components
- Syntax test: {{#each}} with native arrays / updating and setting within #each
- Syntax test: {{#each}} with emberA-wrapped arrays / updating and setting within #each
- Syntax test: {{#each}} with array proxies, * / updating and setting within #each (4 variants)
The remaining 3 failures (DOM node stability for stable keys when list
is updated) have a different root cause — morph-based fresh template
render doesn't preserve DOM identity for keyed each items — and are
left for a follow-up.
Smoke results: 330/333 (was 326/333). No regressions.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent e7dda3c commit cb0ede4
1 file changed
Lines changed: 50 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
201 | | - | |
| 204 | + | |
202 | 205 | | |
203 | 206 | | |
204 | 207 | | |
205 | 208 | | |
206 | 209 | | |
207 | 210 | | |
208 | | - | |
| 211 | + | |
209 | 212 | | |
210 | 213 | | |
211 | 214 | | |
| |||
2203 | 2206 | | |
2204 | 2207 | | |
2205 | 2208 | | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
2206 | 2225 | | |
2207 | 2226 | | |
2208 | 2227 | | |
| |||
5316 | 5335 | | |
5317 | 5336 | | |
5318 | 5337 | | |
| 5338 | + | |
| 5339 | + | |
| 5340 | + | |
| 5341 | + | |
| 5342 | + | |
| 5343 | + | |
| 5344 | + | |
| 5345 | + | |
| 5346 | + | |
| 5347 | + | |
| 5348 | + | |
| 5349 | + | |
| 5350 | + | |
| 5351 | + | |
| 5352 | + | |
| 5353 | + | |
| 5354 | + | |
5319 | 5355 | | |
5320 | 5356 | | |
5321 | 5357 | | |
| |||
5574 | 5610 | | |
5575 | 5611 | | |
5576 | 5612 | | |
5577 | | - | |
| 5613 | + | |
| 5614 | + | |
| 5615 | + | |
| 5616 | + | |
| 5617 | + | |
| 5618 | + | |
| 5619 | + | |
| 5620 | + | |
5578 | 5621 | | |
5579 | 5622 | | |
5580 | 5623 | | |
| |||
5589 | 5632 | | |
5590 | 5633 | | |
5591 | 5634 | | |
5592 | | - | |
| 5635 | + | |
| 5636 | + | |
| 5637 | + | |
5593 | 5638 | | |
5594 | 5639 | | |
5595 | 5640 | | |
| |||
0 commit comments