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

feat: Add warnings for more deprecated APIs #21992

Merged
merged 21 commits into from
Jan 24, 2024

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Jan 18, 2024

Follow up to #21939 that adds deprecation
warnings to more Deno APIs:

  • Deno.copy()
  • Deno.iter()
  • Deno.iterSync()
  • new Deno.Buffer()
  • Deno.readAll()
  • Deno.readAllSync()
  • Deno.writeAll()
  • Deno.writeAllSync()
  • Deno.FsWatcher.return
  • Deno.serveHttp()
  • Deno.metrics()

@bartlomieju bartlomieju added this to the 1.40 milestone Jan 18, 2024
@iuioiua
Copy link
Contributor

iuioiua commented Jan 23, 2024

Note: Deno.serveHttp() was done in #22034.

ext/io/12_io.js Outdated
internals.warnOnDeprecatedApi(
"Deno.iter()",
new Error().stack,
"Use `ReadableStreamDefaultReader` instead.",
Copy link
Member Author

Choose a reason for hiding this comment

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

Err I don't understand this suggestion :( don't we have iter() equivalent in deno_std?

Copy link
Contributor

@iuioiua iuioiua Jan 23, 2024

Choose a reason for hiding this comment

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

No, that's deprecated. Should we add it back in? I was wondering whether we should add it back in...

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably not. Maybe we shouldn't add a suggestion here - this API relies on Reader interface that is also deprecated. So migrating the underlying Reader dictates which API should be used instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

The Reader interface in deno_std is no longer deprecated, so this might be fine to add back in.

Also, actually, should it not be ReadableStream instead? Both ReadableStream and Deno.iter() are async iterable.

We can either add iter() back to deno_std or suggest ReadableStream.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's suggest ReadableStream 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

I realise doing this all in runtime/js/90_deno_ns.js will be cleaner.

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

LGTM

@bartlomieju bartlomieju merged commit 064a6c0 into denoland:main Jan 24, 2024
14 checks passed
@bartlomieju bartlomieju deleted the warn_on_deprecated_api_2 branch January 24, 2024 13:57
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.

3 participants