Repository navigation
fix(frontend): Polyfill ES2023 array methods for older WebKit engines - #132110
Open
sentry[bot] wants to merge 2 commits into
Open
sentry[bot] wants to merge 2 commits into
sentry[bot] wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1e5a848. Configure here.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
On older engines (such as iOS 15 WebKit on Safari and Chrome for iOS), the login page crashes inside
GuideStore.updateCurrentGuide()withTypeError: r.toSorted is not a function.Although our swc loader injects core-js polyfills in
usagemode, it targetsbrowserslist.productionfrompackage.json, which only covers the last 3 iOS major versions (iOS 16+). Because all supported targets have native implementations, no polyfill fortoSorted(or related ES2023+ methods liketoReversed,toSpliced,with,findLast,Object.groupBy, andMap.groupBy) is ever injected, causing immediate crashes at startup.Solution
static/app/utils/polyfills.tsexplicitly importing core-js polyfills fortoSorted,toReversed,toSpliced,with,findLast,findLastIndex,Object.groupBy, andMap.groupBy(core-js safely no-ops on browsers that already implement them).sentry/utils/polyfillsas the very first import instatic/app/utils/setupStatics.tsx, which runs before any app code in theappandgsAdminentrypoints.knip.config.tsfor thestatic/appworkspace so knip knowscore-jsis now directly referenced rather than purely SWC-injected.Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
Fixes JAVASCRIPT-3GGD
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry. You can adjust this setting at any time.