legacy-knowledge-base
公開されました Jun. 30, 2025

Upgrade Bootstrap version from 4.x.x to 5.x.x

written-by

Kanchan Bisht

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • When can we expect the support for Bootstrap 5.3.3 in the Liferay?

Environment

  • Liferay DXP [all versions]

Resolution

From DXP 7.4, Liferay no longer use or support jQuery-based plugins that include Bootstrap. Liferay is using vanilla javascript and React due to modern browsers being more homogenized. Liferay no longer needs JS polyfills to support multiple browsers.

We expect our users to move away from jQuery if possible. Bootstrap 5 has also removed its dependency on jQuery. Their plugins are all written with vanilla JS. Hence, Liferay even do not encourage the portal's jQuery as it's only a legacy feature (DXP codebase does not use it), and, hence, we don't have plans to maintain it, especially in the case that a client extension is a much simpler and more powerful option for our customers: Using a JavaScript Client Extension

As a result, Liferay is not going to support Bootstrap 5.x since every major version of Bootstrap comes with breaking changes that require markup/CSS updates. Bootstrap's release cycle is too frequent, and hence, it will be too much for users to update their site every 2 years on top of all our updates.

If users want to use Bootstrap 5, they will need to replace clay.css with Bootstrap 5. Liferay's OOTB widgets won't be styled correctly, but if they are creating their components, it should work fine. DXP's admin interface will be styled and functional with cadmin.

Liferay only includes the 'bootsrap.min.js' when JQuery is enabled in Liferay's 'System Setting'. However, the JQuery-based plugin is no longer in use or supported, as Liferay is using vanilla Javascript and React due to modern browsers being more organized, thus, it no longer needs JS polyfills to support multiple browsers: http://vanilla-js.com/

Liferay recommends users avoid using JQuery if it is feasible for them, as 'Bootstrap 5' has also removed its dependency on JQuery: Bootstrap 5 alpha!

Here is the LSV:security-vulnerabilities

Additional Information

  • CVE-2024-6531: This issue has NOT been reviewed by the National Vulnerability Database. It has been reported by a company that maintains versions of software that they support when the initial software support has reached end-of-life. Herodevs uses these issues to market their Never-Ending-Support version of Bootstrap and other libraries.

NOTE: Liferay Support does not recommend or endorse specific third-party products over others. The information provided about products not created by Liferay is for reference purposes only, and any implementation of these principles will be at your team's discretion.

did-this-article-resolve-your-issue

legacy-knowledge-base