-
-
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
Raise error on unhandled deprecation warnings #3335
Conversation
lastName: 'Smith', | ||
phoneNumbers: [number1, number2] | ||
}); | ||
}, /You tried to push a record 'Person'' with id '<PhoneNumber:.*>' and passed a DS.Model instance as a value for the relationship '1'. You should instead pass a numerical or string id to represent the record./); |
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.
This deprecation warning is updated in #3325 and needs to be updated once the other PR is merged.
As pointed out by @mixonic in emberjs/ember.js#11419 (comment), this PR uses a private API for changing the log level of certain deprecation messages. This might need to go through an RFC before it can be used in EDIT: opened an RFC: emberjs/rfcs#65 |
This raises an error when unhandled deprecation warnings exist. By this we enforce that deprecation warnings are properly tested.
This is used extensively throughout the tests.
@pangratz do you mind rebasing this pr? (or starting it over if thats easier). I suspect we should be able to set |
@bmac There is an open PR #3233 by @fivetanley which only sets the |
This is my stab at enabling the
ENV['RAISE_ON_DEPRACATION']
flag when the tests are run. By this, unhandled deprecation messages throw an error and hence it is not possible to use deprecated features within the tests ofember-data
(an example being not using the deprecatedEmber.Map.remove
and useEmber.Map.delete
instead).Some minor deprecation warnings are fixed in the course of this PR, but there are two areas, which are addressed differently:
store.pushMany
is deprecated in favor ofstore.push(object)
; since this is used throughout many tests, this deprecation warning is changed to be soft-deprecated, which means that the deprecation warning are logged but they do not result in a failed test/buildSerializer#extract
, which is deprecated when theds-new-serializer-api
feature is enabled.Soft deprecating those features allows us to migrate the tests step-by-step migrate and make adaptions in smaller chunks.
Changing the log level for deprecations has been implemented in emberjs/ember.js#11419.