-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[FEATURE] Make deprecations throw when the until
for ember-source
has passed
#20669
Conversation
- Add a new `deprecateUntil` that checks whether a deprecation has been removed and throws if it has. This explicitly uses `throw` and not assert so that it will remain in production builds. This function should be used internally in ember-source in place of `deprecate`. - Add utilities `testIf` and `testUnless` to guard tests based on whether a deprecation has been removed. Uses this for the existing deprecation on @ember/routing - Add a query param to tests `overridedeprecationversion` that takes a version to be the current version for removing deprecation purposes - Add a CI build to use the above to test with deprecations broken
until
for ember-source
has passeduntil
for ember-source
has passed
@kategengler @ef4 I have a question: does this still get stripped correctly in prod build? looking at just the code here, it's not obvious it would – but maybe the code that handles that is out-of-tree somewhere else? |
@chancancode No, it does not ... the |
After upgrading to
|
@shama This is not related to this PR -- this PR makes deprecations throw when the until is passed, so when ember-source 6.0 is released, deprecations with an until of 6.0 will throw immediately so that we can take our time garbage collecting the old code. The deprecations you are referencing are not from ember-source (they print on the command line). These deprecations came from |
@kategengler My bad, thank you for pointing me to that embroider issue! |
deprecateUntil
that checks whether a deprecation has been removed and throws if it has. This explicitly usesthrow
and not assert so that it will remain in production builds. This function should be used internally in ember-source in place ofdeprecate
.testIf
andtestUnless
to guard tests based on whether a deprecation has been removed. Uses this for the existing deprecation on @ember/routingoverridedeprecationversion
that takes a version to be the current version for removing deprecation purposesFor https://rfcs.emberjs.com/id/0830-evolving-embers-major-version-process