Repository navigation
[DOC] Document the key option for {{#each-in}} - #21536
Merged
Merged
Conversation
johanrd
force-pushed
the
docs-each-in-key-options
branch
2 times, most recently
from
July 30, 2026 01:41
8ddd607 to
6538286
Compare
johanrd
force-pushed
the
docs-each-in-key-options
branch
3 times, most recently
from
July 30, 2026 08:49
0c0fff1 to
17da333
Compare
`{{#each-in}}` accepts `key=`, but only `{{#each}}`'s special values were
documented, and they mean different things when iterating entries:
- `@key` keys on the property name, or a `Map`'s key
- `@identity`, the default, keys on the entry's value, so a changed value is
also a changed key and that entry's DOM is replaced rather than updated in
place
- any other string is a path resolved against the value
`@index` is left undocumented: it also resolves to the property name, making it
a redundant alias for `@key` on a plain object and worse on a `Map` keyed by
objects, where every key coerces alike and entries end up reused by position.
`@key` is likewise left out of `{{#each}}`, where it returns the numeric index
and duplicates `@index`.
`@key`, `@index` and path keys had no `{{#each-in}}` coverage, and `@identity`
appeared only incidentally in tests asserting rendered text, so add tests
asserting DOM node identity across an update for each.
Refs emberjs#16719
johanrd
force-pushed
the
docs-each-in-key-options
branch
from
July 30, 2026 08:50
17da333 to
3ab4556
Compare
kategengler
approved these changes
Aug 7, 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.
Closes #16719
{{#each-in}}acceptskey=, but only{{#each}}'s special values were documented — and over entries they mean something different:key=@keyMap's key@identity@keywas called public API for{{#each-in}}in #16719 but was documented nowhere.@indexis deliberately left out: it also resolves to the property name, so it duplicates@keyon a plain object and is worse on aMapkeyed by objects, where every key coerces alike. Added two tests to record its behavior anyway, since #16719 calls it public API while RFC #321 (never accepted) marks it N/A.Five tests added, each asserting DOM node identity across an update.
{{#each-in}}previously had no coverage for@key,@indexor path keys, and@identityappeared only incidentally in tests asserting rendered text.Cowritten by Claude