Skip to content

Commit

Permalink
Build converted apps in correct place
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Sep 18, 2022
1 parent b072c0f commit 35dcc92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
panel convert examples/gallery/streaming/*.ipynb examples/gallery/dynamic/*.ipynb examples/gallery/param/*.ipynb --to pyodide-worker --out ./builtdoc/pyodide/
panel convert examples/gallery/streaming/*.ipynb examples/gallery/dynamic/*.ipynb examples/gallery/param/*.ipynb --to pyodide-worker --out ./builtdocs/pyodide/
- name: git status and git diff
run: |
git status
Expand Down
7 changes: 3 additions & 4 deletions panel/_templates/serviceWorker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const appName = 'panel-convert-{{ uuid }}';
const appName = 'Panel-Pyodide-App-{{ uuid }}';

const preCacheFiles = [{{ pre_cache }}];

Expand All @@ -14,7 +14,7 @@ self.addEventListener('install', (e) => {
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.forEach((cache, cacheName) => {
if (cacheName.startsWith('panel-converted') && cacheName !== appName) {
if (cacheName.startsWith('Panel-Pyodide-App') && cacheName !== appName) {
return caches.delete(cacheName);
}
})
Expand All @@ -24,11 +24,10 @@ self.addEventListener('activate', (event) => {
self.addEventListener('fetch', (e) => {
e.respondWith((async () => {
const cache = await caches.open(appName);
const response = await cache.match(e.request);
let response = await cache.match(e.request);
console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
if (response) { return response; }
const response = await fetch(e.request);
const cache = await caches.open(cacheName);
console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
cache.put(e.request, response.clone());
return response;
Expand Down

0 comments on commit 35dcc92

Please sign in to comment.