Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): fix and improve component ready callback definition #8766

Merged
merged 2 commits into from
Jul 6, 2024

Conversation

mister-ben
Copy link
Contributor

  • Removes erroneous @return {Component} from ReadyCallback in Component
  • Remove @this {Component} from ReadyCallback in Component, because this is not accurate for classes that extend Component
  • Adds @returns {void} to ReadyCallback in Component
    • Produces a more accurate typedef
    • Isn't strictly accurate in jsdoc/javascript but does this matter since it's well understood. Absence of @return is interpreted by tsc as returning {any}, @returns {undefined} would require an explicit return undefined in ts.
  • Adds a {PlayerReadyCallback} in Player with @this {Player} used in the new Player() and videos() constructors.
    • Are we ok adding this new typedef
    • Is inconsistent with player.ready() which uses ReadyCallback without @this - but this can't be changed without adding an otherwise unnecessary override just to pander to tsc.

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

@mister-ben mister-ben added the needs: discussion Needs a broader discussion label Jun 12, 2024
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.01%. Comparing base (a10d258) to head (d34cb90).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8766   +/-   ##
=======================================
  Coverage   83.01%   83.01%           
=======================================
  Files         119      119           
  Lines        7993     7993           
  Branches     1922     1923    +1     
=======================================
  Hits         6635     6635           
  Misses       1358     1358           

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

@mister-ben mister-ben changed the title fix: improve component ready fix(types): fix and improve component ready callback definition Jun 24, 2024
@mister-ben mister-ben added needs: LGTM Needs one or more additional approvals and removed needs: discussion Needs a broader discussion labels Jun 24, 2024
@mister-ben mister-ben merged commit 970faa8 into videojs:main Jul 6, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: LGTM Needs one or more additional approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants