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

changed native <Link to> to support objects #4483

Merged
merged 1 commit into from
Feb 7, 2017
Merged

changed native <Link to> to support objects #4483

merged 1 commit into from
Feb 7, 2017

Conversation

FreddieRidell
Copy link
Contributor

No description provided.

@timdorr
Copy link
Member

timdorr commented Feb 7, 2017

Thanks!

@timdorr timdorr merged commit f4f0fa3 into remix-run:v4 Feb 7, 2017
@mjackson
Copy link
Member

mjackson commented Feb 7, 2017

Would have loved to see some tests here, but thanks @CodogoFreddie :)

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
brophdawg11 pushed a commit that referenced this pull request Mar 27, 2024
* 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 <[email protected]>

* chore: remove unused eslint-disable coment

Signed-off-by: Logan McAnsh <[email protected]>

chore: use invariant instead of enforcing the type

Signed-off-by: Logan McAnsh <[email protected]>

chore: use for...of

Signed-off-by: Logan McAnsh <[email protected]>

chore: remove .route

Signed-off-by: Logan McAnsh <[email protected]>

chore: use _index for index routes

Signed-off-by: Logan McAnsh <[email protected]>

chore: replace magic characters with defined variable

Signed-off-by: Logan McAnsh <[email protected]>

fix: update default parentRoutePath

Signed-off-by: Logan McAnsh <[email protected]>

test: add test cases from old route convention

Signed-off-by: Logan McAnsh <[email protected]>

chore: update handling of special characters

Signed-off-by: Logan McAnsh <[email protected]>

chore: export route convention helpers

Signed-off-by: Logan McAnsh <[email protected]>

chore(flat-routes): add support for optional and escape route segments

Signed-off-by: Logan McAnsh <[email protected]>

chore(flat-routes): add support for optional and escape route segments

Signed-off-by: Logan McAnsh <[email protected]>

* chore(flat-routes): add support for optional and escape route segments

Signed-off-by: Logan McAnsh <[email protected]>

* initial import

Signed-off-by: Logan McAnsh <[email protected]>

* chore: index routes use underscores

Signed-off-by: Logan McAnsh <[email protected]>

* feat: add support for optional segments

Signed-off-by: Logan McAnsh <[email protected]>

* chore: flat routes

Signed-off-by: Logan McAnsh <[email protected]>

* feat: nested escaping inside optional

Signed-off-by: Logan McAnsh <[email protected]>

* chore: remove TODO comment

Signed-off-by: Logan McAnsh <[email protected]>

* feat: handle opting out of parent layout, but keeping url segment

Signed-off-by: Logan McAnsh <[email protected]>

* chore: use `isSegmentSeparator` to account for windows paths

Signed-off-by: Logan McAnsh <[email protected]>

* chore: helpers no longer need to be exported from `routesConvention`

Signed-off-by: Logan McAnsh <[email protected]>

* chore: don't return separators from `getRouteSegments`

Signed-off-by: Logan McAnsh <[email protected]>

* chore: rename test

Signed-off-by: Logan McAnsh <[email protected]>

* chore: don't treat escaped separator as new segment

Signed-off-by: Logan McAnsh <[email protected]>

* chore: undo some unneeded changes to `routesConvention`

Signed-off-by: Logan McAnsh <[email protected]>

chore: undo some unneeded changes to `routesConvention`

Signed-off-by: Logan McAnsh <[email protected]>

chore: undo some unneeded changes to `routesConvention`

Signed-off-by: Logan McAnsh <[email protected]>

* test: route hierarchy

Signed-off-by: Logan McAnsh <[email protected]>

* test: add more test cases

Signed-off-by: Logan McAnsh <[email protected]>

* fix: glob

Signed-off-by: Logan McAnsh <[email protected]>

* chore: handle opting out of layout

Signed-off-by: Logan McAnsh <[email protected]>

* chore: lil clean

Signed-off-by: Logan McAnsh <[email protected]>

* chore: more tests, add substate type

Signed-off-by: Logan McAnsh <[email protected]>

* chore: re-add lookahead/lookbehind when exiting optional/escape modes

Signed-off-by: Logan McAnsh <[email protected]>

* chore: remove duplicate cases

Signed-off-by: Logan McAnsh <[email protected]>

* test: update test name

Signed-off-by: Logan McAnsh <[email protected]>

* chore: advance char earlier, fix bugggg

Signed-off-by: Logan McAnsh <[email protected]>

* chore: prevent `/` in route segments

Signed-off-by: Logan McAnsh <[email protected]>

* test: update test name

Signed-off-by: Logan McAnsh <[email protected]>

* test: add cases for splitBySegments

Signed-off-by: Logan McAnsh <[email protected]>

* test: add cases for joinByDelimiter

Signed-off-by: Logan McAnsh <[email protected]>

* Update packages/remix-dev/config/flat-routes.ts

Co-authored-by: Pedro Cattori <[email protected]>

* Update packages/remix-dev/config/flat-routes.ts

Co-authored-by: Pedro Cattori <[email protected]>

* Update packages/remix-dev/config/flat-routes.ts

Co-authored-by: Pedro Cattori <[email protected]>

* test: remove duplicate routes

should update duplicate route detection by using route path instead of fs path

Signed-off-by: Logan McAnsh <[email protected]>

* chore: combine jacob's and kiliman's approaches

Signed-off-by: Logan McAnsh <[email protected]>

* chore: remove console.log

Signed-off-by: Logan McAnsh <[email protected]>

* test: add tests for generically creating route paths

Signed-off-by: Logan McAnsh <[email protected]>

* test: add case for skipping layouts other than the top level

Signed-off-by: Logan McAnsh <[email protected]>

* chore: make tests pass on windows

Signed-off-by: Logan McAnsh <[email protected]>

* chore: use for...of to be consistent

Signed-off-by: Logan McAnsh <[email protected]>

* chore: for...of on routeMap

Co-authored-by: Pedro Cattori <[email protected]>

* fixup! chore: for...of on routeMap

* chore: extract getRouteMap

Signed-off-by: Logan McAnsh <[email protected]>

* chore: address feedback

Co-authored-by: Pedro Cattori <[email protected]>
Signed-off-by: Logan McAnsh <[email protected]>

* chore: set default parentId to "root" in defineRoutes

Signed-off-by: Logan McAnsh <[email protected]>

* test: update defineConventionalRoutes test for default root parentId

Signed-off-by: Logan McAnsh <[email protected]>

* chore: remove comment

Signed-off-by: Logan McAnsh <[email protected]>

* chore: remove unnecessary else block

Co-authored-by: Pedro Cattori <[email protected]>
Signed-off-by: Logan McAnsh <[email protected]>

* test: update defineRoutes test per 4779e2458499d15ba31791ff785cdcdf3b8c92e9

Signed-off-by: Logan McAnsh <[email protected]>

* chore: add brief description of what each state/substate means

Signed-off-by: Logan McAnsh <[email protected]>

* chore: remove nesting via early return

Co-authored-by: Pedro Cattori <[email protected]>

* chore: condense state/substate

Co-authored-by: Pedro Cattori <[email protected]>
Signed-off-by: Logan McAnsh <[email protected]>

* chore: update routePaths to account for folders

Signed-off-by: Logan McAnsh <[email protected]>

* chore: error when escaping `:` or `*`

Signed-off-by: Logan McAnsh <[email protected]>

* chore: remove console.log

Signed-off-by: Logan McAnsh <[email protected]>

* chore: include routeId in error message

Signed-off-by: Logan McAnsh <[email protected]>

* chore: error when using `:` or `*`, not just escaping

Signed-off-by: Logan McAnsh <[email protected]>

* chore: normalize error messages, move tests to getRouteSegments

Signed-off-by: Logan McAnsh <[email protected]>

Signed-off-by: Logan McAnsh <[email protected]>
Co-authored-by: kiliman <[email protected]>
Co-authored-by: Pedro Cattori <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants