muxinc / media-chrome

Custom elements (web components) for making audio and video player controls that look great in your website or app.
https://media-chrome.org
MIT License
1.21k stars 62 forks source link

feat: convert JS files to typescript #931

Closed littlespex closed 2 months ago

littlespex commented 3 months ago

Typescript migration based off of https://github.com/muxinc/media-chrome/pull/925

related #933

vercel[bot] commented 3 months ago

@littlespex is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 75.68922% with 582 lines in your changes missing coverage. Please review.

Project coverage is 69.75%. Comparing base (3ea80df) to head (43678af). Report is 69 commits behind head on main.

Files Patch % Lines
src/js/media-chrome-menu.ts 7.07% 105 Missing :warning:
src/js/utils/utils.ts 57.57% 42 Missing :warning:
src/js/utils/server-safe-globals.ts 72.22% 30 Missing :warning:
src/js/media-chrome-dialog.ts 6.89% 27 Missing :warning:
src/js/media-captions-menu-button.ts 31.57% 26 Missing :warning:
src/js/utils/element-utils.ts 80.45% 25 Missing and 1 partial :warning:
src/js/media-captions-menu.ts 29.41% 24 Missing :warning:
src/js/media-container.ts 62.90% 23 Missing :warning:
src/js/utils/anchor-utils.ts 45.00% 22 Missing :warning:
src/js/media-audio-track-menu.ts 13.04% 20 Missing :warning:
... and 36 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #931 +/- ## ========================================== - Coverage 78.55% 69.75% -8.80% ========================================== Files 59 79 +20 Lines 11080 16573 +5493 Branches 0 842 +842 ========================================== + Hits 8704 11561 +2857 - Misses 2376 4993 +2617 - Partials 0 19 +19 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

littlespex commented 3 months ago

@luwes @cjpillsbury This PR has all of the files converted to TS, and works with server globals.

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
media-chrome ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2024 7:36pm
media-chrome-demo-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2024 7:36pm
media-chrome-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2024 7:36pm
luwes commented 2 months ago

congrats so far, what a massive PR!

nothing too broken that I can see, only I'm seeing an issue with controlbar show / hide on player load https://media-chrome-git-fork-littlespex-task-ts-migration-mux.vercel.app/examples/vanilla/advanced.html

I'll look into this as well. some state issue

luwes commented 2 months ago

maybe one nit is I think there's a few places the types can be inferred, we'd probably want to prefer that if possible down the road to make the code less noisy. not a blocker tough.

littlespex commented 2 months ago

If you have some specific examples I can take a look. One thing to mention is that declarations were added to all public facing APIs to speed up compilation and to be compatible with the isolated-declarations compiler flag.