-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat!: v3 refactor #1886
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
feat!: v3 refactor #1886
Conversation
BREAKING CHANGES: enable Suspense by default, remove environment checks
BREAKING CHANGES: remove CJS and IIFE
update App to use function components, update responsive logic and docs
There was a problem hiding this 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 implements a major refactor for v3 of ReactPlayer with breaking changes in TypeScript, functional components, and updated build, test, and documentation processes. Key changes include the migration from legacy JS class components (removed in src/Player.js) to a new TS function component (src/Player.tsx), updates to examples and migration guides, and adjustments in build and CI/CD scripts.
Reviewed Changes
Copilot reviewed 97 out of 102 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Player.tsx | New TS functional component using forwardRef with updated event logic. |
| src/Player.js | Legacy JS class component removed. |
| src/HtmlPlayer.tsx | Added HTML-based player component for audio/video elements. |
| scripts/tester/tester.js | Updated testing script with minor style and environment modifications. |
| scripts/pre-publish.js & post-publish.js | Removed pre- and post-publish scripts. |
| scripts/builder/builder.js | Updated build configuration to support code splitting. |
| examples/react/src/* | Updated example files to reflect v3 usage and migration of instance methods. |
| README.md & MIGRATING.md | Documentation updated to reflect breaking changes and new configuration details. |
| .github/workflows/* | CI/CD workflows updated to run unified build commands. |
Files not reviewed (5)
- .npmignore: Language not supported
- biome.json: Language not supported
- examples/react/public/App.css: Language not supported
- examples/react/public/index.html: Language not supported
- package.json: Language not supported
Comments suppressed due to low confidence (1)
src/Player.tsx:15
- The variable 'Player' shadows the component name, which can be confusing. Consider renaming it to 'ActivePlayer' to clarify its purpose.
const Player = props.activePlayer;
|
@luwes I think this missed adding a section to They were originally documented in ### Single player imports
As of `v2.2`, the 🔥 __location of single player imports has changed__. Single players are not available in `v2.0` and `v2.1`.
```jsx
// Before
import ReactPlayer from 'react-player/lib/players/YouTube'
// After
import ReactPlayer from 'react-player/youtube'
```Could this be added to the v3 migration guide section? |
|
Another undocumented thing that was a surprise was that many parts of the For example, the Would be good to have a note in the |
|
How can I set forceHLS in version |
|
I don't know - maybe @luwes can chime in here. But I guess the option maybe is not needed anymore? (not sure what that implies about the default behavior) |

See plan at #1843
BREAKING CHANGES: TS, function comps, remove some providers, use media-elements, etc...