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

Version 2 doesn't work with Node.js and works badly with Browserify #30

Open
denis-sokolov opened this issue Oct 23, 2014 · 1 comment · May be fixed by #31
Open

Version 2 doesn't work with Node.js and works badly with Browserify #30

denis-sokolov opened this issue Oct 23, 2014 · 1 comment · May be fixed by #31

Comments

@denis-sokolov
Copy link

In Node.js, require('jquery') will instead return a jQuery factory that requires a window, thus jquery.hammer.js breaks, as it expects jQuery to be loaded.
We test our GUI on Node.js with jsdom and we'd like this to work.

It also doesn't make much sense to depend on jQuery. This makes you bring your own version of jQuery, bloating the size of a Browserify bundle. It also attaches your plugin to your copy of jQuery, as opposed to a version of jQuery our code is using.
It is much better to use peer dependencies to hint what jQuery you need,
and then take window or jQuery as a parameter or at least rely on jQuery as a global.

Would you be open to big API changes in your module to fix these problems?
It may force you to bump the major version again, but otherwise this module is currently unusable in Node.js and with Browserify, in my opinion.

@DarylThayil
Copy link

has anyone found a solution to this?

@mciparelli mciparelli linked a pull request Nov 7, 2014 that will close this issue
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 a pull request may close this issue.

2 participants