Skip to content

feat: remove page-level loaders from AppShellPageProps#334

Merged
IzumiSy merged 4 commits into
mainfrom
feat/remove-page-loader-from-app-shell-page-props
Jun 25, 2026
Merged

feat: remove page-level loaders from AppShellPageProps#334
IzumiSy merged 4 commits into
mainfrom
feat/remove-page-loader-from-app-shell-page-props

Conversation

@IzumiSy

@IzumiSy IzumiSy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR removes loader from file-based page definitions (Page.appShellPageProps) and makes guards the only source of page-level route behavior in file-based routing. As part of that cleanup, route conversion now derives loaders only from guards, and the Vite plugin schema/validator now rejects loader on appShellPageProps. The docs and changeset have been updated to reflect the breaking change.

Why

loader on file-based pages was accidentally exposed but incomplete:

  • it had no supported way to pass loader data into the page component
  • it conflicted with guards, because an explicit page loader took precedence over the guard-backed loader
  • it was also a mismatch with the programmatic API: Module / Resource carry an internal loader for guard wiring, but defineModule / defineResource do not expose loader as a public input prop
  • removing it restores one consistent model: page-level route behavior comes from guards, not ad hoc loaders

Guard behavior

  • pages using only guards: no behavior change
  • pages using guards + loader: guards now run consistently because the page loader is no longer read

This means the guard story is now simpler and more predictable: if a page declares guards, those guards are what control redirect/404 behavior.

Practical impact

Based on a survey of existing projects, we did not observe current usage of page-level loader in AppShellPageProps, so the practical migration impact should be negligible.

@IzumiSy IzumiSy requested a review from a team as a code owner June 25, 2026 01:09
@IzumiSy IzumiSy changed the title feat\!: remove page-level loaders from AppShellPageProps feat: remove page-level loaders from AppShellPageProps Jun 25, 2026
@IzumiSy IzumiSy self-assigned this Jun 25, 2026
@IzumiSy IzumiSy merged commit 3d48b24 into main Jun 25, 2026
5 checks passed
@IzumiSy IzumiSy deleted the feat/remove-page-loader-from-app-shell-page-props branch June 25, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants