Urgent.News

What's breaking now, across thousands of outlets.

Tech

Making a booking page installable: tenant-aware PWA with vite-plugin-pwa

A PWA is usually explained with one manifest and one service worker. That's fine until you serve many tenants from one installation — then every tenant needs its own app identity, its own icon label, its own start URL, and none of them should collide. This post covers the parts that were not obvious: a per-tenant manifest, the id field that prevents duplicate home-screen icons, an update flow…

Progressive Web Apps (PWAs) typically require a single manifest and service worker. However, when serving multiple tenants from one installation, each tenant needs its own app identity, icon, and start URL to avoid conflicts. This article explores the nuances of implementing per-tenant PWAs using Vite 6 and vite-plugin-pwa, along with Workbox generateSW.

To set up Vite 6 with vite-plugin-pwa and Workbox generateSW, configure the manifest generation at runtime using the prompt registration type. This approach allows the service worker to install and wait before updating, preventing conflicts between tenants.

Each tenant is identified by a unique slug, which is used to generate a per-tenant manifest. The manifest includes essential properties such as id, name, short_name, start_url, scope, display, orientation, background_color, theme_color, and icons. The manifest response is set to no-store to ensure it is always fresh and avoids caching stale data.

An important consideration is the id field in the manifest. Chrome identifies an installed PWA by its manifest id, so providing a stable, non-changing id per tenant prevents multiple installations with the same shop appearing on the home screen. Changing the id even slightly can result in duplicate icons and entries, making it crucial to treat it like a database key.

The update flow for PWA installations with registerType: prompt ensures that form data is preserved. When a new version is available, a banner prompts the user to reload the page, allowing the new service worker to take over. The controllerchange event is listened for, triggering a reload when the waiting worker skips its waiting phase. This update mechanism prevents the partial filling of booking forms from being lost.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Serialization and Deserialization in Database Engines: How Data Becomes Bytes

When building a database engine from scratch, one of the most important concepts you need to understand is serialization and deserialization .

  • Serialization converts data structures into byte sequences for storage or transmission
  • Deserialization reconstructs original data structures from serialized bytes
  • Database engines rely on serialization/deserialization for persistent data storage

Stop Exporting One Square Image for Every Platform in 2026

The fastest workflow in social media design is one master file. Export a single 1080×1080 square, upload it everywhere, let each platform do the rest.

  • Exporting one 1080x1080 square image for all platforms in 2026 simplifies workflow.
  • Single image maintains control over cropping, avoiding distortion.
  • Tailored exact sizes for each platform prevent cropping or padding issues.

More from Thursday 19 November →