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): Add has|usingPlugin to typedef #8811

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mister-ben
Copy link
Contributor

@mister-ben mister-ben commented Jul 21, 2024

Description

tsc doesn't understand mixins and ignores jsdoc not followed by code. The jsdoc for the plugin methods usingPlugin() and hasPlugin() in Player are being ignored. To get them included in type outputs we need to have otherwise unnecessary stubs codes, as we already have for on() etc, which adds unnecessary, even if a small amount of, code to the outputs.

Specific Changes proposed

  • Slight refactor of Player to include those stubs.
  • Adds a rollup plugin to delete lines between certain comments, so those stubs are deleted from the outputs.
  • Applies those comments to the on() etc stubs in Component and the new plugin stubs in Player.

Any code surrounded by these comments, and the comments themselves, is deleted from the dist and test builds:

/* start-delete-from-build */
  console.log('hi');
/* start-delete-from-build */

Compared to main, video.min.js is 53 bytes smaller.

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

Copy link

codecov bot commented Jul 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.17%. Comparing base (45570d9) to head (abe270d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8811   +/-   ##
=======================================
  Coverage   83.17%   83.17%           
=======================================
  Files         120      120           
  Lines        8052     8047    -5     
  Branches     1931     1931           
=======================================
- Hits         6697     6693    -4     
+ Misses       1355     1354    -1     

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

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.

None yet

1 participant