-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use ManifestTransform
when using @islands/pwa
#144
Conversation
☁️ Nx Cloud ReportWe didn't find any information for the current pull request with the commit 218a868. Check the Nx Cloud Github Integration documentation for more information. Sent with 💌 from NxCloud. |
We need to talk about dynamic pages, should be excluded from the sw precache manifest: a lot of work to be done on server side and also including a custom sw (read antfu-collective/vitesse#169 and a simple implementation here antfu-collective/vitesse#252 (comment)). |
@ElMassimo we can wait, we're releasing a few things on pwa repo, I'll update this PR when pwa |
Great, thanks Joaquin! |
chore: remove skipWaiting and clientsClaim hack
Deploying with Cloudflare Pages
|
@ElMassimo updated, I have another PR to add ESM support and fix some dev bug and: I think we should remove the support here adding the pwa plugin via |
Looks great! Throwing an error if the user provides the plugin in |
we have to clean up some internal types of the plugin that are not needed anymore |
doing some cleanup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you @userquin 😃 !!
ManifestTransform
when using @islands/pwa
ManifestTransform
when using @islands/pwa
Description 📖
This PR uses
workbox ManifestTransform
when pwa is configured via@islands/pwa
plugin/module: this way we can control the sw precache manifest, adding or removing entries.Also includes the configuration based on
prettyUrls
onworkbox.navigateFallback
entry: will use theVite base
or/
when not configured.If the pwa plugin is configured via
Vite
instead using@islands/pwa
plugin/module, usingprettyUrls: false
will produce an error on runtime when registering the sw, since it will have the html entries twice in the sw precache manifest: you have a comment about not adding theaddRoutes
entries on line 195 (the comment is aboutprettyUrls: true
, since we'll end with the html file and also the route name, but registering the sw will work).TODO:
iles.config.ts
docs file has a comment about excluding thehtml
entries, we can remove it before merging this PR (the html entries on theglobPatterns
added, the new logic will remove all html entries and recalculate the revision for all routes provided in the SSG callback).console.log
on the pwa module, I added a few logging and so you can check the result.Background 📜
This was happening because I talk about it with
ElMassimo
;)The Fix 🔨
By changing the
Vite PWA Plugin
options to include theworkbox ManifestTransform
to regenerate the manifest entries afterSSG
build.Screenshots 📷
Nopes