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

ref(browser): Update supportsHistory check & history usage #14696

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Dec 13, 2024

We had some elaborate check in there for window.history which is based on very old (~2016) issues, which should not be an issue anymore in versions we support today. So we can streamline this quite a bit!

Additionally, I also rewrote code that used window.onpushstate to instead of window.addEventListener('pushstate'), plus also added code to ensure we do not emit history changes multiple times, which may be possible (?).

This is on v9 branch.

@mydea mydea requested review from Lms24 and AbhiPrasad December 13, 2024 09:51
@mydea mydea self-assigned this Dec 13, 2024
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

github-actions bot commented Dec 13, 2024

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 23.24 KB -0.21% -49 B 🔽
@sentry/browser - with treeshaking flags 21.91 KB -0.25% -55 B 🔽
@sentry/browser (incl. Tracing) 35.73 KB -0.17% -62 B 🔽
@sentry/browser (incl. Tracing, Replay) 72.98 KB -0.07% -48 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 63.36 KB -0.08% -50 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 77.4 KB -0.07% -49 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 89.79 KB -0.06% -46 B 🔽
@sentry/browser (incl. Feedback) 39.99 KB -0.12% -48 B 🔽
@sentry/browser (incl. sendFeedback) 27.85 KB -0.17% -47 B 🔽
@sentry/browser (incl. FeedbackAsync) 32.63 KB -0.18% -57 B 🔽
@sentry/react 25.92 KB -0.17% -44 B 🔽
@sentry/react (incl. Tracing) 38.56 KB -0.12% -45 B 🔽
@sentry/vue 27.44 KB -0.17% -46 B 🔽
@sentry/vue (incl. Tracing) 37.58 KB -0.12% -45 B 🔽
@sentry/svelte 23.41 KB -0.18% -43 B 🔽
CDN Bundle 24.38 KB -0.21% -52 B 🔽
CDN Bundle (incl. Tracing) 37.41 KB -0.13% -49 B 🔽
CDN Bundle (incl. Tracing, Replay) 72.5 KB -0.07% -46 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 77.87 KB -0.1% -72 B 🔽
CDN Bundle - uncompressed 71.58 KB -0.23% -168 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 110.88 KB -0.15% -168 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 224.93 KB -0.08% -168 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 238.15 KB -0.07% -168 B 🔽
@sentry/nextjs (client) 38.82 KB -0.14% -52 B 🔽
@sentry/sveltekit (client) 36.24 KB -0.13% -48 B 🔽
@sentry/node 162.76 KB - -
@sentry/node - without tracing 98.9 KB - -
@sentry/aws-serverless 126.64 KB - -

View base workflow run

@mydea mydea force-pushed the fn/remove-chrome-window-check branch from fe76964 to cc7dc32 Compare December 13, 2024 10:43
@mydea mydea force-pushed the fn/remove-chrome-window-check branch from cc7dc32 to b034c35 Compare December 13, 2024 11:52
Copy link

codecov bot commented Dec 13, 2024

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
693 3 690 300
View the top 3 failed tests by shortest run time
feedback/attachTo/test.ts should capture feedback with custom button
Stack Traces | 30s run time
test.ts:6:11 should capture feedback with custom button
feedback/captureFeedback/test.ts should capture feedback
Stack Traces | 30s run time
test.ts:6:11 should capture feedback
feedback/captureFeedbackAndReplay/hasSampling/test.ts should capture feedback
Stack Traces | 30s run time
test.ts:12:11 should capture feedback

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Change LGTM! But I think the diff got messed up during the rebase.

@mydea mydea changed the base branch from v9 to develop December 16, 2024 07:54
@mydea mydea changed the base branch from develop to v9 December 16, 2024 07:54
@mydea mydea changed the base branch from v9 to develop December 16, 2024 07:55
@mydea mydea force-pushed the fn/remove-chrome-window-check branch from b034c35 to bbefd73 Compare December 16, 2024 07:55
@mydea mydea enabled auto-merge (squash) December 16, 2024 07:56
@mydea mydea merged commit 8fa14aa into develop Dec 16, 2024
158 checks passed
@mydea mydea deleted the fn/remove-chrome-window-check branch December 16, 2024 08:11
AbhiPrasad pushed a commit that referenced this pull request Mar 5, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…tory API (#15576)

In #14696 an early
`return` was introduced that alters the default behavior of the
underlying history API that is being patched.

Instead of just returning, the original/underlying function should be
called to keep the default behavior.
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

3 participants