Skip to content

Node.js 15+ starts recommending promise based versions by default - Express 5.0 and wrapAsync #4535

Closed

Description

@thernstig

Hi!

As an example Node.js and https://nodejs.org/api/fs.html is starting to recommend promise-based versions foremost. (compare with earlier versions that has the promised based versions last: https://nodejs.org/docs/latest-v14.x/api/fs.html).

Express 5.0 has added automatic handling in routes of async/await routes that will automatically invoke the Express error handler if a an async function throws. There are current workarounds to create a wrapAsync() function around routes, but in bigger projects some users miss this and it's also not-so-nice-looking (and confusing for some).

I am merely wondering if Express 5.0 could be released, and current items on https://github.com/expressjs/express/milestone/11 could be moved to a 6.0 release? I am very respectful of the fact that you voluntarily work on this, and these kind of questions are frowned upon. #2237 was created 7 years ago now, so I at least think it should be ok to ask for this without in any way not being grateful of this project already and its release cadence.

I guess what I am saying is that there are some nice things already on the main branch for Express 5.0 that works good with latest versions of Node.js 15, so a release would be amazing.

Activity

  1. enyoghasim commented on Mar 15, 2021

    @enyoghasim
  2. thernstig commented on Mar 15, 2021

    @thernstig
    Author

    @enyoghasim I am no maintainer of this repo and do not have the power to do releases, so I am unsure why I was added as asignee? Considering you are part of the express organization, is there any chance you could rally your peers to look into this?

  3. thernstig commented on May 17, 2021

    @thernstig
    Author

    @dougwilson do you have anything to add to this? You are certainly doing a great job with maintenance of all the subdependencies etc of Express. But if Express 5.0 alpha 8 has not received any complaints of serious bugs, what are you feeling about this topic?

    Also the answer by @enyoghasim concerns me a bit: I am not sure if it is sarcasm or what, but yeah.

  4. dougwilson commented on May 17, 2021

    @dougwilson
    Contributor

    Hi @thernstig I'm sorry for one of the comments in the thread; I went ahead a hid it for now.

    As for your idea, that is pretty much what the TC decided, even though there is still a lot of flac from the community about deferring things like http/2 to express 6. Really, there is only one outstanding issues for express 5, and it is related to async/await in the router. There is an open PR to address this, but the author has kind of faded away. Ideally that's really all that needs to be fixed if the idea is for express 5's main goal to be async/await.

  5. thernstig commented on May 17, 2021

    @thernstig
    Author

    @dougwilson thank you very much for answering, I know you have a very busy schedule.

    Any chance you could champion taking over that PR to get it merged?

    I agree with you and the TC. I think it is perfectly fine to release 5.0 and then later HTTP/2. There is always some "can you just add this as well?". I personally do not think there is anything stopping release 6 being a much smaller release with just having HTTP/2 as the main focus. That way it really should not matter much to users who want HTTP/2 get an "intermediate" 5.0 release.

    Articles like https://dev.to/romainlanz/why-you-should-drop-expressjs-in-2021-711 make me sad because 1) much of the article is not true 2) Express is being actively worked on but some people do not explore enough to be aware it is.

  6. enyoghasim commented on May 17, 2021

    @enyoghasim

    @dougwilson @thernstig i am sorry for the hidden comment

  7. euoia commented on May 19, 2021

    @euoia

    I feel the same way as @filipecatraia, having tried Koa but moved back to express for similar reasons. I would also prefer not to have to wrap all of my request handlers in asyncHandler.

    @dougwilson you said:

    Really, there is only one outstanding issues for express 5 and it is related to async/await in the router.

    Would you mind linking to the issue in this thread for anybody else following along who might like to take a shot at it?

  8. thernstig commented on Jun 1, 2021

    @thernstig
    Author

    @dougwilson, could you share the only issue holding off the release?

  9. thernstig commented on Jun 6, 2021

    @thernstig
    Author

    @aravindvnair99 those links do not help much I am afraid. @dougwilson stated there was only one outstanding issue for 5.0. Meaning it seems the rest could be postponed.

    It is clear @dougwilson is very active on Github, and seeing there is only one outstanding issue for the release, it feels natural to focus on that PR i.e. take over what the original author of that PR started. The focus seems to be on updating other things, which maybe could be held of till that one thing stopping Express 5.0?

    The community has been waiting for many years quite patiently for the release, and has helped along the way with PRs and issues. It would be great to finally after these years make the community happy with a new release 😃

  10. aravindvnair99 commented on Jun 6, 2021

    @aravindvnair99
    Member

    @thernstig I agree. My intention though was just to mention the links here for anyone else who stumbles upon this issue tracker.

    I must admit I too am excited for a v5 release. Express has always been about stability in my opinion, but yes I look forward to v5. It's long been in the development stage.

    And as for what @dougwilson was referring to, I'm not sure which issue that is exactly. My guess are on this one: #4321

  11. thernstig commented on Jul 1, 2021

    @thernstig
    Author

    @dougwilson, could we get some feedback from you? Asking with my nicest voice possible, is there no chance you could fix the last outstanding problem if you know what to do? It feels every time this is brought up lots of other things are fixed instead of this. I am unsure why, it almost feel like releasing 5.0 is shunned for some reason 😞

  12. dougwilson commented on Jul 1, 2021

    @dougwilson
    Contributor

    The author of the PR is back with us and was just working on it the other day. When someone is working on aomething, I don't feel it would be appropriate if I just did it myself and then pushed my own code and then closed their PR, would you? I don't think that would be a great way to keep people contributing. Since they are now interacting with the PR to finiah it, I think that is fine.

    @aravindvnair99 is a triager and even provided various links here. We have the triagees so, among other things, I don't have to respond to every single comment across all the repos and can do other tasks.

  13. locked as too heated and limited conversation to collaborators on Jul 1, 2021
  14. removed their assignment
    on Dec 31, 2021
  15. dougwilson commented on Feb 17, 2022

    @dougwilson
    Contributor

    A beta.1 has been released with the referenced router changes 🎉 . Please check it out http://expressjs.com/en/guide/migrating-5.html

    Since this changed the route path syntax a bit, I'll let it get maybe a month for feedback before official release.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions