-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Proposal to Adopt TypeScript in Video.js #8901
Comments
👋 Thanks for opening your first issue here! 👋 If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
Hello @hichemfantar! Brightcove and the Video.js collaborators are planning on doing just this! We have struggled for years now to make a 14 year old plain JavaScript project with JSDoc comments play nicely with TypeScript... with very mixed results (obviously). At a high level, it starts with a project we call VHS Next. This will rewrite our playback engine, VHS, in TypeScript. Following that, we will do the same with Video.js itself - along with some significant architectural changes as well. There will be an RFC for that, of course, as well, sometime in 2025. Please feel free to engage with the RFC(s) as they come up and your collaboration would be welcome! |
@misteroneill Thanks for letting me know about the project! |
Introduction
Video.js has been a widely used open-source project that provides a reliable and extensible HTML5 video player for the web. As the ecosystem around JavaScript continues to grow, the need for more robust tools that enhance code quality, scalability, and developer productivity becomes critical. TypeScript, a superset of JavaScript, offers static typing and advanced tooling that can significantly improve the Video.js codebase.
This proposal outlines the benefits, potential challenges, and steps required to adopt TypeScript in Video.js.
Benefits of Adopting TypeScript
Improved Code Quality and Maintenance:
Enhanced Developer Experience:
Scalability:
Better Ecosystem Integration:
Future-Proofing:
Potential Challenges
Initial Migration Effort:
Contributor Adaptation:
Plugin Ecosystem:
Build Configuration Complexity:
tsconfig.json
, type declarations). However, modern build systems like Webpack and Rollup have good TypeScript support, and tools like Babel can help ease the transition.Plan for Migration
The migration can be carried out incrementally to ensure minimal disruption to the existing codebase and the ecosystem.
Phase 1: Tooling Setup (this seems to be done already)
tsconfig.json
) in the Video.js project.Phase 2: Incremental Migration
Phase 3: Full Module Conversion
Phase 4: Ecosystem and Plugin Support
Phase 5: Final Cleanup and Documentation
Conclusion
Adopting TypeScript in Video.js will improve the maintainability, scalability, and reliability of the project. It will enhance developer productivity and contribute to the long-term health of the project by positioning it as a modern, forward-looking library. With a phased approach to migration, the transition can be handled smoothly, minimizing disruption while ensuring the community continues to benefit from the flexibility and extensibility of Video.js.
I believe that this move will help Video.js continue to be a top choice for developers building video experiences on the web.
Let me know if you would like to refine or add any specific details to this proposal!
The text was updated successfully, but these errors were encountered: