Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

dmlap
Copy link
Member

@dmlap dmlap commented Feb 3, 2015

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

@@ -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; });
Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great emotional turmoil

feels

Copy link
Member

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).

@heff
Copy link
Member

heff commented Feb 3, 2015

Have you seen the previous PR on this topic? Not positive if it's relevant but I know this topic has come up before.

@gkatsev
Copy link
Member

gkatsev commented Feb 3, 2015

The error we were seeing was exactly related to the comment from underscore.

@dmlap
Copy link
Member Author

dmlap commented Feb 3, 2015

@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.

@heff
Copy link
Member

heff commented Feb 3, 2015

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

@dmlap
Copy link
Member Author

dmlap commented Feb 3, 2015

@heff yes, I would say move forward with this PR.

@jnwng
Copy link
Contributor

jnwng commented Feb 3, 2015

@heff thanks for the heads up, y'all should move forward with this

@heff
Copy link
Member

heff commented Feb 3, 2015

Cool, sounds like we have approval and enough reviews. @dmlap, npm install -g contrib && contrib feature accept.

@dmlap dmlap closed this in 42fbd4c Feb 5, 2015
@dmlap dmlap deleted the named-amd-module branch February 5, 2015 14:58
@nicjansma nicjansma mentioned this pull request Aug 26, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants