-
-
Notifications
You must be signed in to change notification settings - Fork 201
Possible different jquery objects modified by plugins #244
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
Comments
Thanks for pointing it out. I couldn't figure this out on my own.
|
that's because a jquery plugin should actually have a peer-dependency to jquery, not a dependency (as it wants to alter the dependency used by the requester instead) |
Yea, so really, if we decide to fix this, it’s because we’re working around a bug in some js library that has done this incorrectly. |
anyway, if you have multiple jQuery copies locally, because some plugins are not declaring their dependencies the right way, you cannot always fix this with an alias (what if they are incompatible versions ?). So this should get reported to the package. |
Thank you for this issue. |
Hi guys!
I just wanted to drop this here for some discussion:
https://knpuniversity.com/screencast/javascript-webpack/provide-plugin#comment-3712073331
tl;dr;
If a jQuery plugin properly uses require (like bootstrap-datepicker), then it appears possible that it will modify a different jquery object than you get in userland when using
require('jquery')
. The solution is to add ajquery
alias (Eonasdan/tempus-dominus#1319 (comment)).This makes sense: each package gets its own set of dependencies, so it would make sense. We should consider adding the jquery alias, possibly when the user enables
autoProvidejQuery
. It's tricky, because I want to balance wtf moments and not make more wtf by adding this alias (there are probably some edge case use-cases where the alias could mess something up).The text was updated successfully, but these errors were encountered: