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

fix(node): remove deprecation warnings #22120

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

bartlomieju
Copy link
Member

Closes #22116

Copy link
Contributor

@mmastrac mmastrac left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -46,6 +46,8 @@ import {
} from "ext:deno_node/internal_binding/async_wrap.ts";
import { codeMap } from "ext:deno_node/internal_binding/uv.ts";

const DENO_RID_SYMBOL = Symbol.for("Deno.internal.rid");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const DENO_RID_SYMBOL = Symbol.for("Deno.internal.rid");
const DENO_RID_SYMBOL = SymbolFor("Deno.internal.rid");

Nit: primordials.

@irbull
Copy link
Contributor

irbull commented Jan 25, 2024

I don't get it, although maybe take my opinion lightly.

  1. If rid is really depreciated and going away, doesn't this "fix" really just hide it now? If / when rid is removed, this will now just fail at runtime.
  2. There were several deprecations listed in 1.40. This fix only seems to address the one (rid). Maybe this is the only one that the node compat layer uses.

@bartlomieju
Copy link
Member Author

I don't get it, although maybe take my opinion lightly.

  1. If rid is really depreciated and going away, doesn't this "fix" really just hide it now? If / when rid is removed, this will now just fail at runtime.

Resource IDs are here to stay for some foreseeable future, but we want to make them an internal notion, so that we can migrate APIs to other mechanisms (like GCable objects like in #21999). This is a stop-gap solution to stop the warnings. I'm working on a better solution that will use a unique symbol to store resource IDs (this symbol will not be reachable by user code so you won't have a way to access the value of the field).

  1. There were several deprecations listed in 1.40. This fix only seems to address the one (rid). Maybe this is the only one that the node compat layer uses.

These appear to be the only ones that we missed :)

@bartlomieju bartlomieju merged commit 9951506 into denoland:main Jan 25, 2024
14 checks passed
@bartlomieju bartlomieju deleted the fix_warnings_in_node branch January 25, 2024 23:36
bartlomieju added a commit that referenced this pull request Jan 26, 2024
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.

Use of deprecated Deno.TcpConn.rid in built-in Node compat layer
4 participants