You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature?]: Option for <FileRoutes/> to Ignore some route files or directories #1882
Here the _component1.jsx would be used by multiple pages in this directory (index and subpage) -- and it would not generate a new path in the router, so website.com/path1/_component1 would not exist.
Motivation 🔦
Some of my pages contain more code so I like to split some components into their individual files, but to make well structured, I'd like to store these component files where they are used.
Some other routers in other projects have this functionality but I couldn't find any info for SolidStart.
This would help to keep the code of one functionality in one place.
As long as your component files use named exports and don't use export default, this should already work. FileRoutes only looks for files with a default export.
✔️ I can confirm that if there is no default export, the path doesn't show up in the sitemap.
❔ This is usable but not ideal, in my opinion.
It makes the use of the components less clean.
This effect of default vs. not default exports is obscure, and not self-explanatory - makes understanding the code more difficult. Can be a source of errors, or even a security risk, when a component is exposed inadvertently.
Maybe others have a different opinion on this. I'd still stick to my original proposal, I'd like to see an explicit distinction.
Activity
Brendonovich commentedon Apr 28, 2025
As long as your component files use named exports and don't use
export default, this should already work.FileRoutesonly looks for files with a default export.brenelz commentedon Jul 12, 2025
Any thoughts @Tyg-g about what @Brendonovich said?
Tyg-g commentedon Jul 21, 2025
Thanks for reminding me to return to this topic.
✔️ I can confirm that if there is no
defaultexport, the path doesn't show up in the sitemap.❔ This is usable but not ideal, in my opinion.
It makes the use of the components less clean.
This effect of default vs. not default exports is obscure, and not self-explanatory - makes understanding the code more difficult. Can be a source of errors, or even a security risk, when a component is exposed inadvertently.
Maybe others have a different opinion on this. I'd still stick to my original proposal, I'd like to see an explicit distinction.
Tyg-g commentedon Jul 21, 2025
BTW for anyone interested...
It also seems like that components that are in a
.directory(dot directory) WITH adefaultexport also don't show up.brenelz commentedon Aug 19, 2025
Are you satisified with this solution that we can close this issue?