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

[Glimmer2] Add test for glimmer re-renders #13772

Merged
merged 1 commit into from
Jul 18, 2016

Conversation

chadhietala
Copy link
Contributor

@chadhietala chadhietala commented Jun 29, 2016

Part of #13644

@@ -1013,6 +1013,56 @@ moduleFor('Components test: curly components', class extends RenderingTest {
this.assertText('In layout - someProp: value set in instance');
}

// Note: Hooks are not re-ran for idempotent re-renders

Choose a reason for hiding this comment

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

're-run'.

@krisselden
Copy link
Contributor

I personally believe the current behavior where they do rerun is costly and makes little sense, but I think it is problematic we keep changing the behavior of rerender and not very semver like.

I would be trivial to make htmlbars match this, I already have to do it manually in collection-view to work around bugs caused by the existing behavior: https://github.com/emberjs/ember-collection/blob/master/addon/utils/needs-revalidate.js#L3

/cc @wycats @rwjblue

@rwjblue
Copy link
Member

rwjblue commented Jul 4, 2016

We should likely consider making this behavior (the specific semantics around ordering and if hooks will be ran when args do not change) "locked down" and guaranteed as part of SemVer, and I agree that changing the semantics repeatedly seems trolly, but I do not think it is a SemVer violation to switch to the glimmer behavior. The current behavior is (IMO) bad, and the glimmer behavior (documented by this test) seems much better.

FWIW, I believe this is also tested by the lifecycle tests (which has branched assertions based on engine).

@wycats
Copy link
Member

wycats commented Jul 5, 2016

I think that, for now, saying that we promise to run the hooks if any of the declared inputs change, and MIGHT run hooks otherwise is correct. We should expressly say in documentation that you should NOT rely upon hooks that run in the absence of a change to the inputs, and that we expect further optimizations to reduce the number of such cases over time.

@chadhietala
Copy link
Contributor Author

Is there any consensus as to if this should be merged or not?

@rwjblue rwjblue merged commit 65d7734 into emberjs:master Jul 18, 2016
@chadhietala chadhietala deleted the rerendering-attrs branch July 18, 2016 22:49
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.

None yet

5 participants