Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure destructors run for items added to an {{#each after initial render #1080

Merged
merged 1 commit into from
Apr 29, 2020

Conversation

pzuraq
Copy link
Member

@pzuraq pzuraq commented Apr 29, 2020

Currently we don't properly setup the DESTRUCTOR_STACK on the VM
before beginning the update when we add a new list item. This refactor
renames the iterate function to replace enterItem, since that's
where the majority of setup code exists, and renames enterItem to be
registerItem, since that's the only part of the code that really
differs between append and update. It also adds a test, which I ensured
did fail before this update.

@pzuraq
Copy link
Member Author

pzuraq commented Apr 29, 2020

Original Ember issue: emberjs/ember.js#18855

Currently we don't properly setup the `DESTRUCTOR_STACK` on the VM
before beginning the update when we add a new list item. This refactor
renames the `iterate` function to replace `enterItem`, since that's
where the majority of setup code exists, and renames `enterItem` to be
`registerItem`, since that's the only part of the code that really
differs between append and update. It also adds a test, which I ensured
did fail before this update.
@pzuraq pzuraq force-pushed the bugfix/iterable-update-item-destructors branch from eb062e2 to 09f0190 Compare April 29, 2020 00:29
Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes seem fine, but I don't fully understand the CI failures.

@pzuraq
Copy link
Member Author

pzuraq commented Apr 29, 2020

Looks like it was a fluke, originally it passed and linting failed, I reran and it passed.

@rwjblue rwjblue added the bug label Apr 29, 2020
@rwjblue rwjblue changed the title [BUGFIX] Fixes destructors for list updates Ensure destructors run for items added to an {{#each after initial render Apr 29, 2020
@rwjblue rwjblue merged commit bec3f43 into master Apr 29, 2020
@rwjblue rwjblue deleted the bugfix/iterable-update-item-destructors branch April 29, 2020 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants