vidstack / player

UI components and hooks for building video/audio players on the web. Robust, customizable, and accessible. Modern alternative to JW Player and Video.js.
https://vidstack.io
MIT License
2.07k stars 123 forks source link

Move unplugin to devDependencies #1360

Open codingjoe opened 1 month ago

codingjoe commented 1 month ago

Hi there 👋,

Love what you've been doing here! I noticed that the vidstack package ships with unplugin as a dependency, where it should be a development dependency, right?

https://github.com/vidstack/player/blob/47e01471415aa4f295a24a697f3bcf0eb6af91d5/packages/vidstack/package.json#L44

unplugin has a bunch of dependencies itself, which leads to an even larger number of dependencies being injected into a users' project.

It's a pretty simple fix. If you don't mind, I would be happy to submit a patch.

Cheers! Joe

mihar-22 commented 1 month ago

It's on purpose, tricky to bundle because it supports multiple bundlers. Removing it now will be a breaking change so I'll move it to dev deps in official 1.0 and make it an optional install.

codingjoe commented 1 month ago

OK, interesting. I didn't expect the package to be shipped with build tools. Maybe they can find a new home in bundleDependencies or optionalDependencies?

This isn't really urgent, but I am on a quest to serve everything via ESM loading in the browser. And Django's asset pipeline doesn't play ball with unplugin.

Meanwhile, I can rebundle the package, but I'd still love to see this dependency be optional.

mihar-22 commented 1 month ago

The plugin is completely optional and designed for bundlers (not in-browser). The plugin was designed to help with auto-importing mainly when building a custom player and using various custom elements.

If you're using one of our default layouts then it might be better in this case to select the "no bundler" option. It's a few simple JS and CSS imports.

codingjoe commented 1 month ago

Hi @mihar-22,

Yes, we are using it this way. However, those dependencies need to be imported from somewhere. In our case, we resolve our dependencies into a full importmap to resolve imports inside the browser and serve ESM modules. However, that does include all dependencies. So having a dependency there, that isn't actually used to run the vidstack code, is the issue we are trying to fix here.

I know, not many people currently serve their JavaScript as ESM, but you gotta start somewhere ;)

Cheers, Joe

codingjoe commented 3 weeks ago

If there is anything I can do, to move this along, please don't hesitate to ask. I'd be delighted to help support this project.