Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

larabr
Copy link

@larabr larabr commented Oct 23, 2024

What I did

  1. Polyfill structuredClone to support browsers that do not implement in natively, e.g. Safari below v15.4 (https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone#browser_compatibility)

Copy link

changeset-bot bot commented Oct 23, 2024

🦋 Changeset detected

Latest commit: a876456

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@web/dev-server-core Patch

Not sure what this means? Click here to learn what changesets are.

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

@larabr larabr marked this pull request as draft October 23, 2024 14:10
@larabr larabr force-pushed the patch-3-structured-clone branch from f982b7b to a876456 Compare October 23, 2024 15:04
@larabr larabr marked this pull request as ready for review October 23, 2024 15:05
export function stable (obj, replacer, spacer) {
var target = structuredClone(obj)
var target = ('structuredClone' in globalThis) ? structuredClone(obj) : structuredClonePolyfill(obj)
Copy link
Member

@bashmish bashmish Oct 24, 2024

Choose a reason for hiding this comment

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

normally we recommend to setup polyfills via the polyfills loader plugin for your app/feature
https://github.com/modernweb-dev/web/tree/master/packages/dev-server-polyfill
in this case the API in question is used in the core of WDS itself, so a little bit different situation, but in the long run I think it might still be better to manage polyfills separately using the generic approach, I recommend you to consider that

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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.