Replies: 1 comment 2 replies
-
Sounds good to me, I like the idea of eg getting everything you need from React with one package UIFor the UI would you be supporting this as well? - import { PlayButton } from "@vidstack/react/headless-ui"
+ import PlayButton from "@vidstack/react/headless-ui/PlayButton" I don't know if this is still valid or if bundlers and tree shaking has moved on since, but I remember this piece of documentation from React Bootstrap about Importing Components from a while back.
import Button from 'react-bootstrap/Button';
// or less ideally
import { Button } from 'react-bootstrap'; Package & folder structureAnother one that might be worth taking a look at to see how they handle Cherry Picking 🍒 and bundling under the hood. Hope this helps 🙏 Thanks for all your work on this 🚀 |
Beta Was this translation helpful? Give feedback.
-
We've recently finished initial work on some tooling and are starting to migrate Vidstack Player over. Release notes will follow when we're done but in the meantime I wanted to propose a new structure for our packages. I'd love to hear any thoughts and suggestions!
Requirements
Our NPM package structure and organization needs to support the following:
vds-media
,vds-play-button
, etc.Current Organization
We currently have the packages organized like so
@vidstack/{product}-{framework}
:@vidstack/player
@vidstack/player-react
Likely Future Packages:
@vidstack/player-{vue,svelte,solid}
@vidstack/analytics
@vidstack/analytics-{react,...}
@vidstack/uploader
Proposed Organization
We've been discussing simplifying the package structure to
@vidstack/{framework}
.vidstack
@vidstack/react
@vidstack/vue
Pros:
npm i @vidstack/react
). With this you'll have access to any current and future products as they're released.vidstack
package as our core and include all base types, utilities, and CSS themes/skins in one place.Cons:
.d.ts
) files.Still thinking if there's any other real concerns...
Package Anatomy
vidstack
import "vidstack/elements/all.js"
import "vidstack/elements/vds-media.js"
.import { Media } from "@vidstack/react";
<script src="cdn.jsdelivr.net/npm/vidstack/all+esm" type="module">
<script src="cdn.jsdelivr.net/npm/vidstack/vds-media+esm" type="module">
UI: default skinned components. Prebuilt components with simple customization options to get you up and running quickly.
import "vidstack/elements/vds-play-button.js"
import { PlayButton } from "@vidstack/react"
Headless UI: today this is the default. We think it'll be easier to onboard if headless isn't the default recommendation... not sure though.
import "vidstack/elements/headless-ui/vds-play-button.js"
import { PlayButton } from "@vidstack/react/headless-ui"
Skins:
import "vidstack/elements/vds-community-skin.js"
import "vidstack/elements/plyr-skin.js"
import { PlyrSkin } from "@vidstack/react"
.Skin Styles
import "vidstack/styles/plyr.css"
import "vidstack/styles/plyr-vars.css"
CSS for skins will follow BEM structure and we won't be using Shadow DOM. This will make it super easy to inspect the UI in devtools and customize as desired.
Examples
Here's some links to existing framework-agnostic OSS packages that we're looking closely at for any inspiration.
Beta Was this translation helpful? Give feedback.
All reactions