shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.45k stars 1.38k forks source link

Migrate to TypeScript #8262

Open joeyparrish opened 1 month ago

joeyparrish commented 1 month ago

This project should migrate to TypeScript. We need to decide how to do this with minimal disruption to the project and to our normal releases.

This will be the top-level issue for tracking this effort and plans for it.

Things to think about:

This should also resolve #6017 and make #8056 obsolete.

MarianoFacundoArch commented 1 month ago

+1 Joey

I believe this shift will bring a host of benefits—improved type safety, better tooling, and enhanced code maintainability. Transitioning to TypeScript can also help us catch errors early, streamline our development process, and ultimately lead to a more robust project. That said, the migration should be approached carefully to minimize disruption. For instance, generating Closure externs from .d.ts could be an effective way to support dependent projects still using Closure. Additionally, maintaining backward compatibility through dual bundles (ES6 and CJS/AMD/) seems like a practical solution, even if it adds some initial complexity. I’m excited to see how it will improve our project’s structure and reliability.

avelad commented 1 month ago
  • Maybe generate Closure externs from .d.ts for dependent projects still using Closure (Does anyone need this?)

Since we're removing Closure, this should be removed too, at least that's my opinion.

loicraux commented 1 month ago

A good time to switch to TypeScript, especially since : https://devblogs.microsoft.com/typescript/typescript-native-port/ 👍🏻