Skip to content

fix: cleanup array prototype monkeypatching #11634

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

Merged
merged 2 commits into from
May 15, 2024
Merged

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented May 15, 2024

Hopefully this fixes #11625

Copy link

changeset-bot bot commented May 15, 2024

⚠️ No Changeset found

Latest commit: 541f46f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dummdidumm
Copy link
Member

Had something more verbose locally, your solution is nicer. Though we should probably also have a symbol on the array prototype to not do any of this again. Reason is that someone could locally patch those methods afterwards, and those patches would get reverted - right now this method is called on every mount/hydrate, and there could be multiple of these methods per app. Using a symbol because using a stable identifier would mean we don't repatch in the REPL and that means the warning would no longer appear because it's not repatching and the previously-patched dev code doesn't emit warnings anymore for some reasons.

@trueadm trueadm merged commit 4f8bba2 into main May 15, 2024
8 checks passed
@trueadm trueadm deleted the cleanup-array-patching branch May 15, 2024 13:08
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.

Svelte 5 playground is freezing
2 participants