TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
7.12k stars 476 forks source link

docs: dirs starting with `-` are excluded from being routes #1516

Closed tmax22 closed 1 week ago

tmax22 commented 1 week ago

Describe the bug

https://github.com/TanStack/router/blob/main/docs/framework/react/guide/file-based-routing.md does not document that dir starting with - are excluded from being routes. this only appears in the examples. please add docs about it.

update: I now notice it is being documented in the section above, but it is quite hidden.

Your Example Website or App

.

Steps to Reproduce the Bug or Issue

.

Expected behavior

.

Screenshots or Videos

No response

Platform

Additional context

No response

TkDodo commented 1 week ago

it should be added here: https://tanstack.com/router/v1/docs/framework/react/guide/file-based-routing#file-naming-conventions

do you want to file a PR ?

schiller-manuel commented 1 week ago

how should this be phrased differently so it's better visible?

currently this is in the documentation:

  • routeFileIgnorePrefix
    • (Optional, Defaults to -) Route files and directories that start with this string will be ignored. By default this is set to - to allow for the use of directories to house related files that do not contain any route files.
SeanCassiere commented 1 week ago

I think this'd just have to be a callout in the options and the file-naming conventions sections about them possibly conflicting with one another.

Additionally, it may not be a bad idea to have the generator throw an error if the routeFilePrefix or routeFileIgnorePrefix use any of the reserved tokens in the file-naming conventions section.

SeanCassiere commented 1 week ago

I think this verbiage in #1519 would be the right amount of 'in your face' for conveying this without sticking out like a sore thumb.