Skip to content

Commit

Permalink
Always fire component hooks when subtree updates
Browse files Browse the repository at this point in the history
This correctly implements the semantics in #13947

Requires the corresponding Glimmer change
  • Loading branch information
chancancode committed Sep 7, 2016
1 parent cb9f9c0 commit 71f9c2c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
5 changes: 0 additions & 5 deletions packages/ember-glimmer/lib/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,6 @@ export default class Environment extends GlimmerEnvironment {
return createIterable(ref, keyPath);
}

didCreate(component, manager) {
this.createdComponents.unshift(component);
this.createdManagers.unshift(manager);
}

didDestroy(destroyable) {
destroyable.destroy();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,25 @@ class LifeCycleHooksTest extends RenderingTest {

// Sync hooks

['the-top', 'willUpdate'],
['the-top', 'willRender'],

['the-middle', 'willUpdate'],
['the-middle', 'willRender'],

['the-bottom', 'willUpdate'],
['the-bottom', 'willRender'],

// Async hooks

['the-bottom', 'didUpdate'],
['the-bottom', 'didRender']
['the-bottom', 'didRender'],

['the-middle', 'didUpdate'],
['the-middle', 'didRender'],

['the-top', 'didUpdate'],
['the-top', 'didRender']

);

Expand All @@ -271,13 +283,20 @@ class LifeCycleHooksTest extends RenderingTest {

// Sync hooks

['the-top', 'willUpdate'],
['the-top', 'willRender'],

['the-middle', 'willUpdate'],
['the-middle', 'willRender'],

// Async hooks

['the-middle', 'didUpdate'],
['the-middle', 'didRender']
['the-middle', 'didRender'],

['the-top', 'didUpdate'],
['the-top', 'didRender']

);

this.runTask(() => this.components['the-top'].rerender());
Expand Down

0 comments on commit 71f9c2c

Please sign in to comment.