Skip to content

Deprecate multipleResolves? #41554

Closed

Description

@benjamingr

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?

Activity

  1. added
    errorsIssues and PRs related to JavaScript errors originating in Node.js core.
    processIssues and PRs related to the process subsystem.
    promisesIssues and PRs related to ECMAScript promises.
    on Jan 16, 2022
  2. benjamingr commented on Jan 16, 2022

    @benjamingr
    MemberAuthor

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

  3. mcollina commented on Jan 16, 2022

    @mcollina
    SponsorMember

    I'm ok for removing it.

  4. jasnell commented on Jan 16, 2022

    @jasnell
    Member

    +1 for deprecating

  5. mmarchini commented on Jan 16, 2022

    @mmarchini
    Contributor

    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?

  6. ronag commented on Jan 16, 2022

    @ronag
    Member

    +1

  7. Mesteery commented on Jan 16, 2022

    @Mesteery
    Contributor
  8. mmarchini commented on Jan 16, 2022

    @mmarchini
    Contributor

    @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?

  9. benjamingr commented on Jan 17, 2022

    @benjamingr
    MemberAuthor

    @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.

  10. mmarchini commented on Jan 17, 2022

    @mmarchini
    Contributor

    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).

  11. benjamingr commented on Jan 17, 2022

    @benjamingr
    MemberAuthor

    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

  12. RaisinTen commented on Jan 18, 2022

    @RaisinTen
    Member

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

  13. benjamingr commented on Jan 18, 2022

    @benjamingr
    MemberAuthor

    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


    Edit: gave it more time, results are similar. Were you able to run a twitter survey by any chance @mmarchini ?

    image

  14. mmarchini commented on Jan 24, 2022

    @mmarchini
    Contributor

    @benjamingr was trying to figure out how to share a poll with the Node.js account. Just opened an issue in the appropriate repo for folks managing that account to tweet it.

  15. benjamingr commented on Feb 6, 2022

    @benjamingr
    MemberAuthor

    image

    Looks like the twitter results are similar (there is a minority of "currently using" but 0 comments of how and a big majority for "unfamiliar")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    errorsIssues and PRs related to JavaScript errors originating in Node.js core.processIssues and PRs related to the process subsystem.promisesIssues and PRs related to ECMAScript promises.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions