Skip to content

better typing for media properties - #20

Merged
Ret2Hell merged 2 commits into
mainfrom
media
May 1, 2026
Merged

Ret2Hell merged 2 commits into
mainfrom
media

Conversation

@Ret2Hell

@Ret2Hell Ret2Hell commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features
    • Exported MediaEventProperties type for improved media event handling capabilities.
    • Enhanced media event tracking API with stricter property type definitions across all media adapters.

@coderabbitai

coderabbitai Bot commented May 1, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Ret2Hell has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 55 minutes and 50 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f065de7d-45d3-4348-ba42-583a4dabb7f5

📥 Commits

Reviewing files that changed from the base of the PR and between 21842e4 and 6e462f1.

📒 Files selected for processing (1)
  • packages/core/src/types.ts
📝 Walkthrough

Walkthrough

The pull request introduces a new MediaEventProperties type to standardize media event metadata across the core package and media adapters. This type extends EventProperties with media-specific optional fields and is exported from the package entrypoint. Media adapter implementations are updated to use this typed interface.

Changes

Cohort / File(s) Summary
Core Type Definition and Export
packages/core/src/types.ts, packages/core/src/index.ts
Introduces MediaEventProperties interface extending EventProperties with optional media-specific fields (provider/video IDs, timing, progress, buffering, seek/completion metrics). Updates MediaAdapterApi.trackMedia() signature to accept MediaEventProperties instead of generic EventProperties. Re-exports new type from package entrypoint.
YouTube Adapter Implementation
packages/media-adapters/youtube/src/lib/events.ts, packages/media-adapters/youtube/src/lib/types.ts
Updates YouTubeMediaAdapterApi.trackMedia() method signature and internal event emission logic to use the new MediaEventProperties type instead of generic EventProperties for runtime-neutral type consistency.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~10 minutes


🐰 A stricter shape for media events, so clean and so tight,
Properties now typed, making adapters just right,
From core to YouTube, consistency springs,
No runtime breaks—just the joy that type-safety brings! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly reflects the main change: introducing MediaEventProperties type to provide better, more specific typing for media event properties across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch media

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 55 minutes and 50 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

sonarqubecloud Bot commented May 1, 2026

Copy link
Copy Markdown

@Ret2Hell
Ret2Hell merged commit 0893d99 into main May 1, 2026
2 checks passed
@Ret2Hell
Ret2Hell deleted the media branch May 1, 2026 11:18
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