NPM package and jQuery 3.x #4254

Closed
maksis opened this Issue Jul 9, 2016 · 3 comments

Projects

None yet

4 participants

@maksis
maksis commented Jul 9, 2016

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

@IonutBajescu
Member

@jlukic This one might need your attention.

@jlukic jlukic added the Build Tools label Jul 12, 2016
@jlukic jlukic added this to the 2.2.3 milestone Jul 12, 2016
@KarandikarMihir

Is there any progress on this front? I wish to use semantic-ui instead of semantic-ui-css (without jQuery) in my react + webpack project. Can I use jQuery 3.x?

@jlukic jlukic added a commit that referenced this issue Jul 31, 2016
@jlukic jlukic Update jq version #4254 2092e07
@jlukic
Member
jlukic commented Jul 31, 2016 edited

Peer dependencies have been deprecated in NPM3.

I think should be solved by allowing either version in dependencies. I've gone ahead and updated this with the next release.

@jlukic jlukic closed this Jul 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment