Skip to content

Add basic offline support with a service worker#151

Open
vezwork wants to merge 1 commit intomainfrom
feat-offline-support
Open

Add basic offline support with a service worker#151
vezwork wants to merge 1 commit intomainfrom
feat-offline-support

Conversation

@vezwork
Copy link
Copy Markdown
Member

@vezwork vezwork commented May 1, 2026

Adds basic offline support using a service worker that caches everything that is loaded when online. You can e.g. refresh your browser tab even without network/server connection and the app will still run. Also, clicking between the project screen and editor screen is instant feeling.

It looks like about 57mb of stuff gets cached.

Claude wrote all of this.

Limitations:

  • Only caches files once they've "naturally" loaded. This means the editor files won't be cached for offline use if you never visited the editor page (you stayed on the project screen) while online.
  • Seems to require a build, not currently working on npm run dev:fresh for example, so not quite as easy to test with.
  • I am sure this would lead to significant issues with application versioning in practice... since everything is cached, we need to know when to replace cached files with their new versions and stuff. I don't know if this is somewhat handled by the current approach or not.
  • This does not attempt to address the problem of intercepting HTTP requests and fulfilling them using stuff from the Quartohub Virtual File System (VFS) (e.g. for images stored in the VFS that are used in the preview), which is another thing we might want a service worker for.

@cscheid
Copy link
Copy Markdown
Member

cscheid commented May 1, 2026

I am sure this would lead to significant issues with application versioning in practice... since everything is cached, we need to know when to replace cached files with their new versions and stuff. I don't know if this is somewhat handled by the current approach or not.

I think the vite deployment strategy should work here (vite uses hashes in the filename of its assets).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants