[FEATURE] Make deprecations throw when the until for ember-source has passed#20669
[FEATURE] Make deprecations throw when the until for ember-source has passed#20669kategengler merged 3 commits intomainfrom
until for ember-source has passed#20669Conversation
- 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! |
deprecateUntilthat checks whether a deprecation has been removed and throws if it has. This explicitly usesthrowand not assert so that it will remain in production builds. This function should be used internally in ember-source in place ofdeprecate.testIfandtestUnlessto guard tests based on whether a deprecation has been removed. Uses this for the existing deprecation on @ember/routingoverridedeprecationversionthat takes a version to be the current version for removing deprecation purposesFor https://rfcs.emberjs.com/id/0830-evolving-embers-major-version-process