-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not allow deprecations to exist (#44)
* Do not allow deprecations to exist * We don't need deprecation-workflow (the package). See: ember-cli/ember-cli-deprecation-workflow#156 * Fix a deprecation * Fix deprecations
- Loading branch information
1 parent
3f5b777
commit 0e25436
Showing
6 changed files
with
62 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { registerDeprecationHandler } from '@ember/debug'; | ||
|
||
import config from 'test-app/config/environment'; | ||
|
||
const SHOULD_THROW = config.environment !== 'production'; | ||
const SILENCED_DEPRECATIONS: string[] = [ | ||
// Add ids of deprecations you temporarily want to silence here. | ||
]; | ||
|
||
registerDeprecationHandler((message, options, next) => { | ||
if (!options) { | ||
console.error('Missing options'); | ||
throw new Error(message); | ||
} | ||
|
||
if (SILENCED_DEPRECATIONS.includes(options.id)) { | ||
return; | ||
} else if (SHOULD_THROW) { | ||
throw new Error(message); | ||
} | ||
|
||
next(message, options); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters