-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
feat: add several debugging aides #5854
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,9 @@ export const bind = function(context, fn, uid) { | |
// currently used in text tracks | ||
bound.guid = (uid) ? uid + '_' + fn.guid : fn.guid; | ||
|
||
bound.original_ = fn.original_ || fn; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should make sure to null these out when they're no longer needed. |
||
bound.context_ = fn.context_ || context; | ||
|
||
return bound; | ||
}; | ||
|
||
|
@@ -72,6 +75,8 @@ export const throttle = function(fn, wait) { | |
} | ||
}; | ||
|
||
throttled.original_ = fn.original_ || fn; | ||
|
||
return throttled; | ||
}; | ||
|
||
|
@@ -133,5 +138,7 @@ export const debounce = function(func, wait, immediate, context = window) { | |
|
||
debounced.cancel = cancel; | ||
|
||
debounced.original_ = func.original_ || func; | ||
|
||
return debounced; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ import { createTimeRanges } from './utils/time-ranges.js'; | |
import formatTime, { setFormatTime, resetFormatTime } from './utils/format-time.js'; | ||
import log, { createLogger } from './utils/log.js'; | ||
import * as Dom from './utils/dom.js'; | ||
import * as DomData from './utils/dom-data.js'; | ||
import * as browser from './utils/browser.js'; | ||
import * as Url from './utils/url.js'; | ||
import {isObject} from './utils/obj'; | ||
|
@@ -553,6 +554,8 @@ videojs.computedStyle = computedStyle; | |
*/ | ||
videojs.dom = Dom; | ||
|
||
videojs.domData = DomData; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am against this being in a production build of Video.js, though, I do see the usefulness of it when debugging. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we can have this be here during local dev but not when releasing, that's fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For local development we can just import DomData (as long as we let it export There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps we can expose it somewhere else? or put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure we can safely expose it and not deal with consequences down the line or have issues with people fiddling with it and causing issues. |
||
|
||
/** | ||
* A reference to the {@link module:url|URL utility module} as an object. | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'd want to make sure to null these out so that we're not leaking references.