fix: exclude routes without a page/endpoint from routes - #16588
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/4b84425dcef67d4127ae25fb9fc1c182755d8ec0Open in |
🦋 Changeset detectedLatest commit: 4b84425 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Oh I just hit approve on #16580 — does this supersede that PR? |
|
Ah yeah, it solves as much as possible at the |
|
I was actually working on this exact other half last night lol. Thats why its on draft. Seems like we could have both PR's? |
…uteId` (#16580) Closes #14847. #15027 fixed the `Path` half of that issue; the `RouteId` union still lists every directory, so `resolve('/a')` type-checks when `/a` only holds child routes. `LayoutParams` now keys off the generated layout map instead of `RouteId`, and a layout sitting in a directory that isn't a route stops claiming its own id in `LayoutRouteId`. `resolve('/')` stops type-checking in an app whose root page lives in a group, since `/(app)` is the route that serves `/`. Write `resolve('')` instead. #16588 covers the `$app/manifest` side. Also points #16588's `routes` filter at `is_app_route` so the two stay in sync, and rewords its changeset to cover the #5793 fix. --------- Co-authored-by: Elliott Johnson <hello@ell.iott.dev>
alternative to #16580
closes #5793
We already implemented the feature but it has the bug mentioned in that issue. This PR removes route data for directories with no route files and items in
routesthat would likely return a 404 (no page, no endpoint, etc.).Some additional fixes are that
LayoutParamsonly includes paths with layout files. Also, the route data gets considerably smaller for larger projects.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits