Feature: opt-out prefix (e.g. `_`) to exclude files/folders from `src/routes` resolution
Maintainers usually reply within 1 day
@Varixo is already working on this.
Since Sep 29, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- developer-experience, frontend, web-dev
Research direction
The issue does not name implementation files or tests. Start by locating Qwik City's src/routes resolution entry point and its route-discovery tests; confirm how special filenames, dynamic segments, groups, plugins, and service workers are recognized. Resolve the prefix and nesting semantics, then update documentation and add coverage showing prefixed files and folders are excluded while existing routes remain unchanged.
Written by the indexing model from the issue text.
Description
Feature: opt-out prefix (e.g. _) to exclude files/folders from src/routes resolution
Labels: qwik-city · enhancement · dx
Summary
Qwik City's file-system router treats any folder under src/routes as a potential route segment, and any file matching a special name (index.*, layout*.tsx, index@*.tsx, 404.tsx, 500.tsx, plugin*.ts, service-worker.ts) as routable. This makes colocating route-specific components inside the route folder unsafe: a single accidental index.tsx (copy/paste, scaffolding tool, refactor) silently creates a publicly reachable route.
There is currently no documented way to mark a folder or file as "router-ignored". The only escape is the (group) convention, which still participates in routing — it just hides the segment from the URL.
Other file-system routers solve this with a prefix convention:
| Framework | Ignore convention |
|---|---|
| Next.js (app router) | _folder and _file.tsx are private, never routed |
| SvelteKit | _lib, anything prefixed with _ is ignored |
| Remix | + / _ conventions depending on version |
| TanStack Router | -folder ignored |
Proposal
Add a documented prefix (suggest _, matching Next/SvelteKit) such that:
- Any folder in
src/routeswhose name starts with_is excluded from route resolution, including anyindex.*/layout.tsxinside it. - Any file in
src/routeswhose name starts with_is excluded, even if it would otherwise match a special filename (e.g._index.tsx,_layout.tsx). (group)semantics are unchanged.- Dynamic segments (
[param],[...rest]) and named layouts ([email protected]) are unchanged.
Why it matters
- Enables safe colocation of route-specific components, hooks, styles, tests, and fixtures next to the route they belong to — the dominant pattern in modern React/Vue/Svelte apps.
- Removes the only structural reason teams move logic out of
src/routesinto a parallelsrc/pagesorsrc/featuresmirror tree. - Makes accidental route creation impossible at the framework level instead of requiring custom lint/CI scripts.
- Brings Qwik City in line with peer frameworks, reducing migration friction.
Example
src/routes/
└── product/
└── [id]/
├── index.tsx # /product/:id
├── layout.tsx
└── _components/ # ignored — safe to colocate
├── gallery.tsx
├── price.tsx
└── reviews/
└── index.tsx # NOT a route (parent folder starts with _)
Alternatives considered
(group)folders — still routed, just URL-invisible. Doesn't solve the problem.- Naming discipline (never call a colocated file
index.tsx) — works but is unenforced. - External lockfile / lint script — works but every team has to reinvent it; framework support is the right home.
- Separate
src/componentstree — forces double-maintenance and breaks colocation.
Open questions
- Prefix choice:
_(Next/SvelteKit precedent) vs.-(TanStack) vs.+vs. something Qwik-specific._seems most familiar. - Should the ignore apply to files at any depth, or only direct children of
src/routes? (Suggest: any depth, so a single_components/ignores everything inside.) - Interaction with
plugin@*.tsandservice-worker.tsif someone names them[email protected]— proposal: prefix wins, file is ignored.
Willing to contribute
(Yes/no — your call.) Happy to open a PR if the team agrees on the prefix and semantics.
- Dominant language
- TypeScript
- Stars
- 22.1k
- Forks
- 1.4k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 98
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QwikDev/qwik
-
docs router V2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
DX enhancement V2
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
QwikDev/qwik#8480 · 2 comments ·
Maintainers usually reply within 1 day
-
[🐞] SSG (rc.0+) ignores ssr.noExternal: bundled deps are left external in the new "ssg" environmentOpen
Difficulty 4/5 3-5 days Newbie friendliness 52/100
QwikDev/qwik#9183 · 1 comment ·
Maintainers usually reply within 1 day
-
[🐞] <Pending> child reading a signal from its owner breaks when the owner re-renders (consumerBackRef[_EFFECT_BACK_REF].set is not a function)Possibly taken @intellix claimed this 3 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
[🐞] Async useComputed$ resolved in an out-of-order <Pending> re-runs on the client at the first unrelated re-renderPossibly taken @intellix claimed this 3 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
siyuan-note/siyuan#20313 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
alunduil/projects-v2-sync#14 ·
-
Service process inherits the caller's cwd at first use, holding that folder open on Windows (EBUSY)Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
DevTools page styles leak into the host app in developmentPossibly taken @onmax claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nuxt-modules/better-auth#567 · 1 comment ·
Maintainers usually reply within 1 day