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
[WIP] Support Ember 3.13.0 #662
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import Ember from 'ember'; | ||
import { A } from '@ember/array'; | ||
|
||
let __EMBER_METAL__; | ||
if (Ember.__loader.registry['@ember/-internals/metal']) { | ||
__EMBER_METAL__ = Ember.__loader.require('@ember/-internals/metal'); | ||
let emberMetalPaths = [ | ||
'@ember/-internals/metal', // ember-source from 3.10 | ||
'@ember/-internals/metal/index' // ember-source from 3.13 | ||
]; | ||
let metalPath = A(emberMetalPaths).find(path => Ember.__loader.registry[path]); | ||
if (metalPath) { | ||
__EMBER_METAL__ = Ember.__loader.require(metalPath); | ||
} | ||
|
||
export function getDependentKeys(descriptorOrDecorator) { | ||
if (__EMBER_METAL__ && __EMBER_METAL__.descriptorForDecorator) { | ||
let descriptor = __EMBER_METAL__.descriptorForDecorator( | ||
descriptorOrDecorator | ||
); | ||
return descriptor._dependentKeys; | ||
return descriptor._dependentKeys || [descriptor.altKey]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What scenario is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure TBH. There are failing tests without it |
||
} else { | ||
return descriptorOrDecorator._dependentKeys; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -633,6 +633,8 @@ function getCPDependentKeysFor(attribute, model, validations) { | |
dependentKeys.push('model.isDeleted'); | ||
} | ||
|
||
dependentKeys = dependentKeys.filter(dependentKey => !!dependentKey); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
dependentKeys = dependentKeys.map(d => { | ||
return d.replace(/^model\./, `${ATTRS_MODEL}.`); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this lands we should close #653.