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(videojs): missing return in registerComponent #8247

Merged

Conversation

amtins
Copy link
Contributor

@amtins amtins commented Apr 23, 2023

Description

This PR fixes the missing return in the videojs.registerComponent function to be in line with the documentation, see

video.js/src/js/video.js

Lines 304 to 320 in 1491d71

/**
* Register a component so it can referred to by name. Used when adding to other
* components, either through addChild `component.addChild('myComponent')` or through
* default children options `{ children: ['myComponent'] }`.
*
* > NOTE: You could also just initialize the component before adding.
* `component.addChild(new MyComponent());`
*
* @param {string} name
* The class name of the component
*
* @param {Component} comp
* The component class
*
* @return {Component}
* The newly registered component
*/

Use case

class CustomComponent extends videojs.getComponent('Component'){}

export default videojs.registerComponent(CustomComponent.name, CustomComponent);

Specific Changes proposed

  • add the missing return statement
  • add test case

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)
  • Reviewed by Two Core Contributors

@codecov
Copy link

codecov bot commented Apr 23, 2023

Codecov Report

Merging #8247 (f172a63) into main (1491d71) will increase coverage by 82.36%.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##           main    #8247       +/-   ##
=========================================
+ Coverage      0   82.36%   +82.36%     
=========================================
  Files         0      112      +112     
  Lines         0     7474     +7474     
  Branches      0     1800     +1800     
=========================================
+ Hits          0     6156     +6156     
- Misses        0     1318     +1318     
Impacted Files Coverage Δ
src/js/video.js 94.06% <100.00%> (ø)

... and 111 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mister-ben mister-ben added the needs: LGTM Needs one or more additional approvals label May 12, 2023
@misteroneill misteroneill merged commit f1558c6 into videojs:main May 12, 2023
@misteroneill misteroneill removed the needs: LGTM Needs one or more additional approvals label May 23, 2023
edirub pushed a commit to edirub/video.js that referenced this pull request Jun 8, 2023
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.

3 participants