This PR it keeps the root.tsx as we had it but adds an <Outlet/> so it shows:
the index.tsx from _marketing/index.tsx on the / page (since the _ prefix indicates it’s not a real routing folder),
a static page on /cases/,
and the case number 123 on /cases/123 , that is literally it just prints 123 or whatever variable is in the route for now.
Because <CaseSummary/> was retained on root.tsx for now, it always displays. I believe @jkoren has a revision that moves that to a subroute which will be done after this one.
(Note these filenames are examples from the conventions document, not this project)
If you're familiar with the Remix routing convention, just think of it this way, remix-flat-routes converts +/ (that is, folder ending in plus sign) to ..
"Layout" refers to how the parent layouts should apply.
filename
convention
behavior
privacy.jsx
filename
normal route
pages.tos.jsx
dot with no layout
normal route, "." -> "/"
about.jsx
filename with children
parent layout route
about.contact.jsx
dot
child route of layout
about.index.jsx
index filename
index route of layout
about_.company.jsx
trailing underscore
url segment, no layout
_auth.jsx
leading underscore
layout nesting, no url segment
_auth.login.jsx
leading underscore
child of pathless layout route
users.$userId.jsx
leading $
URL param
docs.$.jsx
bare $
splat route
dashboard.route.jsx
route suffix
optional, ignored completely
investors/[index].jsx
brackets
escapes conventional characters
Routes folder in this early PR version:
```bash
➜ tree heat-stack/app/routes
heat-stack/app/routes
├── $.tsx # splat route: if no other routes match, this one will
├── _auth+ #route as /... ; leading _ means layout nesting, no url segment; remix-flat-routes converts +/ to .
│ ├── auth.$provider.callback.test.ts
│ ├── auth.$provider.callback.ts
│ ├── auth.$provider.ts
│ ├── forgot-password.tsx
│ ├── login.tsx # route as /login
│ ├── logout.tsx
│ ├── onboarding.tsx
│ ├── onboarding_.$provider.tsx
│ ├── reset-password.tsx
│ ├── signup.tsx # route as /signup
│ └── verify.tsx
├── _heat+ #route as /... ; leading _ means layout nesting, no url segment; remix-flat-routes converts +/ to .
│ ├── CaseSummary.tsx # route as /casesummary
│ └── index.tsx # show in for /
├── _marketing+ #route as /... ; leading _ means layout nesting, no url segment; remix-flat-routes converts +/ to .
│ ├── about.tsx # route as /about components appear in on root.tsx
│ ├── index.tsx # this appears in on root.tsx when at /
│ ├── logos # svg's, no code
│ ├── privacy.tsx
│ ├── support.tsx
│ └── tos.tsx
├── _seo+ #leading _ means layout nesting, no url segment; remix-flat-routes converts +/ to .
│ ├── robots[.]txt.ts
│ └── sitemap[.]xml.ts
├── admin+ #route all like /admin/... because remix-flat-routes converts +/ to .
│ ├── cache.tsx
│ ├── cache_.lru.$cacheKey.ts
│ ├── cache_.sqlite.$cacheKey.ts
│ └── cache_.sqlite.tsx
├── cases+ # routes as /cases/... because remix-flat-routes converts +/ to .
│ ├── $analysisid.tsx # routes as /cases/123
│ ├── case_summaries+
│ │ └── $summaryid_+
│ │ └── index.tsx # routes as /cases/case_summaries/123/ (not sure?)
│ └── index.tsx
├── me.tsx # routes like `/me` and code does redirect(`/users/${user.username}`)
├── resources+ #route contents like /resources/... because remix-flat-routes converts +/ to .
│ ├── download-user-data.tsx
│ ├── healthcheck.tsx
│ ├── note-images.$imageId.tsx
│ └── user-images.$imageId.tsx
├── settings+ #route contents like /settings/... because remix-flat-routes converts +/ to .
│ ├── profile.change-email.tsx # routes like /settings/profile/change-email
│ ├── profile.connections.tsx
│ ├── profile.index.tsx # /settings/profile (we can call this profile's index route—will be surrounded by profile.tsx layout)
│ ├── profile.password.tsx
│ ├── profile.password_.create.tsx
│ ├── profile.photo.tsx
│ ├── profile.tsx # /settings/profile (we can call this a layout—it has
│ ├── profile.two-factor.disable.tsx # routes like /settings/two-factor/disable
│ ├── profile.two-factor.index.tsx
│ ├── profile.two-factor.tsx
│ └── profile.two-factor.verify.tsx
└── users+ #route contents like /users/
├── $username.test.tsx # is a test, not routed?
├── $username.tsx
├── $username_+ #routes like /users/kody/...
│ ├── __note-editor.tsx
│ ├── notes.$noteId.tsx
│ ├── notes.$noteId_.edit.tsx # routes like /users/kody/notes/123/edit
│ ├── notes.index.tsx # routes like /users/kody/notes
│ ├── notes.new.tsx
│ └── notes.tsx # routes like /users/kody/notes
└── index.tsx
```
➜ tree heat-stack/app/routes
heat-stack/app/routes
├── $.tsx # splat route: if no other routes match, this one will
├── _auth+ #route as /... ; leading _ means layout nesting, no url segment; converts +/ to .
│ ├── auth.$provider.callback.test.ts
│ ├── auth.$provider.callback.ts
│ ├── auth.$provider.ts
│ ├── forgot-password.tsx
│ ├── login.tsx # route as /login
│ ├── logout.tsx
│ ├── onboarding.tsx
│ ├── onboarding_.$provider.tsx
│ ├── reset-password.tsx
│ ├── signup.tsx # route as /signup
│ └── verify.tsx # route as /verify
├── _heat+ #route as /... ; leading _ means layout nesting, no url segment; converts +/ to .
│ ├── CaseSummary.tsx # route as /casesummary
│ └── index.tsx # show in for /
├── _marketing+ #route as /... ; leading _ means layout nesting, no url segment; converts +/ to .
│ ├── about.tsx # route as /about components appear in on root.tsx
│ ├── epicstack.tsx # this appears in on root.tsx for /signup
│ ├── logos # svg's, no code
│ ├── privacy.tsx
│ ├── support.tsx
│ └── tos.tsx
├── _seo+ #leading _ means layout nesting, no url segment; converts +/ to .
│ ├── robots[.]txt.ts /robots.txt
│ └── sitemap[.]xml.ts /sitemap.xml
├── admin+ #route all like /admin/... because converts +/ to .
│ ├── cache.tsx /admin/cache
│ ├── cache_.lru.$cacheKey.ts
│ ├── cache_.sqlite.$cacheKey.ts
│ └── cache_.sqlite.tsx
├── cases+ # routes as /cases/... because converts +/ to . /cases
│ ├── $analysisid.tsx # routes as /cases/123 /cases/123
│ ├── case_summaries+
│ │ └── $summaryid_+
│ │ └── index.tsx # routes as /cases/case_summaries/123/ (not sure?) /cases/case_summaries/123
│ └── index.tsx
├── me.tsx # routes like `/me` and code does redirect(`/users/${user.username}`) a href="https://heat-stack.fly.dev/me">/me
├── resources+ #route contents like /resources/... because remix-flat-routes converts +/ to .
│ ├── download-user-data.tsx /resources/download-user-data
│ ├── healthcheck.tsx /resources/healthcheck
│ ├── note-images.$imageId.tsx
│ └── user-images.$imageId.tsx
├── settings+ #route contents like /settings/... because remix-flat-routes converts +/ to .
│ ├── profile.change-email.tsx # routes like /settings/profile/change-email
│ ├── profile.connections.tsx
│ ├── profile.index.tsx # /settings/profile/ (we can call this profile's index route—will be surrounded by profile.tsx layout)
│ ├── profile.password.tsx
│ ├── profile.password_.create.tsx
│ ├── profile.photo.tsx
│ ├── profile.tsx # /settings/profile/ (we can call this a layout—it has
│ ├── profile.two-factor.disable.tsx # routes like /settings/two-factor/disable
│ ├── profile.two-factor.index.tsx
│ ├── profile.two-factor.tsx
│ └── profile.two-factor.verify.tsx
└── users+ #route contents like /users/
├── $username.test.tsx # is a test, not routed?
├── $username.tsx
├── $username_+ #routes like /users/kody/....
│ ├── __note-editor.tsx
│ ├── notes.$noteId.tsx
│ ├── notes.$noteId_.edit.tsx # routes like /users/kody/notes/123/edit
│ ├── notes.index.tsx # routes like /users/kody/notes (we can call this profile's index route—will be surrounded by profile.tsx layout)
│ ├── notes.new.tsx
│ └── notes.tsx # routes like /users/kody/notes (we can call this a layout—it has
└── index.tsx
This PR it keeps the
root.tsx
as we had it but adds an<Outlet/>
so it shows:_marketing/index.tsx
on the/
page (since the_
prefix indicates it’s not a real routing folder),/cases/
,123
on/cases/123
, that is literally it just prints123
or whatever variable is in the route for now.Because
<CaseSummary/>
was retained onroot.tsx
for now, it always displays. I believe @jkoren has a revision that moves that to a subroute which will be done after this one.See also:
remix-flat-routes File system routing conventions (full doc link)
remix-flat-routes
converts+/
(that is, folder ending in plus sign) to.
.privacy.jsx
pages.tos.jsx
about.jsx
about.contact.jsx
about.index.jsx
about_.company.jsx
_auth.jsx
_auth.login.jsx
users.$userId.jsx
docs.$.jsx
dashboard.route.jsx
investors/[index].jsx
Routes folder in this early PR version: