Skip to content

Conversation

@luwes
Copy link
Collaborator

@luwes luwes commented Jul 16, 2025

fix #1962
fix #1958
closes #1963 thanks @QuinnStraus

removes deepmerge as it was causing infinite loops via circulare references for React vnodes

@luwes luwes requested a review from Copilot July 16, 2025 20:59
@luwes luwes self-assigned this Jul 16, 2025
@luwes luwes temporarily deployed to github-preview July 16, 2025 20:59 — with GitHub Actions Inactive
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the deepmerge dependency to address circular references when merging React vnode props, switching to a shallow spread merge approach.

  • Replace merge(defaultProps, _props) with { ...defaultProps, ..._props } in ReactPlayer.tsx
  • Remove deepmerge import and dependency
  • Delete generated tsconfig.tsbuildinfo from version control

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/ReactPlayer.tsx Swap out deepmerge for object spread, streamline JSX and wrappers
package.json Remove deepmerge from dependencies
tsconfig.tsbuildinfo Delete auto-generated build info file
Comments suppressed due to low confidence (1)

const ReactPlayer: ReactPlayer = React.forwardRef(({ children, ..._props } , ref) => {
const props = merge(defaultProps, _props);
const ReactPlayer: ReactPlayer = React.forwardRef((_props, ref) => {
const props = { ...defaultProps, ..._props };
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

Shallow merging props will overwrite nested default objects (e.g., config) instead of merging them. Consider deep merging specific sub-properties like config to preserve nested defaults, for example: config: { ...defaultProps.config, ..._props.config }.

Suggested change
const props = { ...defaultProps, ..._props };
const props = {
...defaultProps,
..._props,
config: { ...defaultProps.config, ..._props.config },
};

Copilot uses AI. Check for mistakes.
}
config={config}
>{children}</Player>
/>
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

The children prop is no longer forwarded to the Player component, which may break nested content rendering. Reintroduce children support by passing {children} into the Player tag or handling it in the wrapper.

Suggested change
/>
>
{children}
</Player>

Copilot uses AI. Check for mistakes.
@luwes luwes merged commit e6dfda5 into master Jul 16, 2025
12 checks passed
@luwes luwes deleted the fix-merge-circular branch July 16, 2025 21:02
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.

Setting fallback prop to a react element causes"Maximum call stack size exceeded" error Setting playIcon prop causes Runtime Error

2 participants