feat: Added instrumentation support for Express 5 beta #2476
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This originally started as a research spike to see what broke. It turns out not much so I just PRd support for express 5 beta. We will not officially support it because it hasn't been released as generally available. We will keep tabs on any upcoming beta releases and remove the test stanzas when 5.0.0 is out. I will make sure when this lands to include a secondary changelog item to state this is not officially supported just yet.
Most of the changes are around how child applications are mounted. In v4 they used to be mounted as applications, now they are just mixed in. You can see a difference here:
Also, the routing has changed a little because it migrated to use
router@2.0.0-beta
. I had to update some definitions and assertions to handle this. Lastly, express 4 used to bind the query and expressInit middleware as part of the mounted application, this is still done but not as first class middleware so I had to loosen some assertions.Lastly, I added tests for async handlers and how they are handled if they reject.
How to Test
Related Issues
Closes #2385