Skip to content

[fix] avoid unnecessary $page store updates#8457

Merged
Rich-Harris merged 1 commit intomasterfrom
page-store
Jan 11, 2023
Merged

[fix] avoid unnecessary $page store updates#8457
Rich-Harris merged 1 commit intomasterfrom
page-store

Conversation

@dummdidumm
Copy link
Copy Markdown
Member

@dummdidumm dummdidumm commented Jan 11, 2023

Clicking a page link and staying on the same page with nothing changing still changed the $page.store, because

  • form was always !== undefined (it's null)
  • $page.error was set to undefined after hydration, but it should be null

No test because it's super silly to e2e test this - we really need client.js to be unit-testable.
Discovered while investigating another issue which is no longer reproducible.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • 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
  • This message body should clearly illustrate what problems it solves.
  • 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. All changesets should be patch until SvelteKit 1.0

Clicking a page link and staying on the same page with nothing changing still changed the $page.store, because
- form was always !== undefined (it's null)
- $page.error was set to undefined after hydration, but it should be null
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 11, 2023

🦋 Changeset detected

Latest commit: 4826e2f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit 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

@Rich-Harris Rich-Harris merged commit ce02847 into master Jan 11, 2023
@Rich-Harris Rich-Harris deleted the page-store branch January 11, 2023 16:25
@github-actions github-actions Bot mentioned this pull request Jan 11, 2023
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