Skip to content

feat(packages): add slider core layer#529

Merged
mihar-22 merged 3 commits intomainfrom
feat/slider-core
Feb 13, 2026
Merged

feat(packages): add slider core layer#529
mihar-22 merged 3 commits intomainfrom
feat/slider-core

Conversation

@mihar-22
Copy link
Member

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

ref: #275, #267, #269

Summary

Add the runtime-agnostic core layer for the slider component system — SliderCore, TimeSliderCore, and VolumeSliderCore — plus supporting utilities. This is the foundation that both React and HTML slider components will build on.

Changes

  • @videojs/utils: Add clamp and roundToStep (/number subpath), rafThrottle, isRTL, and fix formatTimeAsPhrase(0) returning empty string
  • @videojs/core: Add SliderCore (generic slider state + ARIA), TimeSliderCore (seek slider with buffer tracking), VolumeSliderCore (volume 0-1 → 0-100 mapping, muted fill)
  • Constants: SliderDataAttrs, TimeSliderDataAttrs, SliderCSSVars for data attributes and CSS custom properties
  • Time slider drag precision: Uses raw sub-second values during drag for smooth scrubbing on mobile/short videos; step snapping only applies to keyboard
Implementation details
  • Domain cores (TimeSliderCore, VolumeSliderCore) use canonical media state types directly (MediaTimeState & MediaBufferState, MediaVolumeState) with Pick<> on state interfaces — no wrapper types
  • Domain cores have their own getTimeState(media, interaction) / getVolumeState(media, interaction) rather than overriding base getState (incompatible signatures)
  • interactive = dragging || pointing || focused
  • bufferedEnd computed internally from media.buffered ranges
  • Design doc and implementation plan updated to reflect all decisions made during implementation

Testing

pnpm -F @videojs/utils test   # 187 tests
pnpm -F @videojs/core test    # 269 tests
pnpm typecheck                # clean

@vercel
Copy link

vercel bot commented Feb 13, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
vjs-10-demo-react Ignored Ignored Feb 13, 2026 2:28pm

Request Review

@netlify
Copy link

netlify bot commented Feb 13, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 3ee9fb9
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/698f34f29ac09300080981ec
😎 Deploy Preview https://deploy-preview-529--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Contributor

📦 Bundle Size Report

Package Size Diff %
@videojs/core 5.37 kB +804 B ████████ +17.1% 🔴
@videojs/element 1.60 kB 0 B ░░░░░░░░ 0%
@videojs/html 8.64 kB +744 B ████░░░░ +9.2% 🔺
@videojs/react 7.75 kB +738 B █████░░░ +10.3% 🔴
@videojs/store 1.94 kB 0 B ░░░░░░░░ 0%
@videojs/utils 2.18 kB +302 B ███████░ +15.6% 🔴

Total: 27.49 kB · +2.53 kB · +10.1%


Entry Breakdown

Subpath sizes are the additional bytes on top of the root entry point, measured by bundling root + subpath together and subtracting the root-only size.

@videojs/core
Entry Base PR Diff %
. 1.97 kB 2.77 kB +820 B +40.6% 🔴
./dom 2.61 kB 2.60 kB -16 B -0.6% 🔽
total 4.59 kB 5.37 kB +804 B +17.1%
@videojs/element
Entry Base PR Diff %
. 817 B 817 B 0 B 0%
./context 823 B 823 B 0 B 0%
total 1.60 kB 1.60 kB 0 B 0%
@videojs/store
Entry Base PR Diff %
. 1.29 kB 1.29 kB 0 B 0%
./html 468 B 468 B 0 B 0%
./react 199 B 199 B 0 B 0%
total 1.94 kB 1.94 kB 0 B 0%
@videojs/utils
Entry Base PR Diff %
./array 104 B 104 B 0 B 0%
./dom 553 B 684 B +131 B +23.7% 🔴
./events 227 B 227 B 0 B 0%
./function 197 B 197 B 0 B 0%
./object 119 B 119 B 0 B 0%
./predicate 265 B 265 B 0 B 0%
./time 465 B 478 B +13 B +2.8% 🔺
./number 158 B 🆕
total 1.88 kB 2.18 kB +302 B +15.6%

ℹ️ How to interpret

Sizes are minified + brotli, measured with esbuild.
Package totals are computed as root size + marginal subpath costs.
Subpath marginal cost = (root + subpath bundled together) − root alone.

Icon Meaning
No change
🔺 Increased ≤ 10%
🔴 Increased > 10%
🔽 Decreased
🆕 New (no baseline)

Run pnpm size locally to check current sizes.

@mihar-22 mihar-22 merged commit 7efee3d into main Feb 13, 2026
11 checks passed
@mihar-22 mihar-22 deleted the feat/slider-core branch February 13, 2026 14:30
@github-actions github-actions bot mentioned this pull request Feb 13, 2026
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.

1 participant