Skip to content
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

Merged
merged 3 commits into from Mar 26, 2024

Conversation

kategengler
Copy link
Member

@kategengler kategengler commented Mar 26, 2024

  • 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

For https://rfcs.emberjs.com/id/0830-evolving-embers-major-version-process

- 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
@kategengler kategengler changed the title Make deprecations throw when the until for ember-source has passed [FEATURE] Make deprecations throw when the until for ember-source has passed Mar 26, 2024
@kategengler kategengler merged commit aaee9e9 into main Mar 26, 2024
22 checks passed
@kategengler kategengler deleted the kg-break-deprecations-at-until-2 branch March 26, 2024 20:46
@chancancode
Copy link
Member

@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?

@kategengler
Copy link
Member Author

@chancancode No, it does not ... the deprecate within deprecateUntil should be stripped but the throw should remain because we want to actually break the APIs at the until

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants