Imo, Bootstrap brings a huge load of payload
As with j!3 I want to be in control of what I am using for my templates.
And I would not like it to make a BS free override for every view in j!.
The good thing about the used BS3 in j! 3 was that you could also download just parts of it if you needed it.
customize... it worked with jQuery......... customization was dropped in BS4.
My own little framework is way smaller than BS. BS cannot replace my need for jQuery as I need it for more complex interactivity than BS can provide. Currently my little responsive.css can do with the ID's and classes for most views in j!3 I realy hope this will be the same in j!4...
Will I still be able to cut the BS and use this in my template?
unset($this->_scripts[JURI::root(true).'/media/jui/js/bootstrap.min.js']);
unset($this->_stylesheets[JURI::root(true).'/media/jui/js/bootstrap.css']);
Labels |
Added:
?
|
Cannot give you specific code but surely you can do it using Web Assets API (method disableAsset). Please read https://docs.joomla.org/Special:MyLanguage/J4.x:Web_Assets to see how to use Web Assets API .
customization was dropped in BS4.
J4 is modular, there is no concept of one bootstrap.js. You can load each interactive component per view
unset($this->_scripts[JURI::root(true).'/media/jui/js/bootstrap.min.js']);
unset($this->_stylesheets[JURI::root(true).'/media/jui/js/bootstrap.css']);
Please don't do that if your extension/template is something that others will ever use. You're breaking interoperability and it's kinda awful. If it's an ext/template for your own use it's fine as long as you know what you're doing (in this case the unset trick will not work as the assets are loaded with the Assets Manager so you have to unload them using that. @joomdonation already shared the link with the docs).
So, in reality we get BS forced upon us now... where in J3 we could get rid of it, now in j4 we can't anymore..?
in assets manager docs I don't see an unload, disable or do not use feature nor do I see a reference to bootstrap so it is harder coded than in this Asset Manager...
So, in reality we get BS forced upon us now... where in J3 we could get rid of it, now in j4 we can't anymore..?
If this is what you understood from what I wrote, you totally got it wrong
in assets manager docs I don't see an unload, disable or do not use feature nor do I see a reference to bootstrap so it is harder coded than in this Asset Manager...
No, it's not it's again just a 1 line (per component, there is no Bootstrap.js anymore as I explained above):
// Will not load the Bootstrap Collapse
Factory::getDocument()->getWebAssetManager()->disableScript('bootstrap.collapse');
FWIW you shouldn't use jQuery
thank you for that sample i apparently totally overlooked. Will test it. Tx.
But it would be very nice to have just one line to not load all of BS. Also do I just need the use of the BS component or use the file name.. in the tree of beta 7, it is collapse.es6.js (*.min.js, *.min.js.gz).. only use the name?
Regarding the use of jQuery... nice if you are only using J! only. Since even BS5 cannot sort a table dynamically in a (pre)defined manner. Lucky it still gets shipped, even though I am using the latest from jQuery and not the one shipped with j!3.
FWIW..there is also plenty of arguments against the use of BS...
FWIW..there is also plenty of arguments against the use of BS...
Haha, a couple of years ago I (together with few others) was fighting so that the project would decouple from Bootstrap. We were ignored. I guess with Bootstrap 6 that will move all the interactive components to Web Components they will reconsider
Regarding the use of jQuery... nice if you are only using J! only.
I consider myself doing quite some interactive experiences ( https://perfectgrid.io/demo ) and haven't used jQuery for quite some time
@dgrammatiko the use for somewhat complex tables with sorting I why I use jQuery.
when working sports results there is more sort ordering than just alphanumeric.. using jQuery does allow me to sort these too.
Will explain one sample: in sports sailing race results there are various scoring values, numbers, 1, 2, 3 and on for first, second, third.. upto the amount of boats participating (amount of participators +1 for the DSQ, disqualified)
these numbers are added up each race..... then a race with lowest score will be deducted from the total after a set number of races, usually after 5, 10, 15 races...
also boats may not finish a race and get a DNF. There are more abbreviations... these have scoring values too. But depending on the count of boats participating.
Importing such a results table with all values is not an issue.. I have a plugin that can translate several types into HTML... sorting them in the browser however in the way expected is not possible with the usual BS or any other grid system...
Since several special stuff like this can be in a site, working with jQuery is needed (or another library is).. the grid systems like BS or any other lack the possibility and I have to add something anyway.. so if jQuery is already there, why not us it for all?
so if jQuery is already there, why not us it for all?
NO, that's a very wrong assumption. It's 2021 you can do without jQuery. I'm guessing https://sortablejs.github.io/Sortable/ is a good replacement to whatever you're using right now. Anyways if jQuery works for you then fine. I think this issue can be closed as your question was answered
Been there cannot do.. sorry maybe little lost in translation... but english is not my native.. read sorting as in in sort ordering
your suggestion cannot do that.. it is a grab and reposition thing (which could also be done with jQuery by the way)
This shows some sample where "good", "medium" and "bad" are valued for sorting..
https://mottie.github.io/tablesorter/docs/example-parsers.html
I am doing this ordering for race results, others will do maybe for there ecommerce product pages.. using a library jQuery or any other just is usefull for a lot of sites.. though I can see the bunch can do without, there are just these specifics that need... and there are also people that utterly just dislike BS. (oops, maybe me...)
That someone can do without jQuery in 2021 is fine.. but is also nice to have just one library for all your needs instead of reinventing wheels over and over for each added browser interactivity... and that doesn't need to be jQuery, can be something else, but BS just doesn't have it. And as with the first BS versions I expect it to be a heck of a job to style it in a way it doesn't look like the next website.. :(
but is also nice to have just one library for all your needs instead of reinventing wheels over and over for each added browser interactivity
Whatever, as I said you can use whatever you want, I'm not judging just saying that there are better tools. Anyways can you close this as there is no issue with the core for this?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-02-07 20:56:03 |
Closed_By | ⇒ | chmst |
Did you try?