Difference between revisions of "New Features of ZK 10.0.0 Beta"

From Documentation
Line 8: Line 8:
  
 
= Introduction =
 
= Introduction =
ZK 10, the latest release of the ZK framework, brings a wave of innovations centered around client-side development. With a strong focus on improving the user experience and optimizing cloud-native scalability, ZK introduces stateless components, client-side Model-View-ViewModel (MVVM) support, and embraces TypeScript. These client-side enhancements empower developers to better utilize client-side capabilities for building modern web applications.
+
Welcome ZK 10 - faster, lighter, and cloud-ready. With a strong focus on improving the user experience and optimizing cloud-native scalability, ZK 10 introduces stateless components, client-side Model-View-ViewModel (MVVM), and embraces TypeScript. These client-side enhancements empower developers to better utilize client-side capabilities for building modern web applications.
  
Stateless components revolutionize ZK application development by eliminating server-side states. This shift enables auto-scaling, resource efficiency, and simplified cloud deployment. With stateless components, ZK apps can be deployed across regions, scaling elastically to meet varying workloads while delivering faster response times.
+
Stateless components revolutionize ZK application development by eliminating server-side states. This shift enables auto-scaling, resource efficiency, and simplified cloud deployment. With stateless components, ZK apps can be deployed across regions, scaling elastically to meet varying workloads while delivering faster response times. Client-side MVVM ushers in a new era of data binding, reducing server memory usage and improving performance. Developers can seamlessly turn their pages into client-side MVVM with the help of the ZK Linter, which identifies compatibility issues in server MVVM code before upgrading. Additionally, the adoption of TypeScript brings reliability and robustness to ZK's front end, enhancing the development experience.
  
Client-side MVVM ushers in a new era of data binding, reducing server memory usage and improving performance. Developers can seamlessly turn their pages into client-side MVVM with the help of the ZK Linter, which identifies compatibility issues in server MVVM code before upgrading. Additionally, the adoption of TypeScript brings reliability and robustness to ZK's front end, enhancing the development experience.
+
In summary, ZK 10's client-side innovations mark a significant leap forward in web application development. These features empower developers to build cloud-native, scalable, and efficient applications, making ZK an excellent choice for modern web applications.
 
 
In summary, ZK 10's client-side innovations signify a significant leap forward in web application development. These features empower developers to build cloud-native, scalable, and efficient applications, making ZK an excellent choice for modern web applications.
 
  
 
== Download ==
 
== Download ==

Revision as of 14:49, 6 October 2023

Documentationew Features of ZK 10.0.0 Beta
ew Features of ZK 10.0.0 Beta

Author
Hawk Chen, Manager, Potix Corporation
Date
, 2023
Version
ZK 10.0.0 beta


Introduction

Welcome ZK 10 - faster, lighter, and cloud-ready. With a strong focus on improving the user experience and optimizing cloud-native scalability, ZK 10 introduces stateless components, client-side Model-View-ViewModel (MVVM), and embraces TypeScript. These client-side enhancements empower developers to better utilize client-side capabilities for building modern web applications.

Stateless components revolutionize ZK application development by eliminating server-side states. This shift enables auto-scaling, resource efficiency, and simplified cloud deployment. With stateless components, ZK apps can be deployed across regions, scaling elastically to meet varying workloads while delivering faster response times. Client-side MVVM ushers in a new era of data binding, reducing server memory usage and improving performance. Developers can seamlessly turn their pages into client-side MVVM with the help of the ZK Linter, which identifies compatibility issues in server MVVM code before upgrading. Additionally, the adoption of TypeScript brings reliability and robustness to ZK's front end, enhancing the development experience.

In summary, ZK 10's client-side innovations mark a significant leap forward in web application development. These features empower developers to build cloud-native, scalable, and efficient applications, making ZK an excellent choice for modern web applications.

Download

Demo-button.png Download-button.png

Highlighted Features

Highlighted features.png

Stateless components

ZK 10 introduces stateless components, allowing developers to build cloud-native, scalable ZK apps. Stateless components compose UI in a stateless manner with no server-side state. This enables auto-scaling, improves resource efficiency, and simplifies deployment on modern cloud platforms.

By eliminating server-side states, stateless components make it easy to develop ZK apps that leverage the full power of cloud infrastructure. The apps can be deployed across regions and scale elastically based on load.

With stateless components, ZK apps gain benefits like:

  • Auto-scaling based on demand
  • Improved resource utilization efficiency
  • Fast elastic scaling up and down
  • Service-oriented architecture and modular development
  • Reduced memory usage on a server
  • Faster response times

Client-side MVVM

ZK 10 brings data binding to a browser with client-side MVVM support. It reduces server memory usage and improves performance by handling data bindings on the client side rather than the server. Migrating existing apps is easy - just toggle a configuration flag and client MVVM is activated. You can choose to migrate the whole application or a specific part on a page to client MVVM.

Benefits of client-side MVVM include:

  • Reduces memory usage on a server
  • Improves response times
  • Powerful data binding handled on the client side

ZK Linter Enables Smooth Migration from Server to Client MVVM

With the powerful new client-side MVVM in ZK 10, upgrading from server MVVM is recommended to enjoy benefits like reduced memory usage and faster performance. However, not all server MVVM syntax can be transparently upgraded to client MVVM due to the difference between the server-side and client-side processing. Some patterns like type casting and contextual parameters require tweaks to work properly with client MVVM's client-side data binding.

To help developers smoothly transition to client MVVM, ZK provides the ZK Client MVVM Linter. This static analysis tool identifies potential compatibility issues in server MVVM code before upgrading.

The ZK linter analyzes Zul and Java files using a predefined set of rules covering common scenarios like:

  • ContextParams that are not supported by client MVVM
  • Unsupported binding parameter types
  • Type casting that may cause issues

It flags any problematic patterns, allowing developers to address them before upgrading. This prevents subtle bugs and ensures a successful switch to client MVVM.

The linter provides a guided upgrade path to the client MVVM. By detecting incompatible server MVVM code upfront, developers can either fix issues or keep using server MVVM where needed. You can upgrade your ZK apps with the confidence of knowing potential pitfalls are highlighted early.

With the ZK Client MVVM Linter identifying compatibility issues even before upgrading, the transition to powerful client-side MVVM is smooth and seamless. The linter enables developers to upgrade ZK apps to leverage the benefits of client MVVM with minimal effort.

Blue-right-arrow.png Check ZK Linter demo project

TypeScript adoption brings more robust and reliable

ZK framework has migrated all of its JavaScript code to TypeScript, a statically typed superset of JavaScript. This brings several key benefits:

  • Reliable auto-completion and navigation from the IDE
  • Catch errors early through static type-checking
  • Enforce project conventions with custom lint rules
  • Safer interoperability between modules
  • Closer to Java programming experience


ZK provides the NPM package, zk-types, with type definitions for the ZK JavaScript APIs. This allows using TypeScript to customize ZK in a type-safe manner.

Overall, TypeScript adoption makes extending and customizing ZK's frontend much more reliable and robust. It represents a major leap forward in front-end development capabilities with ZK.

Enhancements

Enhancements.png

Integrate Font Awesome 6 Over 1,600 Free Icons

ZK 10.0.0 upgrades the built-in Font Awesome icon library from 4.7.0 to 6.4.2. This update provides the latest free icons and features:

  • Over 1,600 icons in 3 styles - Solid, Regular, Brands
  • Redesigned icons with a modern look
  • Supports Font Awesome 6 and 4 syntax for backward compatibility

To use an icon, simply specify the CSS class name at the component's iconSclass, e.g.:

<button iconSclass="z-icon-house z-icon-solid"/>

No need to include any files or apply extra CSS. All icons are built-in and optimized for ZK.

This upgrade keeps ZK apps up-to-date with the latest Font Awesome icons and styles. Developers can leverage new icons and designs quickly with the familiar easy-to-use syntax.

All supported Font Awesome 6.4.2 icons

Enable InaccessibleWidgetBlockService by default

The InaccessibleWidgetBlockService is enabled by default to enhance security. Previous versions required manually enabling it.

With this change, ZK applications will block requests from inaccessible widgets without any extra configuration needed. This prevents issues like users making disabled buttons clickable.

The default blocking rules are:

  • Block all events from disabled and invisible components
  • Block onChange, onSelect, etc for read-only components
  • Allow onOpen events

Developers can customize the blocked events and rules if needed. But by default, ZK now blocks requests from inaccessible widgets out of the box to improve security. For details, please see Block Request for Inaccessible Widgets.

Misc.

  • Remove Applet, Flash, and FusionChart components since ZK 10
  • Add all new HTML5 tags in ZK 10 ZHTML
  • Support load locale-dependent resources in a relative path
  • Deprecated org.zkoss.zk.ui.uuidRecycle.disabled (Not supported anymore)

Upgrade Notes

  • Since ZK adopts TypeScript, please review your custom ZK JavaScript widget which might need to be modified for ZK 10.

Comments



Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.