-
Notifications
You must be signed in to change notification settings - Fork 11
🤖 Open markdown links externally and add PWA support #359
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "name": "cmux - coder multiplexer", | ||
| "short_name": "cmux", | ||
| "description": "Parallel agentic development with Electron + React", | ||
| "start_url": "/", | ||
| "display": "standalone", | ||
| "background_color": "#1e1e1e", | ||
| "theme_color": "#1e1e1e", | ||
| "orientation": "any", | ||
| "icons": [ | ||
| { | ||
| "src": "/icon-192.png", | ||
| "sizes": "192x192", | ||
| "type": "image/png", | ||
| "purpose": "any maskable" | ||
| }, | ||
| { | ||
| "src": "/icon-512.png", | ||
| "sizes": "512x512", | ||
| "type": "image/png", | ||
| "purpose": "any maskable" | ||
| } | ||
| ], | ||
| "categories": ["development", "productivity", "utilities"], | ||
| "shortcuts": [ | ||
| { | ||
| "name": "New Workspace", | ||
| "short_name": "New", | ||
| "description": "Create a new workspace", | ||
| "url": "/?action=new", | ||
| "icons": [] | ||
| } | ||
| ] | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // cmux Service Worker for PWA support | ||
| const CACHE_NAME = 'cmux-v1'; | ||
| const urlsToCache = [ | ||
| '/', | ||
| '/index.html', | ||
| ]; | ||
|
|
||
| // Install event - cache core assets | ||
| self.addEventListener('install', (event) => { | ||
| event.waitUntil( | ||
| caches.open(CACHE_NAME) | ||
| .then((cache) => cache.addAll(urlsToCache)) | ||
| .then(() => self.skipWaiting()) | ||
| ); | ||
| }); | ||
|
|
||
| // Activate event - clean up old caches | ||
| self.addEventListener('activate', (event) => { | ||
| event.waitUntil( | ||
| caches.keys() | ||
| .then((cacheNames) => { | ||
| return Promise.all( | ||
| cacheNames.map((cacheName) => { | ||
| if (cacheName !== CACHE_NAME) { | ||
| return caches.delete(cacheName); | ||
| } | ||
| }) | ||
| ); | ||
| }) | ||
| .then(() => self.clients.claim()) | ||
| ); | ||
| }); | ||
|
|
||
| // Fetch event - network first, fallback to cache | ||
| self.addEventListener('fetch', (event) => { | ||
| event.respondWith( | ||
| fetch(event.request) | ||
| .then((response) => { | ||
| // Clone the response before caching | ||
| const responseToCache = response.clone(); | ||
| caches.open(CACHE_NAME) | ||
| .then((cache) => { | ||
| cache.put(event.request, responseToCache); | ||
| }); | ||
| return response; | ||
| }) | ||
| .catch(() => { | ||
| // If network fails, try cache | ||
| return caches.match(event.request); | ||
| }) | ||
| ); | ||
| }); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The fetch handler caches every request (including
POSTor long‑livedfetchstreams) by cloning the response and writing it to the default cache. This means SSE/chat streams from the backend will be duplicated and buffered until completion so they can be cached, which in practice never happens and causes the service worker to keep consuming the stream indefinitely, increasing memory usage and potentially stalling updates. Limit caching to staticGETasset requests (e.g. by checkingevent.request.method === "GET"and filtering by pathname) instead of intercepting every network call.Useful? React with 👍 / 👎.