-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Update Ember.deprecate
and Ember.warn
calls to include required information
#3570
Update Ember.deprecate
and Ember.warn
calls to include required information
#3570
Conversation
Ember.deprecate
and Ember.warn
calls to include required information
9fc6689
to
507ae2a
Compare
Ember.deprecate
and Ember.warn
calls to include required informationEmber.deprecate
and Ember.warn
calls to include required information
I wasn't really sure how to come up with the ids so let me know if there is a better pattern to follow. Same with the |
e7d362b
to
d46386e
Compare
@HeroicEric I'd say we should keep the IDs simple, like @rwjblue would it make sense to prefix all ED deprecation/warn IDs with |
Yeah, I think prefixing the id with an identifier for the project is a good idea. It will help the tooling that handles this know where (ember, ember-data, etc) a given deprecation comes from. |
I'd love to get this into the next point release, if possible. I'm working on tooling to help folks deal with these things and having the |
@@ -79,7 +79,7 @@ AdapterError.prototype = Object.create(EmberError.prototype); | |||
*/ | |||
export function InvalidError(errors) { | |||
if (!Ember.isArray(errors)) { | |||
Ember.deprecate('`InvalidError` expects json-api formatted errors.'); | |||
Ember.deprecate('`InvalidError` expects json-api formatted errors.', false, { id: 'errors.not-json-api-format', until: '3.0.0' }); |
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.
ds.errors.invalid-error-expects-json-api-format
?
I've added some suggestions that I think make sense. Feel free to use them or not. They all follow the Would also love to see this get into 1.13.7 |
c21650a
to
71a2a9a
Compare
modelName = modelOrClass; | ||
} else { | ||
Ember.deprecate(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${Ember.inspect(modelName)}`, false, { id: 'ds.store.passing-classes-deprecated', until: '3.0.0' }); |
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.
do these ids need to be totally unique? Like, can this id be the same as the one in serializerFor
?
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.
I'd say they can be the same since they are about the exact same thing, just added in multiple places. @rwjblue?
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.
Absolutely, it isn't about being unique at all. Its about being able to deal with specific things. If two Ember.deprecate
invocations are for the same underlying thing, we should use the same id
.
@wecc thanks. Those are much more consistent 👍 |
71a2a9a
to
4a39415
Compare
@@ -256,6 +254,13 @@ Model.reopenClass({ | |||
inverseKind = inverse.kind; | |||
} else { | |||
//No inverse was specified manually, we need to use a heuristic to guess one | |||
if (propertyMeta.type === propertyMeta.parentType.modelName) { | |||
Ember.warn(`Detected a reflexive relationship by the name of '${name}' without an inverse option. Look at http://emberjs.com/guides/models/defining-models/#toc_reflexive-relation for how to explicitly specify inverses.`, false, { | |||
id: 'ds.model.relflexive-relationship-without-inverse', |
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.
typo, relflexive
4a39415
to
b4a2047
Compare
I was thinking about |
@wecc - See emberjs/ember-inspector#430 for details, but I made a polyfill for this to run against older Ember versions. |
@wecc can you mark anything in here that should be marked 2.0.0 and I can work on a PR for 1.13.x |
Will the the changes from #3575 (bugfix release) make their way into master or should I continue with this PR? |
@HeroicEric you should keep working on this pr. usually things go from master to release but not the other way around. |
eb11ab3
to
41176b6
Compare
I think this is good to go now. |
LGTM! Can you prefix with |
41176b6
to
5ba8df8
Compare
…arn-calls Update `Ember.deprecate` and `Ember.warn` calls to include required information
Thanks. |
Ember.deprecate
to include required optionsEmber.warn
to include required optionsfixes #3568