Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shallow routing #11307

Merged
merged 34 commits into from
Dec 14, 2023
Merged

Shallow routing #11307

merged 34 commits into from
Dec 14, 2023

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Dec 14, 2023

Closes #2673. This is a continuation of #9847, on top of the version-2 branch. Copying the TODOs from that PR:

  • Add App.PageState and other types
  • remove goto(url, { state })
  • intercept history.pushState and history.replaceState to discourage their use
  • invalidateAll() should probably use $page.url.href rather than location.href, since those two things can now be different
  • fix bugginess around reloads. If you push state and refresh the page, you go to pushed URL (as intended), and hitting the back button will take you to the page you came from, but only because there's special handling for that case. If you push state and click from there to a new page, then reload that page, clicking back twice won't work as expected. Still looking into how to fix this. possibly nuke navigation index history on page reload? unless there's a better way actually i'm not sure what this referred to
  • docs
  • tests

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. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Copy link

changeset-bot bot commented Dec 14, 2023

🦋 Changeset detected

Latest commit: 5c6e6ae

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 Major

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

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.

4 participants