Repository navigation
fix(store): stop installing react into plain html projects - #9819
Conversation
`react-compiler-runtime` requires `react` as a peer, so npm installed React into every `@videojs/html` app through `@videojs/store`. Drop the compiler from store's three hooks and memoize them by hand. `useStore` now keys its callbacks on whether a selector exists, so an inline selector no longer resubscribes every render. Cherry-picked from videojs/v10@0da80c4d8.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vjs-registry ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Claude review: no high-confidence bugs found. |
@videojs/cdn
@videojs/cli
@videojs/core
@videojs/element
@videojs/html
@videojs/media
@videojs/react
@videojs/spf
@videojs/store
@videojs/utils
video.js
@videojs/cloudflare-video
@videojs/dailymotion-video
@videojs/dash-video
@videojs/hlsjs-video
@videojs/mixcloud-audio
@videojs/mux-audio
@videojs/mux-video
@videojs/native-hls-video
@videojs/playerjs-video
@videojs/shaka-video
@videojs/soundcloud-audio
@videojs/spotify-audio
@videojs/tiktok-video
@videojs/twitch-video
@videojs/vimeo-video
@videojs/wistia-video
@videojs/youtube-video
@videojs/google-cast
@videojs/mux-data
commit: |
📦 Bundle Size Report🎨 @videojs/html — no changesPresets (7)
Media (46)
Extensions (3)
Players (5)
Skins (53)
UI Components (63)
⚛️ @videojs/react — 71 small size changes
Presets (7)
Media (46)
Extensions (3)
Players (5)
Skins (34)
UI Components (39)
🧩 @videojs/core — no changesEntries (76)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — 1 small size change
Entries (3)
🔧 @videojs/utils — no changesEntries (13)
📦 @videojs/cdn — no changes📦 @videojs/cloudflare-video — no changes📦 @videojs/dailymotion-video — no changes📦 @videojs/dash-video — no changes📦 @videojs/google-analytics — no changesEntries (2)
📦 @videojs/google-cast — no changes📦 @videojs/hlsjs-video — no changes📦 @videojs/media — no changesEntries (3)
📦 @videojs/mixcloud-audio — no changes📦 @videojs/mux — no changes📦 @videojs/mux-audio — no changesEntries (2)
📦 @videojs/mux-data — no changes📦 @videojs/mux-video — no changesEntries (2)
📦 @videojs/native-hls-video — no changes📦 @videojs/playerjs-video — no changes📦 @videojs/shaka-video — no changes📦 @videojs/soundcloud-audio — no changes📦 @videojs/spf — no changesEntries (70)
📦 @videojs/spotify-audio — no changes📦 @videojs/tiktok-video — no changes📦 @videojs/twitch-video — no changes📦 @videojs/other — no changesEntries (3)
📦 @videojs/vimeo-video — no changes📦 @videojs/wistia-video — no changesEntries (2)
📦 @videojs/youtube-video — no changesℹ️ How to interpretEach entry is independently bundled, minified, and brotli-compressed. Initial size includes its static import graph; lazy dynamic chunks are reported separately. Entries are not additive because their dependency graphs overlap. Preset rows represent realistic combined bundles. Changes of 300 B or less across initial, lazy, and total size are collapsed, not discarded. Run |
Closes #9337
Refs #9338
Supersedes #9632
Summary
@videojs/storedepended onreact-compiler-runtime, which requiresreactas a peer. Because@videojs/html→@videojs/core→@videojs/store, every HTML-only install either pulled in React (npm 7+, pnpm) or warned about a missing peer. This removes the compiler from the store package entirely, so there is no runtime and no React reachable from HTML installs.Changes
@videojs/storeno longer depends onreact-compiler-runtime, and its build no longer runs the React Compiler. The publisheddisthas no runtime import.useCallback/useMemo). React 18 and 19 keep working with no extra install.useStorewith an inline selector no longer resubscribes on every render: its callbacks are keyed on whether a selector exists, not on the selector's identity.@videojs/reactis unchanged and still uses the compiler and runtime directly, which the issue allows.Compared with #9632 (runtime as an optional peer), this doesn't require people who import
@videojs/store/reactdirectly to installreact-compiler-runtimethemselves.Implementation details
Cherry-picked from videojs/v10@0da80c4d8 (videojs/v10#3113, closed before the repo move).
useSnapshotstill resubscribes every render on purpose, as it did under'use no memo': the dialog and menu transition tests in@videojs/reactrely on the snapshot re-check that resubscribing triggers.Testing
useStorekeeps a single subscription across re-renders with an inline selector.pnpm -F @videojs/store test,pnpm -F @videojs/react test,pnpm -F @videojs/html test,pnpm lint,pnpm typecheckall pass.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.