danroth27 / Net8BlazorWebAssembly

ASP.NET Core hosted Blazor WebAssembly app with .NET 8
MIT License
31 stars 8 forks source link

ServiceWorker PWA #6

Open Jimmys20 opened 9 months ago

Jimmys20 commented 9 months ago

Hello, can this project be modified to include a service-worker.js so it can work offline as PWA? Similar to what the previous template offered with the --pwa option. <ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />

Or PWA is only supported by WASM Standalone apps?

ttkaine commented 9 months ago

I was wondering the same thing. It seems like most of the upgrades in .net 8 involve much tighter coupling between the server and the client in a Core Hosted setup. This probably means that the only option for a PWA is to use the standalone variant - but I've yet to find out how you would impement a Core Hosted solution involving a standalone app with a server side login in the way I've been doing in .net 6. The documentation for standalone seems to be focused on static file serverless deployments while the hosted solutions don't seem to support the PWA model.

If anyone has an example project with a core hosted PWA that would be very handy! (If I figure out how to do it I'll return with a demo!)