Skip to content

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

@denis-sokolov

Description

@denis-sokolov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions