What Is New in PrimeFaces 12.0
PrimeFaces 12.0 is a major release focused on modernizing the UI component suite, upgrading to the latest standards, and introducing new components. This version aligns with the current JSF ecosystem and provides significant quality-of-life improvements for developers.
| Category | Key Highlights |
|---|---|
| New Features | New Badge and Avatar components, CDI-compatible Websocket, and JSF 2.3 support. |
| Improvements | Upgraded to jQuery 3.6, ThemeSwitcher rewrite, and modernized InputNumber. |
| Bug Fixes | Over 150 issues resolved across the component library. |
| Deprecations | Legacy Internet Explorer support and deprecated components are removed. |
What new components were added in 12.0?
PrimeFaces 12.0 introduces two new components to enhance UI functionality. The p:badge component displays labels, status indicators, or notification counts. The p:avatar component represents people or icons with labels, images, or shapes.
In practice, these components save development time for common UI patterns that previously required custom code. They are fully themable and integrate seamlessly with the rest of the suite.
How does the upgrade to jQuery 3.6 affect my application?
The framework now uses jQuery 3.6.0, which is a significant jump from the previous jQuery version. This brings better performance, security patches, and modern JavaScript features.
You should test your custom jQuery plugins or scripts for compatibility. The upgrade also future-proofs your applications and aligns PrimeFaces with other modern web tooling.
What changes were made to the Push/Websocket functionality?
The Push component was rewritten to be CDI-compatible, moving away from the older Atmosphere framework. This simplifies configuration and leverages modern Java EE standards.
You now configure it via @Push CDI annotation. This is a cleaner approach and reduces the dependency footprint of your application.
Was the client-side API improved in this release?
Yes, the WidgetVar API was modernized. All widget variables are now instances of PrimeFaces.widget. objects, providing a more consistent and powerful interface for client-side manipulation.
This means you can more reliably call methods like PF('widgetVar').show() or PF('widgetVar').hide() across all components. It eliminates the previous inconsistencies in the client-side object model.
What is the impact of removing legacy Internet Explorer support?
Support for Internet Explorer 10 and 11 has been dropped. This allows the codebase to use modern CSS and JavaScript features without polyfills or workarounds.
The result is a smaller, faster, and more maintainable codebase. You only need to worry about supporting modern browsers like Chrome, Firefox, Safari, and Edge.
FAQ
Is PrimeFaces 12.0 compatible with JSF 2.3?
Yes, it is fully compatible with JSF 2.3. This release ensures smooth operation with the features and APIs provided by JavaServer Faces 2.3.
How do I migrate the old Push API to the new CDI-based one?
You need to replace the old atmosphere configuration with the new @Push CDI annotation. The documentation provides specific migration guides for this change.
Were any input components significantly updated?
The InputNumber component was completely rewritten. It now has a more robust parser and formatter, fixing many longstanding issues with decimal and currency input.
What happened to the ThemeSwitcher?
The ThemeSwitcher component was rewritten from the ground up. It now offers better performance and a more reliable switching mechanism between themes.
Where can I find the full list of changes?
The complete list of over 150 fixes and improvements is available in the release notes on the PrimeFaces GitHub repository.