In the latest version of Blocklet Server, we have just added support for Progressive Web Apps (PWA).
Progressive Web App are built using web technologies, but offer a user experience similar to native apps. A PWA can operate across multiple platforms and devices from a single codebase, like a website. It can also be installed on a device, function offline and in the background, and integrate with the device and other installed applications.
Why PWA#
Faster user experience: Switching between pages often involves a delay in environments with poor network connectivity. PWA can mitigate this by pre-loading the entire application, eliminating the need for network requests when navigating between pages and significantly improving page load speeds.
Offline App support: Even offline, some of the applications (if it's optimized for offline usage) remain accessible and navigable.
You can learn more about the standards and introduction of PWA technology here:
PWA with Blocklets#
With PWA enabled, the Blocklet can be installed directly on the system desktop, functioning like a native app. It also supports offline usage, allowing access even without a network connection.
The Blocklet Service offers a comprehensive set of convenient functions and properties designed to streamline the integration of components with Service Worker code, thereby enhancing the development and deployment of Progressive Web Applications (PWAs). By providing a robust framework, the Blocklet Service simplifies the process of managing offline capabilities, caching strategies, and background synchronization, which are essential for creating seamless and reliable user experiences in PWAs. Developers can leverage these tools to efficiently handle network requests, manage data storage, and ensure that applications remain responsive and functional even in low or no connectivity environments. Additionally, the Blocklet Service includes detailed documentation and support resources, making it accessible for both novice and experienced developers to implement PWA features with ease and confidence.
We have enhanced some of our most popular blocklets, such as the Pages Kit and Discuss Kit, by integrating Progressive Web App (PWA) capabilities. This means that when you incorporate these blocklets into your application, it will automatically benefit from the advanced features of PWAs. These features include improved performance, offline functionality, and the ability to be installed on a user's device like a native app. As a result, your application will offer a more seamless and engaging user experience, with faster load times and the ability to function even without a stable internet connection. Additionally, users will have the convenience of accessing your application directly from their home screen, just like any other app, enhancing accessibility and user engagement.
The following section describes how to integrate PWA into a Blocklet.
What specific improvements have been made?#
Pages Kit Pages Caching#
Currently, all public Pages Kit pages are pre-cached. Once you've opened Pages Kit, subsequent page loads will be instantaneous, even with a poor network connection or offline.
Discuss Kit Caching #
The amount of data in Discuss Kit can be substantial, so pre-caching everything is impractical. A better approach is dynamic caching, which caches only the pages that have been visited.
Discuss Kit caches the list, blog, documentation, and bookmark homepages by default. A successfully installed Service Worker makes these pages accessible regardless of network connectivity.
After viewing a post's details, the page is cached immediately. Subsequent visits to the same post will then load faster. Even if network problems occur, access to the cached post details will remain unaffected.
Exploring the Features of PWA#
Pages Kit and Discuss Kit featured with PWA will soon be available for all ArcBlock services. These features are currently already accessible on the main ArcBlock website and the official community site. You can visit them and experience the difference.
Developing Blocklets with PWA Support#
The greatest value that Blocklet services bring with PWA support is that any application developed based on ArcBlock can easily add PWA support capabilities. We strive to make this process very simple.
Refer to the official documentation for a quick guide on adding Service Worker capabilities to your Blocklet.
Plans for the Future#
We will progressively enhance the implementation of Progressive Web App (PWA) across all Blocklets, continually optimizing PWA configuration to improve the Blocklet user experience.
Help us improve#
If you have any questions, feedback, or suggestions, please visit the ArcBlock Community. We're here to help. You can also earn ABT rewards if your feedback is selected for our Bug Bounty Program.