Port BrandedArray fix for Array-as-parent bug in destroyables (glimmer-vm#1771)#21139
Merged
Port BrandedArray fix for Array-as-parent bug in destroyables (glimmer-vm#1771)#21139
Conversation
Copilot
AI
changed the title
[WIP] Port bugfix from glimmerjs/glimmer-vm#1771 to emberjs/ember.js
Port BrandedArray fix for Array-as-parent bug in destroyables (glimmer-vm#1771)
Mar 3, 2026
Contributor
|
Compare with: glimmerjs/glimmer-vm#1771 |
…bug in destroyables Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
16e09a4 to
5859b78
Compare
Contributor
Estimated Asset SizesDiff --- main/out.txt 2026-03-03 16:45:40.000000000 +0000
+++ pr/./pr-22633253461/out.txt 2026-03-03 16:46:26.000000000 +0000
@@ -1,7 +1,7 @@
╔═══════╤═══════════╤═══════════╗
║ │ Min │ Gzip ║
╟───────┼───────────┼───────────╢
-║ Total │ 351.99 KB │ 203.84 KB ║
+║ Total │ 352.16 KB │ 203.97 KB ║
╚═══════╧═══════════╧═══════════╝
╔══════════════════════╤═══════════╤═══════════╗
@@ -40,9 +40,9 @@
╔═════════════════╤══════════╤══════════╗
║ @glimmer/* │ Min │ Gzip ║
╟─────────────────┼──────────┼──────────╢
-║ Total │ 38.6 KB │ 21.94 KB ║
+║ Total │ 38.77 KB │ 22.06 KB ║
╟─────────────────┼──────────┼──────────╢
-║ destroyable │ 2.77 KB │ 1.39 KB ║
+║ destroyable │ 2.95 KB │ 1.52 KB ║
║ encoder │ 81 B │ 171 B ║
║ env │ 38 B │ 87 B ║
║ global-context │ 886 B │ 545 B ║Details
|
Contributor
|
Perf: |
NullVoxPopuli
approved these changes
Mar 3, 2026
ef4
approved these changes
Mar 3, 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.
DestroyableMetausedArray.isArray()to distinguish single items from multi-itemOneOrMany<T>collections, making it impossible to use a plain array as a parent inassociateDestroyableChild— the array was misidentified as an internal multi-item collection, breakingpush,iterate, andremove.Changes
packages/@glimmer/destroyable/index.tsOneOrMany<T>now usesBrandedArray<T>instead ofT[]for the "many" casebrandedsymbol,BrandedArray<T>type, andisBrandedArray()type guardpushbrands newly-created multi-item arrays;iterateandremoveuseisBrandedArray()instead ofArray.isArray()packages/@glimmer/destroyable/test/destroyables-test.ts'parent can be an array'test covering the previously broken caseOriginal prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.