-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Meteor prints jQuery missing warning #796
Comments
I'm not sure why it's trying to statically analyze something in an if/elseif, that seems like it would break for literally every other package that supports AMD. I'm skeptical about your patch, since it seems like:
|
I agree on that it's not fixing the "real" problem, but technically my dynamic value solution shouldn't make a difference. Let me correct this: Meteor don't realise when a statement is in if/else statement, it just statically collects all packages required and checks if they are installed. As I don't have jQuery on my project, I get the warning message. On the other side, Meteor will not resolve dynamic values during its static analysis, thats why my proposed change makes the difference. I searched for AMD packages with optional dependencies without success. I'm wondering how other packages may implement optional dependencies, maybe there is an other way of doing it, which will work with Meteor, I don't know. We have have many dependent packages in the project I'm working on, but they all don't have optional dependencies. Do you have some samples of such packages? |
No, I haven't used meteor in years. I looked around but didn't find
anything in an issue tracker or otherwise. It may be worth opening an issue
there to see if this is a more widespread issue.
…On Wed, Nov 1, 2017, 08:52 Dave Avanthay ***@***.***> wrote:
I agree on that it's not fixing the "real" problem, but technically my
dynamic value solution shouldn't make a difference.
Let me correct this: Meteor don't realise when a statement is in if/else
statement, it just statically collects all packages required and checks if
they are installed. As I don't have jQuery on my project, I get the warning
message. On the other side, Meteor will not resolve dynamic values during
its static analysis, thats why my proposed change makes the difference.
I searched for AMD packages with optional dependencies without success.
I'm wondering how other packages may implement optional dependencies, maybe
there is an other way of doing it, which will work with Meteor, I don't
know. We have have many dependent packages in the project I'm working on,
but they all don't have optional dependencies. Do you have some samples of
such packages?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#796 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAum2TLOK_g9nDdRrfZ2739D_MCJjED_ks5syHeCgaJpZM4QN__9>
.
|
I finally managed to find the boilerplate I just opened this issue at the Meteor repository. I think, it make sense to resolve the issue at its root. |
I just moved the existing issue to a feature request at meteor. Let me close this issue, since the fix has to be done on the meteor side. |
I'm using this awesome slider for a project based on Meteor. Since I use ReactJS in the frontend, I do not use this package directly, I got it as a dependency from this ReactJS wrapper provided by brownieboy. Moreover I use bootstrap-slider without jQuery, since I don't need jQuery for my project.
Meteor does some static code analysis for its own package bundling logic (Meteor has an own package system) which locates every
require(<string literal>)
in the code. When using bootstrap-slider without jQuery, Meteor prints a warning about being unable to locate jQuery. With static analysis, there is no real way of investigating if a package is really required or not, without executing the code itself. As @benjamn described here, the best way to get around this problem is to require a dynamic value containing the string literal instead of having the string directly as argument of therequire
function for optional packages.That why, I would like to adapt bootstrap-slider as follow:
from
to
Let me provide you with a merge request containing the change.
The text was updated successfully, but these errors were encountered: