Visitar URL original
Deprecate `multipleResolves`? · Issue #41554 · nodejs/node · GitHub
The Wayback Machine - https://web.archive.org/web/20220119185152/https://github.com/nodejs/node/issues/41554
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

Deprecate multipleResolves? #41554

Open
benjamingr opened this issue Jan 16, 2022 · 12 comments
Open

Deprecate multipleResolves? #41554

benjamingr opened this issue Jan 16, 2022 · 12 comments

Comments

@benjamingr
Copy link
Member

@benjamingr benjamingr commented Jan 16, 2022 •

I'm thinking, should we deprecate the multipleResolves event? Is it used?

We've known it had problems shortly after it was added and it did not end up being useful for the use cases it was initially designed for.

Also cc @nodejs/tsc since deprecating APIs presumably needs TSC approval/discussion?

@benjamingr
Copy link
Member Author

@benjamingr benjamingr commented Jan 16, 2022

@nodejs/diagnostics @nodejs/promises-debugging (if anyone on that team is still active :D)

@mcollina
Copy link
Member

@mcollina mcollina commented Jan 16, 2022

I'm ok for removing it.

@jasnell
Copy link
Member

@jasnell jasnell commented Jan 16, 2022

+1 for deprecating

@mmarchini
Copy link
Member

@mmarchini mmarchini commented Jan 16, 2022

I'll poke around next week to see if anyone at Netflix or elsewhere is using it (and if so, will try to understand the use case). Personally I haven't used it at all.

It would be nice if we could get data from npm to see if anyone is using it and how. Also, maybe a Twitter poll (not a very scientific method but we have used in the past).

I don't remember the issues regarding multipleResolves, do we have it listed anywhere?

@ronag
Copy link
Member

@ronag ronag commented Jan 16, 2022

+1

@mmarchini
Copy link
Member

@mmarchini mmarchini commented Jan 16, 2022

@Mesteery GitHub Code Search has a waiting list, so folks can't access the URL unless they already joined :/

Either way, logging is a valid use case IMO. Although 45 files are an indication that it's an underused feature.

@benjamingr I don't remember if this was something that could be implemented in userland or not. Is it?

@benjamingr
Copy link
Member Author

@benjamingr benjamingr commented Jan 17, 2022

@benjamingr I don't remember if this was something that could be implemented in userland or not. Is it?

It's not, it's something V8 did just for Node.js and I regret wasting their good-will and time on the feature only to find out at the end there are a ton of cases they resolve promises multiple times in their implementations of stuff like Promise.all / Promise.race which means the hook's value is significantly diminished in practice.

If the hook worked it would have been pretty useful.

Either way, logging is a valid use case IMO. Although 45 files are an indication that it's an underused feature.

I went through all of them and I think the vast majority are just examples of the hook rather than genuine "everyday" usage of the hook. I am happy to also send out an unofficial survey of "Are you familiar with multipleResolves" and "Are you using multipleResolves" if that'd help.

@mmarchini
Copy link
Member

@mmarchini mmarchini commented Jan 17, 2022

It's not, it's something V8 did just for Node.js and I regret wasting their good-will and time on the feature only to find out at the end there are a ton of cases they resolve promises multiple times in their implementations of stuff like Promise.all / Promise.race which means the hook's value is significantly diminished in practice.

If the hook worked it would have been pretty useful.

Got it. Functionality-wise this seems like something that can be deprecated and removed. I think it's worth adding this context to the OP so others can also make an informed decision.

I went through all of them and I think the vast majority are just examples of the hook rather than genuine "everyday" usage of the hook

That's a relief since reduces the chances of open source packages propagating usage of it. There still might be some relevant usage in private repos that could surface from asking the community.

I am happy to also send out an unofficial survey of "Are you familiar with multipleResolves" and "Are you using multipleResolves" if that'd help

It doesn't have to be unofficial, we can share one through the Node.js account. It can be a twitter poll ("yes, i'm familiar and use", "yes, I'm familiar but don't use", "I'm not familiar but would use", "I'm not familiar and wouldn't use", or just "would you be opposed to deprecating multipleResolves (yes/no)? If no please reach out at #41554 with your use case"), not a sophisticated survey (yes, I'm volunteering to run this poll).

@benjamingr
Copy link
Member Author

@benjamingr benjamingr commented Jan 17, 2022 •

It doesn't have to be unofficial, we can share one through the Node.js account. It can be a twitter poll ("yes, i'm familiar and use", "yes, I'm familiar but don't use", "I'm not familiar but would use", "I'm not familiar and wouldn't use", or just "would you be opposed to deprecating multipleResolves (yes/no)? If no please reach out at #41554 with your use case"), not a sophisticated survey (yes, I'm volunteering to run this poll).

Go for it, I would be interested in what the result would be.

Edit: I'll also run one on the Node.js user group in Facebook I moderate to get some non-twitter data

@RaisinTen
Copy link
Member

@RaisinTen RaisinTen commented Jan 18, 2022

+1 with the deprecation. FWIW, we don't use this in Postman.

@benjamingr
Copy link
Member Author

@benjamingr benjamingr commented Jan 18, 2022

So some data from the unofficial poll (asked in the Israeli Node.js group on Facebook):

  • 90 people have answered
  • 95.5% answered they are not familiar with multipleResolves
  • 4.5% answered they know of multipleResolves but have not used it.
  • 0% said they know of it and have used it.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants