jQuery has been tightly integrated in the framework since Yii 1, and bootstrap has been the standard frontend css/js library for Yii 2. Now they are separated from the core in Yii 3.
So my question goes like this:
- From what point are jQuery and bootstrap required and included in my Yii 3 project?
- What should I do if I wanted to use the alternatives to them?
As for the first question, I’ve got some idea by reading the package list and the
composer.json of some packages.
|package||depends on jQuery||depends on bootstrap|
So a web app in Yii 3 requires jQuery and bootstrap by default when you use “yii-base-web” template.
And since “ActiveForm” and the likes are not included in “yii-web” but in “yii-bootstrap4”,
they are free from jQuery but still depend on bootstrap.they are not free from jQuery. Both bootstrap 3 and 4 require jQuery.
Is this correct?
As for the 2nd question, I’d like to know what I should do when I wanted to get rid of jQuery and bootstrap completely from my web app and use some alternatives. Do I have to modify yii-base-web template’s composer.json and require some alternative 3-rd party (or my own) packages?