-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remix optional segments (#4706)
* feat: transform optional routes from remix to react router * Add to contributors * Add changeset * fix(optional-segments): fix escaping of parenthesis * small function fix * Update packages/remix-dev/__tests__/routesConvention-test.ts Co-authored-by: Pedro Cattori <pcattori@gmail.com> Co-authored-by: Pedro Cattori <pcattori@gmail.com>
- Loading branch information
1 parent
07c7dca
commit d7efede
Showing
4 changed files
with
148 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
"@remix-run/dev": minor | ||
--- | ||
|
||
feat: remix optional segments | ||
|
||
Allows for the creation of optional route segments by using parenthesis. For example: | ||
Creating the following file routes in remix `/($lang)/about` | ||
this will match the following routes | ||
``` | ||
/en/about | ||
/fr/about | ||
/about | ||
``` | ||
|
||
helpful for optional language paths. | ||
|
||
Another example `/(one)/($two)/(three).($four)` file routing would match | ||
``` | ||
/ | ||
/one | ||
/one/param1 | ||
/one/param1/three | ||
/one/param1/three/param2 | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,6 +258,7 @@ | |
- lili21 | ||
- lionotm | ||
- liranm | ||
- lordofthecactus | ||
- lpsinger | ||
- lswest | ||
- lucasdibz | ||
|
This file contains 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
This file contains 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