Bootstrap 5 JavaScript B/C breaks #32239
dgrammatiko
started this conversation in
Show and tell
Replies: 1 comment
-
@dgrammatiko thank you for the new vanilla way :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bootstrap 5 JavaScript changes
The components are now modular. The old
HTMLHelper('bootstrap.framework');
still works but it's highly recommented that will not be used. The expected behaviour is that developers add ONLY the interactive components present on the page. The reason for this is better performance by delivering only the javascript that is actually needed.What works as before
Instaniating any component through the HTMLHelper works as before. A minor change was applied to the selector as it now supports ANY VALID CSS SELESTOR. In some methods the selector was limited to either a className or an Id and at some cases was expecting plain text and converting it to class. This was fixed so the methods are better suited to cover more cases by allowing any valid CSS selector to be targeted. The impact of this change is extremelly low compared to all the markup changes a developer has to apply to get a layout to be Bootstrap 5 compatible.
What's broken with the Bootstrap 5 JavaScript
This has changed since #32256
As long as you include jQuery before calling ANY Bootstrap component, any existing code (eg Bootstrap v4) works as before.
This document does NOT reflect the decisions of the Production Team. I just wanted to document the needed changes, the reasons the B/C break happened and hopefully help devs do the transition. You're welcome to ask for more help in this thread
Beta Was this translation helpful? Give feedback.
All reactions