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

deprecation functions #7335

Closed
timreichen opened this issue Sep 3, 2020 · 1 comment
Closed

deprecation functions #7335

timreichen opened this issue Sep 3, 2020 · 1 comment

Comments

@timreichen
Copy link
Contributor

timreichen commented Sep 3, 2020

Reading #7325 (comment):
Is there a conventional way to deprecate functions in deno modules?
I think it would make sense to have deprecation warnings at runtime and It would be good to provide some kind of deprecation function in std for consistent deprecation warnings/logs?

Example:

import { deprecate } from "deno.land/std/fmt/deprecate.ts"

function myFunction() {
  deprecate(myFunction.name, myNewFunction.name)
  
}

function myNewFunction() {
  
}

Console

Deprecated: the myFunction function is deprecated. Use myNewFunction instead.
@timreichen
Copy link
Contributor Author

close in favor of #7345

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 a pull request may close this issue.

1 participant