Skip to content

Conversation

4ian
Copy link
Owner

@4ian 4ian commented Oct 7, 2025

Implement local game previews using a Service Worker and IndexedDB.

This change enables local, offline game previews directly within the web-app, improving preview load times and reliability by storing and serving generated game files from IndexedDB via a Service Worker, rather than uploading to S3.


Open in Cursor Open in Web

Copy link

cursor bot commented Oct 7, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

console.log('[LocalFileIndexedDB] File stored successfully:', path);
resolve();
};

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add onabort?

* Useful for cleaning up old preview sessions.
* @param pathPrefix - The path prefix to match (e.g., '/local_sw_preview/session-123/')
*/
export const deleteFilesWithPrefix = async (pathPrefix: string): Promise<number> => {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: actually use this.

@4ian 4ian force-pushed the cursor/implement-local-service-worker-file-serving-a93b branch from 91d4163 to 90cadac Compare October 12, 2025 13:56
@@ -0,0 +1,338 @@
// @flow
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to BrowserSWIndexedDB

@4ian 4ian force-pushed the cursor/implement-local-service-worker-file-serving-a93b branch from 86d0d37 to b6cad24 Compare October 13, 2025 11:01
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