-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Make es5-shim a dependency #1687
Comments
👍 |
I'm cool with this, but it doesn't free us from having additional IE8-specific code in the project (e.g. events). We've also talked about trying to have a separate file that contains all IE8-specific code, so it could be included or not. It might start to feel like a lot if people need to include the ES5 shim AND our IE8 additional code. And since the es5 shim modifies built-in objects, it's probably not something we should just include in our IE8 file. I'd also be interested to know how this overlaps with lodash, and if we'd no longer need one or the other. |
What I meant specifically is that people need to add es5-shim themselves if they're using videojs in browsers that are not es5-compliant. |
Yeah, I got that, I was just looking for ways to make it less complicated for people needing IE8 support, assuming we also introduced two different builds. |
Yeah, for the IE8 stuff, we probably should just have a As for lodash, we probably won't need many of the things lodash provides and many of the current functions we have. The main one we'd need is We could also provide a build that includes es5-shim in with videojs. |
re: the Lodash thread, if we're talking about an ES5 shim, something like 101 might be pretty interesting to keep things thin without needing a custom lodash build. |
For lodash, I would want to use the node-style require module ( |
I updated this issue to list steps needed to complete it. |
Decision: Bundle es5-shim, es5-sham, and html5 video/audio shim into a file that gets hosted on the video.js CDN. Watch out for cross-browser issues when not using the shim, because it also improves support in modern browsers, though we'd like to avoid making it a requirement for everyone to include even if they're not trying to support ie8. |
If you're looking for an "assign" shim that's spec-compliant, https://www.npmjs.com/package/object.assign is what you want (it will only shim the environment if you explicitly ask it to). Please do bundle the Also, please note that every single browser, including latest Chrome and IE, lacks 100% ES5 compliance, so everything needs the |
Thanks for the note @ljharb. I think we still want to avoid requiring everyone to include the es5 sh*m for all browsers, so we'll have to be conservative with the features we use. |
IE8 compatiblity fixes - Babel loose mode and ES5-shim Reverted to old isPlainObject to fix IE8 Lodash.isplainobject was throwing a "Member not found error" on elements, specifically the 'custom' track element being passed in options. (turned out to be that we were using lodash modern, not compat) Fixed full-window mode in IE8 by fixing fullscreen API check Fixed the swf events by creating the object in component.createEl fixes videojs#2184 Added es5 shim and sham to the sandbox example related to videojs#1687
Closing as all tasks are complete or moved or punted. |
For v5, we should consider making es5-shim a dependency that users of videojs need to include for older browser support. It will make our lives easier if we can assume a higher level of js support provided by ES5.
This would also mean that we probably don't need as many other helper functions that re-introduce array iterator functions.
Remaining Tasks
Website example embed codesMoved to videojs/videojs.comj#29jsbin.com/axedogThis will come after 5.0 is officially releaseWhat else ???Nothing.Identify areas of the codebase that could be improved with ES5 features, and create issues to update them(:mans_shoe: :football:)The text was updated successfully, but these errors were encountered: