-
Notifications
You must be signed in to change notification settings - Fork 35
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
refactor(decorators): Refactor to use ember-argument-decorators #51
Conversation
bab621b
to
15994de
Compare
15994de
to
f1f84db
Compare
Been seeing that flakiness for the test that failed on master, not sure what's causing it but we should try to track it down. |
Also, looks like the |
So, my guess here is that you have a parent component that does something like this:
You're just passing forward default values, and if no value was passed in by the parent it's undefined, so it gets set (unintentionally) and the It's a really common bug/pattern, not unique to us (see ember-power-select for instance) and it's more apparent for things that should never be @argument
@defaultIfUndefined
target = null; alternatively, you could argue that this really should be the default behavior, and users should have to opt out: @argument
target = target in this ? this.target : null; // Key is defined, value exists but it was set to `undefined` purposefully, so pass it through I'm still kind of bikeshedding about which solution @argument should take, so I'm definitely ok with adding |
Well, yeah, different cases... something like that for some tests, where I tested for different non-popper related things and did not care to pass something meaningful as
I think I fixed the issues for now (Travis still running, but seem to pass). So no hurry, but I guess other users could run into this as well... |
Ended up going with the following API: @argument({ defaultIfUndefined: true }) I think adding this to each of ember-popper's arguments would make sense since it is a low level component, in general. What do you think @kybishop? |
@pzuraq sounds good to me |
Updates to the latest
ember-decorators
and refactors the addon to useember-argument-decorators
. Also includes theember-legacy-class-transform
to make classes work the same in modern and legacy versions of Ember.No breaking changes here, mostly maintenance.