-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
🗺 Flat Routes #4483
Milestone
Comments
@kiliman has offered to send a PR :) |
Yes I’ll be back from Thanksgiving vacation on Monday.
|
Initial PR #4716 |
kiliman
added a commit
to kiliman/remix
that referenced
this issue
Dec 13, 2022
mcansh
pushed a commit
that referenced
this issue
Dec 14, 2022
mcansh
pushed a commit
that referenced
this issue
Dec 20, 2022
mcansh
added a commit
that referenced
this issue
Jan 5, 2023
* feat: add flat routes convention Closes #4483 * chore: include future v2_routeConvention flag Integrates flat routes function into config * fix: update readConfig test to include new v2_routeConvention flag * fix: replace default route dir Oops! * chore: slim Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: remove unused eslint-disable coment Signed-off-by: Logan McAnsh <logan@mcan.sh> chore: use invariant instead of enforcing the type Signed-off-by: Logan McAnsh <logan@mcan.sh> chore: use for...of Signed-off-by: Logan McAnsh <logan@mcan.sh> chore: remove .route Signed-off-by: Logan McAnsh <logan@mcan.sh> chore: use _index for index routes Signed-off-by: Logan McAnsh <logan@mcan.sh> chore: replace magic characters with defined variable Signed-off-by: Logan McAnsh <logan@mcan.sh> fix: update default parentRoutePath Signed-off-by: Logan McAnsh <logan@mcan.sh> test: add test cases from old route convention Signed-off-by: Logan McAnsh <logan@mcan.sh> chore: update handling of special characters Signed-off-by: Logan McAnsh <logan@mcan.sh> chore: export route convention helpers Signed-off-by: Logan McAnsh <logan@mcan.sh> chore(flat-routes): add support for optional and escape route segments Signed-off-by: Logan McAnsh <logan@mcan.sh> chore(flat-routes): add support for optional and escape route segments Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore(flat-routes): add support for optional and escape route segments Signed-off-by: Logan McAnsh <logan@mcan.sh> * initial import Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: index routes use underscores Signed-off-by: Logan McAnsh <logan@mcan.sh> * feat: add support for optional segments Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: flat routes Signed-off-by: Logan McAnsh <logan@mcan.sh> * feat: nested escaping inside optional Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: remove TODO comment Signed-off-by: Logan McAnsh <logan@mcan.sh> * feat: handle opting out of parent layout, but keeping url segment Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: use `isSegmentSeparator` to account for windows paths Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: helpers no longer need to be exported from `routesConvention` Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: don't return separators from `getRouteSegments` Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: rename test Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: don't treat escaped separator as new segment Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: undo some unneeded changes to `routesConvention` Signed-off-by: Logan McAnsh <logan@mcan.sh> chore: undo some unneeded changes to `routesConvention` Signed-off-by: Logan McAnsh <logan@mcan.sh> chore: undo some unneeded changes to `routesConvention` Signed-off-by: Logan McAnsh <logan@mcan.sh> * test: route hierarchy Signed-off-by: Logan McAnsh <logan@mcan.sh> * test: add more test cases Signed-off-by: Logan McAnsh <logan@mcan.sh> * fix: glob Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: handle opting out of layout Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: lil clean Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: more tests, add substate type Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: re-add lookahead/lookbehind when exiting optional/escape modes Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: remove duplicate cases Signed-off-by: Logan McAnsh <logan@mcan.sh> * test: update test name Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: advance char earlier, fix bugggg Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: prevent `/` in route segments Signed-off-by: Logan McAnsh <logan@mcan.sh> * test: update test name Signed-off-by: Logan McAnsh <logan@mcan.sh> * test: add cases for splitBySegments Signed-off-by: Logan McAnsh <logan@mcan.sh> * test: add cases for joinByDelimiter Signed-off-by: Logan McAnsh <logan@mcan.sh> * Update packages/remix-dev/config/flat-routes.ts Co-authored-by: Pedro Cattori <pcattori@gmail.com> * Update packages/remix-dev/config/flat-routes.ts Co-authored-by: Pedro Cattori <pcattori@gmail.com> * Update packages/remix-dev/config/flat-routes.ts Co-authored-by: Pedro Cattori <pcattori@gmail.com> * test: remove duplicate routes should update duplicate route detection by using route path instead of fs path Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: combine jacob's and kiliman's approaches Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: remove console.log Signed-off-by: Logan McAnsh <logan@mcan.sh> * test: add tests for generically creating route paths Signed-off-by: Logan McAnsh <logan@mcan.sh> * test: add case for skipping layouts other than the top level Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: make tests pass on windows Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: use for...of to be consistent Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: for...of on routeMap Co-authored-by: Pedro Cattori <pcattori@gmail.com> * fixup! chore: for...of on routeMap * chore: extract getRouteMap Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: address feedback Co-authored-by: Pedro Cattori <pcattori@gmail.com> Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: set default parentId to "root" in defineRoutes Signed-off-by: Logan McAnsh <logan@mcan.sh> * test: update defineConventionalRoutes test for default root parentId Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: remove comment Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: remove unnecessary else block Co-authored-by: Pedro Cattori <pcattori@gmail.com> Signed-off-by: Logan McAnsh <logan@mcan.sh> * test: update defineRoutes test per 4779e24 Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: add brief description of what each state/substate means Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: remove nesting via early return Co-authored-by: Pedro Cattori <pcattori@gmail.com> * chore: condense state/substate Co-authored-by: Pedro Cattori <pcattori@gmail.com> Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: update routePaths to account for folders Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: error when escaping `:` or `*` Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: remove console.log Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: include routeId in error message Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: error when using `:` or `*`, not just escaping Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: normalize error messages, move tests to getRouteSegments Signed-off-by: Logan McAnsh <logan@mcan.sh> Signed-off-by: Logan McAnsh <logan@mcan.sh> Co-authored-by: kiliman <kiliman@gmail.com> Co-authored-by: Pedro Cattori <pcattori@gmail.com>
merged! |
Awesome! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
An improved file system route convention to help route visibility and module co-location.
Progress
Community Implementation
https://github.com/kiliman/remix-flat-routes
The text was updated successfully, but these errors were encountered: