-
Notifications
You must be signed in to change notification settings - Fork 2.7k
chore: migrate NetworkDetails from any -> null|XMLHttpRequest|Response; #3828
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
Changes from 2 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export type NetworkDetails = | ||
| null // this is a nullable field in several callback interfaces | ||
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. Would prefer to see |
||
| Response // from utils/fetch-loader.ts | ||
| XMLHttpRequest; // from utils/xhr-loader.ts | ||
Comment on lines
+2
to
+4
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. Thanks for these changes. This should be helpful for anyone using the default loaders, and for improving internal type safety. In a situation where someone provides their own loader via 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. That is a good point, perhaps I need to expand the callback interface to be expressed with some generics and have the default argument be Another option is to keep the current definition and say that a 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 could also export I know this one has been sitting here for years. Let me know if you can pick this up or would like me to resolve it by closing or rebasing and merging after addressing these comments. 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 think this is what we would need to do, since it it not exactly obvious exactly where null can be converted to the other types here due to the lifecycle of events and it would be safer to err on the side of defensively coding around this but representing that an end implementor needs to handle 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 have not touched the internals of the hls.js codebase in a long time, but let me see if I can't pick this up and fix it tomorrow. |
Uh oh!
There was an error while loading. Please reload this page.