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

Fix didReceiveAttrs in ES Class #16185

Merged
merged 2 commits into from
Feb 17, 2018
Merged

Conversation

wycats
Copy link
Member

@wycats wycats commented Jan 28, 2018

No description provided.

@@ -28,6 +28,7 @@ import {
assert,
deprecate,
} from 'ember-debug';
import { ENV } from 'ember-environment';
Copy link
Member

Choose a reason for hiding this comment

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

This is failing CI due to a linting error:

ERROR: /home/travis/build/emberjs/ember.js/packages/ember-glimmer/lib/component-managers/curly.ts[32, 1]: Import sources within a group must be alphabetized.

I believe this line should be moved down below import { DEBUG } from 'ember-env-flags';.

@krisselden
Copy link
Contributor

What’s the status?

@mmun mmun force-pushed the fix-did-receive-attrs-in-es-class branch from 60ffe33 to abc2916 Compare February 17, 2018 18:22
pzuraq and others added 2 commits February 17, 2018 14:00
Adds a failing test for didReceiveAttrs in native classes. Class fields
will likely be the prefered way to initialize default values on class instances,
but because didReceiveAttrs is called in the base class constructor it is
initially called before class fields have had an opportunity to be setup.
Running didReceiveAttrs inside of the base constructor means that it
runs before subclass constructors (and ES fields in subclasses) are run.

This commit moves didReceiveAttrs to the component manager (after
creating the component), which changes the order it runs in, and causes
it not to run when simply creating the component.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants