remix-flat-routes
remix-flat-routes copied to clipboard
Usage/documentation questions
In the context of this, what do the following mean?
- What does a underscore prefix on folders mean? Will it match literally to _folder on the URL path (ie it doesn't do anything special?)
- What's the difference between users+ and project? Does the + mean anything if there is no underscore prefix? ie. they should always be used together to have special meaning?
The examples provided is a bit complex and confusing, these are the notes I have on what I deduced, is my understanding correct?
- For folders:
- _foldername+ means folder will be a layout. Folder name will not show up in URL path
- $foldername means foldername will be captured by as a param ($userId/_route.tsx)
- $/_route.tsx means complete wild card.
- For files:
- _filename.tsx prefix for anything means it’s a route file (this file will be rendered)
- Anything else does not get rendered (helpful to organize files close to the layout/route where it is used)
It feels like the conventions here are way better than what is in the original discussion, but I can't be sure exactly what all the rules are. I think the readme could greatly benefit by removing the copy+paste from the original discussion, and just focus on providing one long example with the latest 0.5.1 conventions.
Thanks for the feedback. I agree. I plan on rewriting the docs and giving more concrete examples of the different conventions.
I'm also considering moving to a new package, remix-hybrid-routes
that moves away from the strict flat routes convention in v2. That way there will be no confusion.
I hope to get something out by the end of the week.