Skip to content

Conversation

@mihar-22
Copy link
Member

@mihar-22 mihar-22 commented Feb 2, 2026

Refs #363

Summary

Refactor @videojs/store to use "slice" terminology instead of "feature", with explicit combine() primitive for composition. This separates generic store concepts from domain-specific player terminology.

Changes

  • Replace "feature" with "slice" in store package (defineSlice, Slice, AnySlice)
  • Add combine() as first-class slice composition primitive
  • Rename createFeatureSelectorcreateSelector
  • Move definePlayerFeature to @videojs/core/dom (= defineSlice<PlayerTarget>())
  • Add Selector and Comparator types to core store
  • Update html/react packages with consistent utility exports
Implementation details

Package layering:

  • @videojs/store — generic primitives: defineSlice, combine, createStore
  • @videojs/core/domdefinePlayerFeature (typed alias for player slices)
  • @videojs/html / @videojs/react — re-export utilities, use combine internally

API change:

// Before
const store = createStore<Target>()({ features: [f1, f2] });

// After  
const store = createStore<Target>()(combine(s1, s2));

Testing

  • pnpm typecheck
  • pnpm test ✓ (461 tests)
  • pnpm lint

- Replace 'feature' with 'slice' terminology in store package
- Add combine() for explicit slice composition
- Rename createFeatureSelector to createSelector
- Move definePlayerFeature to @videojs/core/dom
- Add Selector and Comparator types to core store
- Update html and react packages with consistent exports
@vercel
Copy link

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
vjs-10-website Ignored Ignored Feb 2, 2026 6:27am

Request Review

@mihar-22 mihar-22 changed the title refactor(store)!: rename feature to slice refactor(store): rename feature to slice Feb 2, 2026
@mihar-22 mihar-22 mentioned this pull request Feb 2, 2026
@mihar-22 mihar-22 merged commit a1d0383 into main Feb 2, 2026
4 checks passed
@mihar-22 mihar-22 deleted the refactor/store-explicit-target branch February 2, 2026 06:30
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