-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Document path-to-regexp migration #1316
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
Closed
euoia
wants to merge
5
commits into
expressjs:gh-pages
from
euoia:2022-02-03-document-path-to-regexp-migration
Closed
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b795a3e
Remove references to alpha, simplify intro
euoia 0ec09ea
Migration docs based on pillarjs/router/pull/102/files
euoia 9795c43
Revert accidental changes to Gemfile
euoia 14ee279
Add pillarjs/router changes from 2.0.0-beta.1
euoia 0b1e712
Remove references to Express v3
euoia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are great, but we should also include and list changes from
2.0.0-beta.1. In a nutshell, these are:?,*, and+parameter modifiers (e.g.:/users/:user+now matches/users/1,/users/1/2, etc. but not/users)*path segment behavior removed. This means that*is no longer a valid path and/foo/*/barnow matches a literal'*'. For the previous behaviour, a(.*)matching group should be used instead./users/\\d+is now invalid and should be written as/users/(\\d+)).Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, fantastic, I'll update the documentation.
I guess it might be worth stating that Express 5 uses path-to-regexp 6, and linking to the documentation for that. Similar to this page (see "Express uses path-to-regexp"):
http://expressjs.com/en/guide/routing.html#route-paths
Which leads a bit deeper down the rabbit hole - that page itself should possibly be updated, but is not versioned. Any suggestions on how to proceed?
I suppose it may also be worth forking http://forbeslindesay.github.io/express-route-tester/ in order to create a version for Express 5.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to all.
None from my side. Core maintainers should help us here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The migration guide has been updated with 14ee27 - @nfantone please have a look and let me know if it's okay.
@dougwilson how should we update the routing guide? If we follow the error handling guide (which is also unversioned) there's a section "Starting in Express v5..." - perhaps we could do that?
I think my preference would be to have separate documentation for version 5 versus version 4, but obviously that's a larger undertaking.