Skip to content

fix: convert Tracklist length to a getter and fix event docs#9142

Merged
mister-ben merged 1 commit intovideojs:mainfrom
christriants:update/track-list-js-doc
Jan 13, 2026
Merged

fix: convert Tracklist length to a getter and fix event docs#9142
mister-ben merged 1 commit intovideojs:mainfrom
christriants:update/track-list-js-doc

Conversation

@christriants
Copy link
Copy Markdown
Contributor

@christriants christriants commented Jan 2, 2026

Description

This PR fixes issue #9059 by ensuring the length property is properly exposed in the generated TypeScript definition files for TrackList.

Additionally, this PR fixes a typo, and corrects the @event tag for the labelchange event handler.

Specific Changes proposed

We can convert length to a getter method. By replacing the Object.defineProperty call in the constructor with get length() getter, we can make the property visible to the type generator.

After this change, the generated track-list.d.ts will include get length(): number;.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
    • Has no DOM changes which impact accessiblilty or trigger warnings (e.g. Chrome issues tab)
    • Has no changes to JSDoc which cause npm run docs:api to error
  • Reviewed by Two Core Contributors

@welcome
Copy link
Copy Markdown

welcome Bot commented Jan 2, 2026

💖 Thanks for opening this pull request! 💖

Things that will help get your PR across the finish line:

  • Run npm run lint -- --errors locally to catch formatting errors earlier.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@christriants christriants marked this pull request as ready for review January 2, 2026 01:42
@christriants christriants force-pushed the update/track-list-js-doc branch from e633327 to a012ba9 Compare January 2, 2026 01:44
@christriants christriants changed the title docs: convert Tracklist length to a getter and fix event docs fix: convert Tracklist length to a getter and fix event docs Jan 2, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.31%. Comparing base (ec33990) to head (a012ba9).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9142      +/-   ##
==========================================
- Coverage   84.31%   84.31%   -0.01%     
==========================================
  Files         120      120              
  Lines        8154     8153       -1     
  Branches     1964     1964              
==========================================
- Hits         6875     6874       -1     
  Misses       1279     1279              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mister-ben mister-ben added the needs: LGTM Needs one or more additional approvals label Jan 5, 2026
@amtins
Copy link
Copy Markdown
Contributor

amtins commented Jan 11, 2026

LGTM

@mister-ben mister-ben added patch This PR can be added to a patch release. and removed needs: LGTM Needs one or more additional approvals labels Jan 12, 2026
@mister-ben mister-ben merged commit 46779e8 into videojs:main Jan 13, 2026
12 checks passed
@welcome
Copy link
Copy Markdown

welcome Bot commented Jan 13, 2026

Congrats on merging your first pull request! 🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch This PR can be added to a patch release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants