fix(ember-table): run flexRender cell/header functions once per render pass#6452
Merged
KevinVandy merged 1 commit intoJul 24, 2026
Merged
Conversation
…r pass The FlexRender components computed `result` in a plain getter that the template reads twice (component-branch check, then content), re-invoking the user's cell/header/footer render function on every read. Cache the getter so the render function runs exactly once per render pass.
Contributor
📝 WalkthroughWalkthroughFlexRender cell, header, and footer result getters now use Glimmer caching. A new integration test verifies that user-provided cell and header render functions are invoked only once per rendered result. ChangesFlexRender caching
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Author
|
pinging @rtablada for ember-review |
|
View your CI Pipeline Execution ↗ for commit dc02cdc
☁️ Nx Cloud last updated this comment at |
rtablada
approved these changes
Jul 24, 2026
KevinVandy
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
The
resultgetter onFlexRenderCell/FlexRenderHeader/FlexRenderFooteris read by the template more than once (branch check + content), and a plain getter re-runs per read — so the user's render function executes 2× per render pass (3× for component cells).@cachedmakes it once, and guarantees the branch check and content see the same result.Prior art
svelte's FlexRender has the same branched template shape and memoizes with
$derived. All other adapters invoke the cell fn once per render pass (react/preact/solid render it as a component; vue calls it once).Measured (10k rows × 20 cols, virtualized, prod build): initial render 2,640 → 1,320 cell fn executions (= rendered cells).
Tests:
flex-render-invocation-count.test.gts— fails onbeta, passes here. Suite 27/27.✅ Checklist
pnpm test:pr.Cowritten by claude
Summary by CodeRabbit