What's new in version 24.22?
webforJ version 24.22
is now available! This release introduces Namespaces, expands Installable Apps with support for dynamic icon generation, and brings other important improvements.
Highlighted below are some of the most exciting features coming in this release:
Namespacesโ
Namespaces provide a mechanism by which two or more apps that are running in the same server can share data. It also provides methods that allow a program to be notified when that shared data is modified by some other program.
Using the Namespace
feature , webforJ apps can now:
- Share data across sessions (where applicable).
- Create private or group-specific data domains.
- Manage variable access events through listeners.
Types of namespacesโ
webforJ provides several types of namespaces, each offering different levels of accessibility and scope:
Namespace Type | Scope | Shared Between | Key Characteristics |
---|---|---|---|
Private Namespace | Limited | Clients that share the same prefix and name | Ideal for isolated storage, ensuring only intended users can access it. Requires both a prefix and name . |
Group Namespace | Application-wide | Threads started from the same parent | Enables data sharing between related processes while keeping it isolated from other app instances. |
Global Namespace | Server-wide | All app server threads | Fully shared across the server, making it useful for managing global variables and system-wide states. |
Namespaces in action: Tic-Tac-Toe demo ๐ฎโ
While full documentation is coming soon, you can see namespaces in action with the Tic-Tac-Toe demo. This project showcases how namespaces can be used to manage game state, ensuring players can interact with a synchronized, isolated game session.
๐ Explore the Tic-Tac-Toe demo here: webforJ Tic-Tac-Toe Repository
Icons URL protocolโ
webforJ 24.21 introduced installable apps, allowing web apps to function more like native applications when installed on a device.
Now, in 24.22
, this feature has been further enhanced by adding support for the icons://
URL protocol in icons, enabling on-the-fly icon size generation.
What's the icons://
protocol?โ
The icons://
protocol provides a dynamic approach to icon management, allowing icons to be generated and served automatically based on requested filenames and parameters. Instead of manually creating and storing multiple icon sizes, webforJ can now generate them as needed, reducing file storage overhead while ensuring icons remain optimized across devices.
This new protocol comes with many benefits, some of which include:
- Automatic Icon Scaling - No need to manually generate multiple icon sizes.
- Efficient Storage - Icons are created dynamically instead of being stored statically.
- Seamless Integration with Installable Apps - Works effortlessly with the @AppProfile annotation.
- Customizable Appearance - Fine-tune padding, background color, and more.
Example usageโ
With this update, defining icons dynamically inside webforJ is simple:
Img icon = new Img("icons://icon-192x192.png");
This tells webforJ to generate the correct icon sizes dynamically, improving efficiency while ensuring compatibility across all platforms.
๐ More details on this enhancement can be found in this article.
As always, see the GitHub release overview for a more comprehensive list of changes.