Published on Nov 16, 2022
After almost five years since its last major release, OmniFaces 4.0 has been released following a series of milestones that included a “Jakartified version of 3.14 with some breaking changes” following the release of Jakarta EE 10. Aside from the minimum requirements and breaking changes, new utility methods have been added and omnifaces.js is now sourced from Typescript rather than vanilla JavaScript.
The most significant advantage of switching to TypeScript is its ability to compile the same source code to older versions of EcmaScript, such as ES5 or even ES3 for ancient web browsers. We intend to do the same for Jakarta Faces’ own faces.js. Omnifaces.js is compatible with all major web browsers and targets ES5.
OmniFaces 4.0 is compatible with Jakarta Faces 4.0 and Jakarta Faces 3.0 specifications from Jakarta EE 10 and Jakarta EE 9.1, respectively, with the minimum required Java 11 version. For component library authors who would like to be compatible with both Faces 3.0 and 4.0, the Components#addFacesScriptResource() method has been added. The component developer will be able to support both Faces 3.0 jakarta.faces:jsf.js and Faces 4.0 jakarta.faces:faces.js as resource dependencies. It is technically not possible to use a variable as an attribute of an annotation such as @ResourceDependency.
Besides the increase in the minimal version of Java, other minimum dependencies have also been updated: Java 11, Jakarta Server Faces 3.0, Jakarta Expression Language 4.0, Jakarta Servlet 5.0, Jakarta Contexts and Dependency Injection 3.0, Jakarta RESTful Web Services 2.0 and Jakarta Bean Validation 3.0. In other words, OmniFaces 4.0 is not backwards compatible with previous versions of these dependencies because of the compiler-incompatible rename of the javax. package to the jakarta. package.
Everything marked with the @Deprecated annotation in version 3.x has been physically removed from the current version. For instance: the tag
The built-in managed beans, #{now} and #{startup}, will now return instances of the Temporal interface rather than the Java Date class. As in #[now.time] and #[startup.time], the framework continues to support the time property in a backwards-compatible manner. Moreover, it provides two new convenience properties: instant and zonedDateTime, as in #{now.instant}, #{now.zonedDateTime}, #{startup.instant} and #{startup.zonedDateTime}.
Annotated under @Deprecated are the Callback interfaces that date back to Java 1.7, which had replacements available in Java 1.8. In particular, Callback.Void has been replaced by Runnable, Callback.Returning has been replaced by Supplier, Callback.WithArgument has been replaced by Consumer, and Callback.ReturningWithArgument has been replaced by Function. Components and Events have been updated to use the new types.
OmniFaces 4.0 is a long-awaited release after the stretched milestone releases, even if the changes are not revolutionary. A more current minimum dependency and the switch to TypeScript may provide component builders with interesting options.
Presentations
Browse LSET presentations to understand interesting…
Explore Now
eBooks
Get complete guides to empower yourself academically…
Explore Now
Infographics
Learn about information technology and business…
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
Error: Contact form not found.
[wpforms id=”9030″]