-
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
Export video.js as a named AMD module #1844
Conversation
@@ -170,7 +170,7 @@ vjs.players = {}; | |||
* compiler compatible, so string keys are used. | |||
*/ | |||
if (typeof define === 'function' && define['amd']) { | |||
define([], function(){ return videojs; }); | |||
define('videojs', [], function(){ return videojs; }); |
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.
I wonder if it's better to export it as video.js
to be consistent with npm, but otherwise, LGTM.
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.
I would argue that videojs is better than video.js since most of the plugins start w videojs-X. LGTM also.
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.
I also went through great emotional turmoil thinking about this one. I landed on videojs
because that's how it's currently exported on window
.
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.
Yeah, not stating whether videojs
is better or worse than video.js
, just that consistency is better than no consistency. Changing the npm
name is a lot harder than how we will be exporting it for AMD here.
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.
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.
(and yeah, good to go, no strong objections, here).
Have you seen the previous PR on this topic? Not positive if it's relevant but I know this topic has come up before. |
The error we were seeing was exactly related to the comment from underscore. |
@heff no, I hadn't seen that PR before. It is the same issue and I don't see any alternatives other than stripping the UMD stuff entirely. This seems like the lesser of two evils to me. |
I haven't caught up on the details, but you're saying DO move forward with this PR, right? @jnwng head up since I think this affects you |
@heff yes, I would say move forward with this PR. |
@heff thanks for the heads up, y'all should move forward with this |
Cool, sounds like we have approval and enough reviews. @dmlap, |
If video.js is packaged in a file with another AMD module, tools like RequireJS may not be able to resolve a name for anonymous module definitions. Using the named module syntax should allow video.js to be packaged in whatever format is convenient and still work with AMD loaders. For #1843