Skip to content

Commit

Permalink
reenabled pwa service worker because the Chrome v129 memory issue see…
Browse files Browse the repository at this point in the history
…ms to have been fixed by Google
  • Loading branch information
jmoenig committed Oct 9, 2024
1 parent 9344316 commit d1876f7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* **New Features:**
* added extensions to access the "Thread safe scripts" setting
* **Notable Changes:**
* reenabled pwa service worker because the Chrome v129 memory issue seems to have been fixed by Google
* changed polling scheduler for streaming data from serial ports to be in lock step with Morphic
* updated Microblocks library to improve event streaming fluency
* **Notable Fixes:**
Expand Down
24 changes: 11 additions & 13 deletions snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,21 @@
var FPS = 67,
lastTime = 0,

loop = (timestamp) => {
requestAnimationFrame(loop);
if (timestamp - lastTime < 1000 / FPS) {
return;
}
world.doOneCycle();
lastTime = Math.max(
lastTime + 1000 / FPS,
timestamp - 1000 / FPS
);
};
loop = (timestamp) => {
requestAnimationFrame(loop);
if (timestamp - lastTime < 1000 / FPS) {
return;
}
world.doOneCycle();
lastTime = Math.max(
lastTime + 1000 / FPS,
timestamp - 1000 / FPS
);
};

/*
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
*/
world = new WorldMorph(document.getElementById('world'));
new IDE_Morph().openIn(world);
requestAnimationFrame(loop);
Expand Down
6 changes: 1 addition & 5 deletions sw_deactivated.js → sw.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/*
the PWA service worker is currently not used because of a memory leak
issue introduced in Chrome v129
*/
var snapVersion = '10.0.11', // currently unused
var snapVersion = '10.0.11',
cacheName = `snap-pwa-${snapVersion}`,
filesToCache = [
'snap.html',
Expand Down

0 comments on commit d1876f7

Please sign in to comment.