kit
kit copied to clipboard
rename `App.PageError` to `App.Error`
closes #6905. This is a breaking change, but I expect it to be very limited in impact.
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.
- [ ] Ideally, include a test that fails without this PR but passes with it.
Tests
- [x] Run the tests with
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
- [x] 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. All changesets should bepatch
until SvelteKit 1.0
🦋 Changeset detected
Latest commit: 2f0f71e800c352415583f1e74782b56798b8bb1b
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
Name | Type |
---|---|
@sveltejs/kit | Patch |
create-svelte | Patch |
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
Do you want to implement the "try to rename that inside src/app.d.ts
during sync" thing I proposed in the issue, or did you decide against it?
I agree with Dominik that it's probably a slippery slope. I think throwing an error telling the user to change it could be good, it just felt like a lot of effort when considering that we don't enforce a specific location for the user to declare those namespaces
We don't but I guess that 90% of the 5% of people that use this have it inside src/app.d.ts
, which is where the starter templates put this, so we could check if that file exists, if yes if it has the app namespace, if yes if it has AppError in there, if yes throw, else do nothing.
Not sure if it matters much, but even if PageError is commented in app.d.ts/js, the error will be produced: error when starting dev server: Error: App.PageError has been renamed to App.Error — please update your src/app.d.ts
// app.d.ts
// interface PageError {}
Mhm yeah that's probably very annoying for everyone who doesn't even use it - probably worth expanding the check to see if it's commented out.