Skip to content

NPM package and jQuery 3.x #4254

Closed
Closed
@maksis

Description

At the moment the semantic-ui npm package depends on jQuery 2. If a developer using semantic-ui wants to upgrade to jQuery 3.x and adds an explicit dependency for it in his own package.json, it causes two conflicting version of jQuery to be loaded. This breaks everything (at least for webpack users), thus preventing people from upgrading to jQuery 3.x.

This could be solved by removing jquery from dependencies and putting it in peerDependencies instead:

  "peerDependencies": {
    "jquery": "^2.2.3 || ^3.0.0"
  },

That would allow (or actually force) users to put jquery 2.x or 3.x (whichever they want to use) into their own package.json file. I can also confirm that Semantic UI works fine together with webpack and jQuery 3.1 when there is no conflicting version present.

(at the moment many of the packages listed in dependencies have also been copied to peerDependencies but I'm not totally sure why)

Possibly related issues:

#4195
#4202
#4126

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions