Skip to content

Commit

Permalink
Upgrading sw to 9.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jguille2 committed Dec 22, 2023
1 parent 1c5854a commit 38aa1ae
Showing 1 changed file with 108 additions and 13 deletions.
121 changes: 108 additions & 13 deletions src/platforms/web/chromium/root/sw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var snapVersion = '8.0.99',
cacheName = 'snap4arduino-pwa',
var s4aVersion = '9.1.1',
cacheName = `snap4arduino-pwa-${s4aVersion}`,
filesToCache = [
'index.html',

Expand Down Expand Up @@ -89,6 +89,7 @@ var snapVersion = '8.0.99',
'locale/lang-sv.js',
'locale/lang-ta.js',
'locale/lang-te.js',
'locale/lang-ti.js',
'locale/lang-tr.js',
'locale/lang-ua.js',
'locale/lang-zh_CN.js',
Expand Down Expand Up @@ -122,27 +123,85 @@ var snapVersion = '8.0.99',

'libraries/animation_module.xml',
'libraries/apl.xml',
'libraries/arcs_module.xml',
'libraries/audioComp_module.xml',
'libraries/bar-charts.xml',
'libraries/bbtSnapExtension.js',
'libraries/biginteger.js',
'libraries/bignumbers.xml',
'libraries/bignums.js',
'libraries/bbtSnapExtension.js',
'libraries/bitwise.xml',
'libraries/cases.xml',
'libraries/colors.xml',
'libraries/crayons.xml',
'libraries/Eisenbergification.xml',
'libraries/frequency_distribution_module.xml',
'libraries/httpBlocks.xml',
'libraries/HummingbirdBlocks.xml',
'libraries/iteration-composition.xml',
'libraries/leap-library.xml',
'libraries/list_comprehension_module.xml',
'libraries/list-utilities.xml',
'libraries/localstorage_module.xml',
'libraries/tiles_module.xml',
'libraries/make-variables.xml',
'libraries/maps_module.xml',
'libraries/menu_module.xml',
'libraries/mqttExtension.js',
'libraries/mqtt.js',
'libraries/mqtt.xml',
'libraries/parallel_module.xml',
'libraries/pixel_module.xml',
'libraries/plot_bars_module.xml',
'libraries/replace_letters_module.xml',
'libraries/schemeNumber.js',
'libraries/SciSnapExtensions.js',
'libraries/SciSnap!2Blocks.xml',

'libraries/TuneScope.xml',

// TuneScope dependencies
'libraries/TuneScope/TuneScope.js',
'libraries/TuneScope/TS_init.js',
'libraries/TuneScope/webmidi.iife.js',
'libraries/TuneScope/WebAudioFontPlayer.js',

// TuneScope instruments
'libraries/TuneScope/12849_21_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/12848_21_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/12847_21_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/12846_0_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/12842_0_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/12835_21_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/12840_6_JCLive_sf2_file.js',
'libraries/TuneScope/12869_6_JCLive_sf2_file.js',
'libraries/TuneScope/0580_GeneralUserGS_sf2_file.js',
'libraries/TuneScope/0560_GeneralUserGS_sf2_file.js',
'libraries/TuneScope/0110_GeneralUserGS_sf2_file.js',
'libraries/TuneScope/0680_JCLive_sf2_file.js',
'libraries/TuneScope/0121_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/1070_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/0460_GeneralUserGS_sf2_file.js',
'libraries/TuneScope/0600_GeneralUserGS_sf2_file.js',
'libraries/TuneScope/0730_JCLive_sf2_file.js',
'libraries/TuneScope/0710_Chaos_sf2_file.js',
'libraries/TuneScope/0420_JCLive_sf2_file.js',
'libraries/TuneScope/0400_JCLive_sf2_file.js',
'libraries/TuneScope/0700_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/1040_Aspirin_sf2_file.js',
'libraries/TuneScope/0770_SBLive_sf2.js',
'libraries/TuneScope/0100_SBLive_sf2.js',
'libraries/TuneScope/0650_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/1050_FluidR3_GM_sf2_file.js',
'libraries/TuneScope/0180_Chaos_sf2_file.js',
'libraries/TuneScope/0020_JCLive_sf2_file.js',
'libraries/TuneScope/0260_JCLive_sf2_file.js',
'libraries/TuneScope/0241_JCLive_sf2_file.js',
'libraries/TuneScope/0350_JCLive_sf2_file.js',
'libraries/TuneScope/0291_LesPaul_sf2_file.js',
'libraries/TuneScope/0320_GeneralUserGS_sf2_file.js',
'libraries/TuneScope/0230_Aspirin_sf2_file.js',

'libraries/serial_module.xml',
'libraries/signada.js',
'libraries/signada.xml',
Expand All @@ -151,8 +210,8 @@ var snapVersion = '8.0.99',
'libraries/strings.xml',
'libraries/textCostumes_module.xml',
'libraries/try-catch.xml',
'libraries/variadic-reporters.xml',
'libraries/word-sentence.xml',
'libraries/words_module.xml',

'libraries/scale.xml',
'libraries/snapJrLib.xml',
Expand All @@ -178,6 +237,12 @@ var snapVersion = '8.0.99',
'Costumes/abby-c.svg',
'Costumes/abby-d.svg',
'Costumes/airplane2.png',
'Costumes/aleassa01.png',
'Costumes/aleassa02.png',
'Costumes/aleassa03.png',
'Costumes/aleassa04.png',
'Costumes/aleassa05.png',
'Costumes/aleassa06.png',
'Costumes/alonzo.png',
'Costumes/Alonzo3D.png',
'Costumes/alonzo.svg',
Expand Down Expand Up @@ -362,6 +427,12 @@ var snapVersion = '8.0.99',
'Costumes/dee-c.svg',
'Costumes/dee-d.svg',
'Costumes/dee-e.svg',
'Costumes/derec01.png',
'Costumes/derec02.png',
'Costumes/derec03.png',
'Costumes/derec04.png',
'Costumes/derec05.png',
'Costumes/derec06.png',
'Costumes/devin-a.svg',
'Costumes/devin-b.svg',
'Costumes/devin-c.svg',
Expand Down Expand Up @@ -479,13 +550,26 @@ var snapVersion = '8.0.99',
'Costumes/home_button.svg',
'Costumes/horse1-a.svg',
'Costumes/horse1-b.svg',
'Costumes/jahrd01.png',
'Costumes/jahrd02.png',
'Costumes/jahrd03.png',
'Costumes/jahrd04.png',
'Costumes/jahrd05.png',
'Costumes/jahrd06.png',
'Costumes/jaime-a.png',
'Costumes/jaime-b.png',
'Costumes/jaime_walking-a.png',
'Costumes/jaime_walking-b.png',
'Costumes/jaime_walking-c.png',
'Costumes/jaime_walking-d.png',
'Costumes/jaime_walking-e.png',
'Costumes/jamet01.png',
'Costumes/jamet02.png',
'Costumes/jamet03.png',
'Costumes/jamet04.png',
'Costumes/jamet05.png',
'Costumes/jamet06.png',
'Costumes/jamet06-wall.png',
'Costumes/jay.gif',
'Costumes/jeans-a.svg',
'Costumes/jeans-b.svg',
Expand Down Expand Up @@ -601,6 +685,12 @@ var snapVersion = '8.0.99',
'Costumes/ruby-b.png',
'Costumes/sail-boat.png',
'Costumes/sam.gif',
'Costumes/sarron01.png',
'Costumes/sarron02.png',
'Costumes/sarron03.png',
'Costumes/sarron04.png',
'Costumes/sarron05.png',
'Costumes/sarron06.png',
'Costumes/saxophone-a.svg',
'Costumes/saxophone-b.svg',
'Costumes/scarf1.svg',
Expand Down Expand Up @@ -661,6 +751,12 @@ var snapVersion = '8.0.99',
'Costumes/trombone-b.svg',
'Costumes/trumpet-a2.svg',
'Costumes/trumpet-a.svg',
'Costumes/turtle01_colour.png',
'Costumes/turtle02_colour_resized.png',
'Costumes/turtle03.png',
'Costumes/turtle04.png',
'Costumes/turtle05.png',
'Costumes/turtle06.png',
'Costumes/ukulele.svg',
'Costumes/umbrella.png',
'Costumes/unicorn1.png',
Expand Down Expand Up @@ -764,13 +860,12 @@ self.addEventListener('activate', (evt) => {
});

/* Serve cached content when offline */
self.addEventListener('fetch', function(e) {
e.respondWith(
caches.match(
e.request,
{'ignoreSearch': true}
).then(function(response) {
return response || fetch(e.request);
})
);
self.addEventListener('fetch', function(event) {
event.respondWith(
fetch(event.request).catch(function(e) {
return caches.open(cahceName).then(function(cache) {
return cache.match(event.request,
{'ignoreSearch': true}).then(response => response);
});
}));
});

3 comments on commit 38aa1ae

@kseryi
Copy link

@kseryi kseryi commented on 38aa1ae Jan 15, 2024

Choose a reason for hiding this comment

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

Hi. Ukainian localization is not worked
Зняток екрана як 2024-01-15 23-47-06

@jguille2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ups!!!
You are right @kseryi
I'm sorry. Snap! changed its locale file format in version 9... and I forgot to do the required conversion into the Snap4Arduino files.
Then, translations are broken for all the blocks with params.

I'll fix it right away and I will release a new v9 this week.

Thanks for reporting

Joan

@jguille2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @kseryi
I will try to make the "official release" of Snap4Arduino 9.2.1 tomorrow... but it is already released updating our online version to fix that translation issue.
You can check it
https://snap4arduino.rocks/run/#

Joan

Please sign in to comment.