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

Add an assert and a deprecate utility #9731

Merged
merged 2 commits into from Jan 5, 2022

Conversation

bertdeblock
Copy link
Contributor

@bertdeblock bertdeblock commented Dec 15, 2021

This PR adds an assert and a deprecate utility that use the same API as the ones provided by @ember/debug.

The idea is that, in a follow-up PR a registerDeprecationHandler utility is introduced (similar to the one provided by @ember/debug) which can be used by tooling such as ember-cli-deprecation-workflow to handle deprecations more explicitly (e.g. throw instead of warn).

If merged, I will create a PR to update the deprecations introduced in #9707 (or update that PR if this one is merged sooner).

warn(message);
warn(getStackTrace());

// Return the message for testing purposes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that in @ember/debug we noop console.warn and let deprecate throw during testing to do the necessary assertions. Should I do that here as well?

@rwjblue rwjblue merged commit 1b7f496 into ember-cli:master Jan 5, 2022
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

2 participants