-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Remove jquery
from required packages
#23204
Comments
I'd have to talk to the @twbs/team—hi folks, please weigh in!—but you're initial premise is inaccurate. From our homepage, we say |
Also, this is a breaking change, so we have to decide now or wait until v5. |
Currently Bootstrap depends on jQuery and it will be the case until we ship a new major release (v5). |
I don't see any issue with switching |
Yup, agreed with @bardiharborow. 👍 |
For me such statement is not exacly correct. Term 'framework' usually used regardless libraries, which provide basic scaffolding for the actual solution composition. Speaking about Bootstrap related JS, the only 'framework' would be JQuery itself, while all Bootstrap JS code is just a set of JQuery plugins, just as JQuery UI is. Back in Bootstrap for Yii2 we do not include JS part unless some particular JS component is used: https://github.com/yiisoft/yii2-bootstrap/blob/master/BootstrapAsset.php#L18-L24
I understand that current development of v4 has already come too far to be rewritten without JQuery - I do ask for this. All I wish the mandatory dependency to be removed, so if developer chooses to use other JS framework he do not need to pull jquery files from Bower/NPM.
Yes, this would be fine. |
@Johann-S this is about npm dependencies, and allowing downstream users to load our CSS without pulling all our JS dependencies. This doesn't stop us generating a Bootstrap + Popper.js bundle. @XhmikosR The only concern I have is how does this affect our webpack strategy? I don't use webpack myself, so I'm really not sure how it all works. |
I don't think it will change our webpack strategy here, user have to install jQuery and Popper.js packages if they want to use our JavaSript |
Yeah, I think it shouldn't change anything; the user will still have to install jQuery and popper.js. That being said I don't use webpack myself... |
How about creating a separate package (ex. bootstrap-css) that would contain only CSS part and have the existing package to depend on bootstrap-css? This would give CSS-only people a streamlined package and keep the existing behaviour as-is. |
My point wasn't in us being a framework, toolkit, or whatever other name you want. We're a project with HTML, CSS, and JS—it's all or nothing right now. As mentioned, we have talked about having something split up our mono-repo into a series of other repos so folks can easily include one or more without the bulk of the entire project.
I don't see how having a dependency looks unprofessional. You don't need jQuery; that we do isn't not unprofessional. It's simply irrelevant to you.
This won't happen for a long time to come. All that said, I'm going to stub out a PR that removes the dependencies and updates some docs to better illustrate how our code works. I imagine this will be the final potentially breaking change for us before we can launch the beta. Also, see the new v4.3 project. It'll be a release solely geared towards integrating Lerna or something like it. Would love some thoughts if y'all have any. |
The jQuery debate aside, even though it's part of the dependencies, I don't see how it affects people. My company uses Bootstrap through NPM and only imports the CSS required. The jQuery and JS components are never used. But I guess people are concerned about having it in their I'm thinking that unless the JS components are rewritten in VanillaJS, there might be no need to change anything. For version 5, the only suggestion I would make is to revisit some of these JS components and see if they could be implemented through CSS instead. A lot of cool effects can be achieved through a little markup and some checkboxes/radioboxes. But I'm sure this has already been suggested many times in the past. Either way, I wish you luck in finding a good solution! |
Opened #23244. Please jump in with reviews and any feedback. |
About Lerna that's a very good things. And they are the whole pack as currently |
The days of jQuery are passing: the common demand for the modern web application is to be 'one-page-site'. This is the demand of the business - it is not I who speaks it. jQuery is not suitable for 'one-page-site' project creation - this task is resolved by modern JS frameworks like AngularJS, RactJS, EmberJS and so on. You an of course stay with the old technology as it is a part of your zone of confort - that is fine and natural for the human. However, the time is passing and more and more developers will have to abandon JQuery usage and move to 'one-page-site' solutions. It will take another several years to prepare Bootstrap 5.0, do they need to wait until then and struggling with JQuery installation? At the present state, intalling Bootstrap via Bower, I need to waste time, network resources and disk space to fetch the JS libraries, which I do NOT need. This contradicts the idea of package intallation and package managers like Bower/NPM. If I need additional functionality - I should install additional package. |
Great idea @klimov-paul. Would you be interested in taking a stab at it? |
These may be the demands of a fair few non-IT people with developers in their staff, but this is not necessarily the demand of all web application developers, nor is it necessarily the right one. Single-page applications do well for certain things, but are inadequate for others. Yes, you may technically do many things with a single-page application that are traditionally done with multi-page, but it's not always going to be the most stable and trustworthy, and will by definition be the least accessible since it depends on a technology that can totally break UX via different implementations in various clients, and different environmental factors. I understand the appeal to fledgling developers to offload much of the workload to the client side, but having survived the browser wars, it's misguided to believe it's a solution to fit all projects. On-topic: I second the request that it not necessarily depend on jQuery. I think it should still be discussed as a current feature since v4 is still in the alpha stages, but understand if workload is prohibitive for a change in v4. |
It's in our TODO list with @Johann-S for the next major version. But let's not jump ahead, one step at a time. Unless someone wants to make a branch for this and we can all work together on it. |
@klimov-paul |
This is exactly what I am talking about: solutions based on Bootstrap CSSS should NOT mandatory bound to jQuery. |
I have not said such thing. I was saying that mandatory usage of jQuery is an outdated practice and it is you who prove me right. It is @mdo's point that Bootstrap 4 is a whole solid frontend framework, where CSS and JS parts are bound together and are not meant ot be used separately. Maybe you should pass this statement to the The Bootstrap team is doing well ignoring such projects as The modern front-end complex solution as Bootstrap is should be more flexible in this matter. It MAY provide some default JS layer (which may be built even on top of JQuery), but should make it flexible enough to be replaced. |
Things can move quickly @klimov-paul 😉 and if you don't think so you should follow the evolution of Bootstrap |
I'm not sure why this discussion is ongoing. We get it—jQuery is old and not needed in your projects. It's still a helpful tool for us and millions of others. We've already said it, but I'll say it again—we'll work on moving to vanilla JS as we can. If you want this so badly now, please help! We're a small team working on this stuff whenever we can while having full-time jobs elsewhere. If you believe jQuery to be so outdated, help @Johann-S and our team rewrite the plugins to drop it completely. |
Relates to #22194
jQuery
should be removed from the mandatory dependencies for Bootstrap library.Since Bootstrap is posioned as CSS framework (not JS one) and it is declared it can function without JQuery (even while it is limiting its features), there should be a way to install pure Bootstrap without JQuery from the repositories like Bower/Npm.
In particular, these lines should be removed:
https://github.com/twbs/bootstrap/blob/v4-dev/bower.json#L34-L35
In the modern web application development more and more projects relies on suhc JS libraries like AngularJS, ReactJs, EmberJS and so on, in pursuit for 'on-page-site' feature implementation.
If particular developer wishes to use AngularJS and Bootstrap, why should he install a 'jquery' package, which will lie as a garbage among the project source files?
Keeping 'jquery' as mandatory dependency looks unprofessional.
Ideally JS related code should be moved into a separated repository, which will depend on 'twbs/bootstrap' and 'jquery', while 'twbs/bootstrap' itself will be requirement free.
If this be a Composer installation, the quick solution will be move 'jquery' into suggest section, but for Bower/Npm - I can not say.
The text was updated successfully, but these errors were encountered: