-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Add dependencies to package.json and bower.json #17325
Comments
jQuery is already listed as a dependency. Tether isn't though, and we should fix that.
Meh. We don't currently use npm for client-side dependencies. And we definitely don't want to hook into Bower, since it kinda sucks and isn't too actively developed these days. |
jQuery is indeed listed in the bower file, but it's still missing in the package file ... I only see jQuery listed under the jspm deps in the package file. |
Like I said:
|
@cvrebert If you list npm as one of the possible ways to install bootstrap (which you're doing in the v4 docs) you should make sure all deps can be resolved correctly, no? |
Actually we already list npm in the v3 docs (since last year), and nobody seems to have complained about jQuery not being in |
Probably not a lot of people were using npm to install bootstrap since it wasn't exporting any useful js modules. With the js rewrite of v4 and combined with the rise of tools like browserify and webpack that may change ... Also, like you said I don't think it would do any harm if we add deps to the package file. |
X-Ref: #17273 I'm 👍 on this one for the same reasons @vejersele listed. |
Absolutely 👍 it would also be very useful to use Bootstrap's JS components with ECMAScript 6 import syntax, e.g. import {Popover, Modal} from 'bootstrap' and use them without even knowing they depend on jQuery or Tether. |
👍 for supporting the import syntax. I am currently trying to include |
+1 Same issue here since alpha 2 |
Why is tether a dependency if the user doesn't plan on using tooltips? Will this be solved in the final release / compiled version? |
I started doing the initial legwork on proper (/better) modularization (and dependency management) of the v4 Bootstrap modules today and should have an PR up for review / thoughts some time next week. Meanwhile @reustle you could mock window.Tether with |
@petetnt I imported the library so it is satisfied for now, I was more curious if the dependency was going to be required in the final release. It seems weird that Bootstrap would need a hard dependency on another library (besides jQuery), especially if it is for a feature you aren't using (tooltips). |
@i just stumbled on another problem. The check of the Tether object being on the global window context ( Tethers distributed version uses the universal module approach (see https://github.com/HubSpot/tether/blob/master/dist/js/tether.js#L3), so there won't be any global if it detects a module environment. |
It also seems as though other files may need to be changed. Even when jQuery and tether are installed via npm manually, util.js throws an error because it can't find jQuery in the global scope on line 169. |
For those currently using bootstrap v4.0.0-alpha.2 through npm you could require Tether as a global instead of a module:
I know it's not perfect, but it's better than placing an empty function on a global Tether variable. |
The error persists using CDN version. |
@hougasian You want #19017. |
In order to let people npm or bower install bootstrap, we should make sure that the package files are updated with the necessary dependencies.
I see two deps (could be that a missed one):
Once the package files are updated we should also remove jQuery and tether from the vendor dir and link to the bower or npm version in the tests.
In order to get completely rid of the vendor folder, we could also add qunit as a dev dependency to the package.json.
X-ref #17201
The text was updated successfully, but these errors were encountered: