breaking: exclude directories without a +page or +server from RouteId - #16580
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/3c9ef02321988d78d10d352c8df83fd4c9677b00Open in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
🦋 Changeset detectedLatest commit: 3c9ef02 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 |
Rich-Harris
left a comment
There was a problem hiding this comment.
yep, this makes sense. thank you!
|
(it's still marked draft — is that intentional?) |
|
I needed to review something I noticed last night, after I got some sleep. Will update in a couple min |
|
Sorry, I thought this solved a different issue but #16588 might have solved the same issue. The type tests look like they're worth carrying over though (if the one I opened even works) EDIT: the type stuff might solve something different though? |
|
No worries! Yeah, layout-only directories survive #16588's filter, so they still land in |
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 `routes` that would likely return a 404 (no page, no endpoint, etc.). Some additional fixes are that `LayoutParams` only 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: - [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] This message body should clearly illustrate what problems it solves. - [x] Ideally, include a test that fails without this PR but passes with it. ### Tests - [ ] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check` ### Changesets - [ ] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. Changesets that add features should be `minor` and those that fix bugs should be `patch`. Please prefix changeset messages with `feat:`, `fix:`, or `chore:`. ### Edits - [ ] Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.
d8617b3
into
sveltejs:version-3
Closes #14847. #15027 fixed the
Pathhalf of that issue; theRouteIdunion still lists every directory, soresolve('/a')type-checks when/aonly holds child routes.LayoutParamsnow keys off the generated layout map instead ofRouteId, and a layout sitting in a directory that isn't a route stops claiming its own id inLayoutRouteId.resolve('/')stops type-checking in an app whose root page lives in a group, since/(app)is the route that serves/. Writeresolve('')instead.#16588 covers the
$app/manifestside. Also points #16588'sroutesfilter atis_app_routeso the two stay in sync, and rewords its changeset to cover the #5793 fix.