1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-23 02:04:34 +02:00
video.js/build
mister-ben 820ef382bc
fix(types): Add has|usingPlugin to typedef by adding stubs which are removed from builds (#8811)
## 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:

```js
/* 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](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [ ] 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
2024-08-12 21:47:47 +02:00
..
docs/styles docs: Update jsdoc template for better usability on mobile (#8048) 2023-03-22 20:15:17 +01:00
assets.js chore: package json cleanup (#5649) 2019-08-30 14:14:53 -04:00
current-changelog.js chore: package json cleanup (#5649) 2019-08-30 14:14:53 -04:00
docs-only.js chore: package json cleanup (#5649) 2019-08-30 14:14:53 -04:00
fix-api-docs.js chore: package json cleanup (#5649) 2019-08-30 14:14:53 -04:00
jsdoc-typeof-plugin.js fix: Improves types for registerPlugin and getPlugin (#8058) 2023-01-24 22:07:30 +01:00
jsdoc-workarounds.js fix(docs): Add workaround for ErrorMetadata typedef (#8737) 2024-05-23 19:04:25 +02:00
license-header.txt docs: change master to main (#7050) 2021-01-19 17:41:39 -05:00
minify.js chore: package json cleanup (#5649) 2019-08-30 14:14:53 -04:00
netlify-docs.js docs: Redirect guides to videojs.com (#7706) 2022-04-06 11:34:18 -04:00
netlify.js feat: Add useSVGIcons option (#8260) 2023-06-12 13:31:06 -05:00
rollup-exclude-lines.js fix(types): Add has|usingPlugin to typedef by adding stubs which are removed from builds (#8811) 2024-08-12 21:47:47 +02:00
sandbox.js test: run tests via rollup (#5601) 2019-08-30 14:56:41 -04:00
test-a11y.js chore: package json cleanup (#5649) 2019-08-30 14:14:53 -04:00
translations.js chore: Update translations script to special case en-GB (#8106) 2023-02-21 17:03:47 +01:00