refactor: don't re-export playback-core items#204
Closed
gkatsev wants to merge 1 commit into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There shouldn't be a need to re-export items from playback-core through mux-video. mux-player can import them directly. Don't re-export in mux-audio either. Additionally, don't export getVideoProperties from mux-player.
Codecov Report
@@ Coverage Diff @@
## main #204 +/- ##
=======================================
Coverage 82.00% 82.01%
=======================================
Files 37 37
Lines 3863 3858 -5
Branches 129 129
=======================================
- Hits 3168 3164 -4
+ Misses 688 687 -1
Partials 7 7
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up from #191. One of the issues is that older bundlers have some trouble with esm that does both default export and named exports. In addition, we no longer need to re-export some of these since we can import directly from playback-core without worrying about duplication of modules in bundles.
This doesn't necessarily have to make it in, particularly since it's a potentially breaking change, though, unlikely that anyone depends on these changes.
One thing that this PR doesn't address is the fact that native CJS users still need to use
require('@mux-elements/mux-player).default. Unfortunately, while we can fix the actual export, fixing the types so that they work for both esm and cjs without any more work is complicated. We should consider whether we should be doing default exports and if we should only do named exports.