File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 44 */
55
66import _inherits from '@babel/runtime/helpers/inherits' ;
7+ import log from './utils/log.js' ;
8+
9+ let hasLogged = false ;
710
811/**
912 * Used to subclass an existing class by emulating ES subclassing using the
1013 * `extends` keyword.
1114 *
1215 * @function
16+ * @deprecated
1317 * @example
1418 * var MyComponent = videojs.extend(videojs.getComponent('Component'), {
1519 * myCustomMethod: function() {
@@ -27,6 +31,15 @@ import _inherits from '@babel/runtime/helpers/inherits';
2731 * The new class with subClassMethods that inherited superClass.
2832 */
2933const extend = function ( superClass , subClassMethods = { } ) {
34+
35+ // Log a warning the first time extend is called to note that it is deprecated
36+ // It was previously deprecated in our documentation (guides, specifically),
37+ // but was never formally deprecated in code.
38+ if ( ! hasLogged ) {
39+ log . warn ( 'videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0' ) ;
40+ hasLogged = true ;
41+ }
42+
3043 let subClass = function ( ) {
3144 superClass . apply ( this , arguments ) ;
3245 } ;
You can’t perform that action at this time.
0 commit comments