Skip to content

fix(player) Export provider classes#1425

Closed
artrixdotdev wants to merge 1 commit intovidstack:mainfrom
artrixdotdev:patch-1
Closed

fix(player) Export provider classes#1425
artrixdotdev wants to merge 1 commit intovidstack:mainfrom
artrixdotdev:patch-1

Conversation

@artrixdotdev
Copy link
Copy Markdown

Related:

Description:

Removes type export and just exports the raw provider class so it can be used and extended in other custom providers

Ready?

yes

Anything Else?

Review Process:

Removes type export and just exports the raw provider class so it can be used and extended in custom providers
@mihar-22
Copy link
Copy Markdown
Member

mihar-22 commented Sep 14, 2024

Thanks for the PR! The providers are only type exports on purpose and tightly integrated into our own component system. They're not designed to be extended. Also providers are lazy loaded, if we export them then they will all be bundled which will unnecessarily increase bundle size for a lot of users as they don't use all providers.

@mihar-22 mihar-22 closed this Sep 14, 2024
@artrixdotdev
Copy link
Copy Markdown
Author

This makes total sense! But I think that it would still be useful to export the providers somehow using something like "import {} from "vidstack/providers/video" which wouldn't be included in anyone's bundle unless they directly import it. I believe that the provider model should be allowed to be extended because I don't see anything really specific that it's doing that shouldn't allow it to be extended. Especially the video provider. I would love to open another pr for this but your rollup config is confusing and I can't figure out how to export it that way (normally I just edit the package.json exports but that doesn't seem to do anything). If this could be implemented it would be a huge help to more advanced users that need custom video providers and want to integrate with the vidstack api. Hope to see some of this implemented!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants