meteor-persistent-session icon indicating copy to clipboard operation
meteor-persistent-session copied to clipboard

Remove jquery

Open Floriferous opened this issue 7 years ago • 3 comments

I can't find the place where this package actually uses jquery? Yet it still requires it.

Would be great to remove it, and probably also check other unused packages and remove those that are no longer needed.

Floriferous avatar Dec 18 '18 17:12 Floriferous

I'm unable to upgrade jquery to latest version because amplify package used under the hood is using [email protected]

Any ideas about how how I can upgrade jquery to the latest version?

DeanKamali avatar Feb 21 '20 03:02 DeanKamali

Good question. Simply add the latest Meteor jquery package by doing meteor add [email protected]! with an exclamation point at the end.

The latest Meteor [email protected] is set to simply reference whatever version you installed via NPM by doing a meteor npm install --save [email protected] instead of wrapping the actual jQuery release. So this lets you install whatever version you want via NPM. I wish the Meteor underscore package did this as well. All this was done so Meteor builds would no longer ship two versions of jQuery which they previously did if you added/needed it in both places (for Meteor and NPM package dependencies).

The ! exclamation point is a new-ish modifier you can add to Meteor packages that simply tells any other Meteor package that relies on that Meteor package to weaken it's dependency and use that version - which in turn uses your NPM installed version. Nifty right?

I'm running meteor-persistent-session on NPM [email protected] and it's working great - along with every other non-modernized Meteor package that uses old jquery like autoform, i18n, etc. Do a meteor list --tree to see what Meteor packages depend on jquery in your app. All of these will use the NPM version after doing the meteor add [email protected]!

evolross avatar Feb 21 '20 18:02 evolross

@evolross the ! exclamation point did the trick, thanks very much!

DeanKamali avatar Feb 21 '20 19:02 DeanKamali