You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am reading up on how to set up my project to use Turborepo. I currently have one big monolithic SvelteKit app that I am planning on breaking down into smaller projects and do request routing to tie them together. I'm deploying on Vercel. The clientside is a single SPA.
One thing that is unclear to me, as I've been going through Turborepo's documentation, is how this will work with PWAs and the build assets list that they can cache (service workers in SvelteKit). As far as the client is concerned, they are accessing a single deployment, and the service worker's build assets reflect that by listing the entire list of the sites' client assets. If I break the original application into multiple applications, the service worker won't reference the full list of build assets.
So I am left with a few options:
add a build step that ensures that all the client build assets are available to the service worker when it is built (would have to look into how to do this w/ Turborepo), or
have each sub-application manage their own service worker scoped to their respective path.
I don't particularly love the first option as it seems somewhat hacky and brittle, but that would keep the user experience the same. I'm not even sure this would even work as the client-side router wouldn't be aware of the other apps - so I would need to do more research on this front.
The second option seems like a more standard way handling this situation, but would require the client to use multiple SPAs (each one leveraging their own scoped service worker) - considering I'm prompting the user to approve an update whenever a new service worker is rolled out, that would likely be annoying to the user (I could automatically install the service worker - but that might affect user experience if the app reloads while they are filling out a form, for example).
Has anyone dealt with this decision before? Is there some build-related setting or project setup that I should consider to achieve option 1 in an idiomatic way?
What has been your experience if using the second option?
UPDATE: Reworded description regarding second option.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am reading up on how to set up my project to use Turborepo. I currently have one big monolithic SvelteKit app that I am planning on breaking down into smaller projects and do request routing to tie them together. I'm deploying on Vercel. The clientside is a single SPA.
One thing that is unclear to me, as I've been going through Turborepo's documentation, is how this will work with PWAs and the build assets list that they can cache (service workers in SvelteKit). As far as the client is concerned, they are accessing a single deployment, and the service worker's
build
assets reflect that by listing the entire list of the sites' client assets. If I break the original application into multiple applications, the service worker won't reference the full list of build assets.So I am left with a few options:
I don't particularly love the first option as it seems somewhat hacky and brittle, but that would keep the user experience the same. I'm not even sure this would even work as the client-side router wouldn't be aware of the other apps - so I would need to do more research on this front.
The second option seems like a more standard way handling this situation, but would require the client to use multiple SPAs (each one leveraging their own scoped service worker) - considering I'm prompting the user to approve an update whenever a new service worker is rolled out, that would likely be annoying to the user (I could automatically install the service worker - but that might affect user experience if the app reloads while they are filling out a form, for example).
Has anyone dealt with this decision before? Is there some build-related setting or project setup that I should consider to achieve option 1 in an idiomatic way?
What has been your experience if using the second option?
UPDATE: Reworded description regarding second option.
Beta Was this translation helpful? Give feedback.
All reactions