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

Update history.pushState in navigation-events.js #1092

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from

Conversation

MrLogaz
Copy link

@MrLogaz MrLogaz commented Feb 6, 2023

In my Vue3 application, the router worked incorrectly if the parameters were null, null When following the recommendations, everything works well. https://developer.mozilla.org/en-US/docs/Web/API/History/pushState

In my Vue3 application, the router worked incorrectly if the parameters were null, null
When following the recommendations, everything works well. https://developer.mozilla.org/en-US/docs/Web/API/History/pushState
@github-actions
Copy link

github-actions bot commented Feb 6, 2023

File size impact

dist (-32 bytes)
Overall impact on dist files size
Diff master after merge
-32 328,911 328,879
Detailed impact on dist files size
File Diff master after merge Event
lib/es2015/single-spa.dev.js -4 55,183 55,179 changed
lib/es2015/single-spa.min.js -4 18,398 18,394 changed
lib/esm/single-spa.dev.js -4 59,418 59,414 changed
lib/esm/single-spa.min.js -4 20,844 20,840 changed
lib/system/single-spa.dev.js -4 69,374 69,370 changed
lib/system/single-spa.min.js -4 20,871 20,867 changed
lib/umd/single-spa.dev.js -4 63,718 63,714 changed
lib/umd/single-spa.min.js -4 21,105 21,101 changed
Impact on dist files cache

8 files in you users cache are now outdated because their content have changed.

Bytes outdated
328,911
Generated by file size impact during file-size-impact#4102154311

Copy link
Member

@joeldenning joeldenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the kind of change that could subtly alter behavior in weird ways. Ideally we'd test it in every supported browser - Internet Explorer especially.

@@ -58,7 +58,7 @@ export function navigateToUrl(obj) {
window.location.hash = destination.hash;
} else {
// different path, host, or query params
window.history.pushState(null, null, url);
window.history.pushState({}, '', url);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this code might overwrite history.state to {} rather than keeping it at the previous value. I don't know if null is any better, but would like to fully understand the implications of this change and ideally see tests for it.

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.

None yet

2 participants