-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix the issue with history.state resetting on refresh #12409
base: main
Are you sure you want to change the base?
Conversation
Fix the issue with history.state resetting on refresh
|
this seems to be an area that's difficult to get right, so I'd really want to have a test for this one |
The maintainers probably haven't discussed this yet, but I think this should be optional as Rich mentioned in the issue. |
I don't understand. Why should the framework's default behavior be to block the implementation of basic browser functionality? If a user is building a complex multi-page signup process, they can use history.state to store personal information within the history to preserve it even after a refresh without relying on a store. This history.state can store not only simple objects but also data like files selected through a form. Blocking this forces the use of localstorage. It's natural that this doesn't work in SSR since it's a browser feature. Isn't it up to the developers using this framework to handle such implementations? The current implementation in Kit2 blocks this, taking away the user's choice. Our service has been unable to upgrade to Kit2 since last year due to this issue. |
The current behavior of SvelteKit 2, which resets Blocking basic browser functionality imposes unnecessary constraints on developers. While it is understandable that Moreover, the current implementation in SvelteKit 2 lacks the necessary flexibility. Instead of enforcing specific functionalities, the framework should allow developers to make their own choices. This flexibility is crucial for supporting a wide range of use cases. The inability of certain services to upgrade to SvelteKit 2 due to this restriction highlights the real problems this limitation can cause. Overall, the current implementation of SvelteKit 2, which restricts the use of |
Fix the issue with history.state resetting on refresh
#11956
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits