Skip to content

@parcel/service-worker's version and manifest do not correspond to precache manifest of workbox / other tools #9939

@meghprkh

Description

@meghprkh

💬 RFC

@parcel/service-worker's manifest is a list of strings and a version

Workbox's precache manifest is { url: string, revision?: string | null }[];

The version in the current plugin also has very little use as it is the hasReference of the service-worker.js file and not of each document. Thus I could change index.html and version would stay the same.

Should we change the manifest to be the precache manifest?

🔦 Context

💻 Examples

service-worker.js

import { manifest, version } from "@parcel/service-worker";
import { precacheAndRoute } from "workbox-precaching";

// OLD does not update if index.html got updated
precacheAndRoute(manifest.map((url) => ({ url, revision: version })));

// NEW Proposed
precacheAndRoute(manifest)

// OR
import { precache_manifest } from "@parcel/service-worker";
precacheAndRoute(precache_manifest)

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleInactive issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions