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: added support for express v5 beta #1261

Merged
merged 6 commits into from
Aug 8, 2024
Merged

feat: added support for express v5 beta #1261

merged 6 commits into from
Aug 8, 2024

Conversation

aryamohanan
Copy link
Contributor

@aryamohanan aryamohanan commented Aug 6, 2024

Express has been preparing for a major release (v5) for some time now, and they have already released several beta versions, including 5.0.0-beta.3.

This PR is intended to add support for the latest express v5 beta version 5.0.0-beta.3.

More details are in #1249
refs INSTA-11745

@aryamohanan aryamohanan added the WIP label Aug 6, 2024
methods.concat('all').forEach(method => {
if (typeof express.Route.prototype[method] === 'function') {
shimmer.wrap(express.Route.prototype, method, shimHandlerRegistration);
}
});
}
if (express.Router && express.Router.prototype) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In express v5 beta, the routing logic has been refactored to use the router module instead of a locally defined one. The methods to capture uncaught errors are now on the prototype of express.Router. This ensures the code correctly wraps and intercepts the handle and use methods in Express 5 beta for error capturing.
reference expressjs/express@cec5780

@aryamohanan aryamohanan removed the WIP label Aug 7, 2024
@aryamohanan aryamohanan marked this pull request as ready for review August 7, 2024 10:22
@aryamohanan aryamohanan requested a review from a team as a code owner August 7, 2024 10:22
Copy link
Contributor

@kirrg001 kirrg001 left a comment

Choose a reason for hiding this comment

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

LGTM

I think this is good enough for now as we have proven that most of the use cases work.

Follow up tickets:

  1. Currency report (asap)
  2. Move test env to express 5 (no specific date. We will til v5 comes out)
  3. Add express v5 support when it comes out (same as 2.)

@aryamohanan aryamohanan merged commit bf471ed into main Aug 8, 2024
2 checks passed
@aryamohanan aryamohanan deleted the express-5-beta branch August 8, 2024 14:51
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.

2 participants