Repository navigation
perf(embed): code-split the embed players and upload tracker - #3004
Conversation
…uplicate framer-motion runtime
|
@07rjain is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
| beforeAll(async () => { | ||
| await Promise.all(dynamicImports); | ||
| }); |
There was a problem hiding this comment.
The new next/dynamic mock starts every loader immediately, and beforeAll waits for all of them before rendering. This skips the loading behavior introduced by this PR, so the tests cannot catch problems when a player arrives after EmbedVideo mounts. Keep a loader pending during at least one test, resolve it after rendering, and check that playback events still update the chrome.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/__tests__/unit/embed-video-playback-chrome.test.ts
Line: 201-203
Comment:
**Late loading goes untested**
The new `next/dynamic` mock starts every loader immediately, and `beforeAll` waits for all of them before rendering. This skips the loading behavior introduced by this PR, so the tests cannot catch problems when a player arrives after `EmbedVideo` mounts. Keep a loader pending during at least one test, resolve it after rendering, and check that playback events still update the chrome.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks @07rjain, this is a nice split. It matches what The only open item is Greptile's P2 on The branch is also quite far behind main now (it merges cleanly), so please merge main when you push so CI runs against current code. It needs to reach Greptile 5/5 with green CI before we can merge. You can mention @greptileai in a comment to get a re-review after pushing. Thanks! |
|
Thanks — I agree the P2 is a coverage gap, not evidence that playback chrome is broken: the wrapper handles bubbled playback events, and the existing async-player case checks chrome after the video mounts. One caveat: |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Observe mounted video elements so the start-time seek applies even when metadata loaded before the player ref attaches. Let Player.js bind to existing video markup during hydration and cover cached metadata, ref timing and receiver cleanup.
|
@greptileai please re-review the latest changes on commit 09ba832. The branch includes current main and pending-loader coverage for MP4/HLS playback, start-time seeking and chrome updates. The follow-up fixes also handle metadata already loaded before a delayed player mounts and Player.js binding before its video ref attaches, with cleanup coverage. Validation: all 66 focused tests, repository typecheck and scoped Biome pass. The displayed 4/5 review predates these changes. |
Split out of #2580 (embed player split).
EmbedVideoloads the MP4/HLS player and upload tracker throughnext/dynamic, and usesmotion/reactfor its chrome. The upload tracker is client-only and active uploads start in thefetchingstate, matching the share-page pattern.Delayed player behavior:
The branch includes current main at
3614bdb692af7317c30c0ad7afaa496a6974c2eb, integrating 174 upstream commits without conflicts.Validation: 66 tests passed across five suites: 35 embed playback/branding tests, 11 playback-speed tests, 16 oEmbed tests, two Player.js protocol tests and two receiver mount/cleanup tests. Both cached-metadata regressions and the missing-ref receiver case failed before their fixes and passed afterward. Repository
bun run typecheckand scoped Biome checks passed. No production bundle-size measurement or full production build was run locally.The displayed Greptile 4/5 score was produced on
0feae42ee; the pending-loader coverage finding has been addressed since then. Review of this head and maintainer approval for fork CI remain pending.

Confidence Score: 5/5
The PR appears safe to merge; the previous coverage finding is addressed and no new actionable defects were established.Summary
This PR loads the embed's MP4/HLS players and upload tracker through
next/dynamic, and switches its chrome tomotion/react.The previous and current heads have different merge bases with the target commit, so this review used the full PR diff. Tests, a production build, and browser captures were not run during this review.
Reviews (2) · Last reviewed commit: "fix(embed): initialize delayed players w..." · Reviewed by Greptile