Skip to content

fix(v7/cdn): Stop using Object.assign to be ES5 compatible #17080

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

Open
wants to merge 1 commit into
base: v7
Choose a base branch
from

Conversation

mydea
Copy link
Member

@mydea mydea commented Jul 18, 2025

This adds a lint rule to avoid usage of Object.assign (we already have similar rules for other things that are not polyfilled). We can just use object spread instead, which is polyfilled.

Fixes #16970

Replacing #17053 as that stalled on CI somehow...

@mydea mydea requested review from Lms24 and andreiborza July 18, 2025 11:01
@mydea mydea self-assigned this Jul 18, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Optional Parameter Handling Regression

The new object spread syntax ...opts introduces a TypeError when opts is undefined. As opts is an optional parameter (opts?: PerformanceObserverInit), this causes a runtime error when the function is called without the opts argument, unlike the previous opts || {} which safely defaulted to an empty object.

packages/tracing-internal/src/browser/web-vitals/lib/observe.ts#L51-L56

});
po.observe({
type,
buffered: true,
...opts,
} as PerformanceObserverInit);

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

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