Skip to content
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

PWA functionality including offline mode (featured flagged) #1170

Merged
merged 39 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2ee6616
PWA attempt using vite pwa plugin
microbit-robert Apr 17, 2024
1034ae4
Don't precache language related assets
microbit-robert Apr 19, 2024
96f0606
Fix icon for mac/iOS
microbit-robert Apr 19, 2024
2a7c538
Another attempt to fix icon route
microbit-robert Apr 19, 2024
4fe5d63
Use sim branch with service worker
microbit-robert Apr 23, 2024
088bf8f
Remove dev option from pwa config
microbit-robert Apr 24, 2024
70141a3
Remove unused cache, precache pyright-main*.js
microbit-robert Apr 24, 2024
f7e193d
Useful comment [ci skip]
microbit-robert Apr 24, 2024
9c50c3c
More reasonable PWA config
microbit-robert Apr 24, 2024
d1c2963
Parameterize Sanity project and dataset vars
microbit-robert Apr 24, 2024
a2dcb6f
Service worker tweaks including auto reload
microbit-robert Apr 25, 2024
b74b33c
Fix types after typescript config change
microbit-robert Apr 25, 2024
fcf4d63
Add fallback component for offline images
microbit-robert Apr 25, 2024
710ea9e
Make offline image text translatable
microbit-robert Apr 25, 2024
904e486
Precache fallback lang and implement offline fallback
microbit-robert Apr 26, 2024
e85920e
Only show placeholder image if offline
microbit-robert Apr 26, 2024
22dd200
Cache runtime resources on first load
microbit-robert Apr 26, 2024
f2f0207
Add missed ignoreFallback prop
microbit-robert Apr 26, 2024
c89afcd
Show toast when language is unavailable offline
microbit-robert Apr 26, 2024
7a36123
Add feature and build flags to enable/disable pwa
microbit-robert Apr 29, 2024
7805926
Merge branch 'main' into pwa
microbit-robert Apr 29, 2024
5233dff
Base URL for webmanifest injection
microbit-robert Apr 29, 2024
5877fc6
Handle base URL and webmanifest link tag with feature flag
microbit-robert Apr 29, 2024
cc78efd
Default pwa flag to true for review branches
microbit-robert Apr 29, 2024
2faa021
Propagate pwa flag to simulator
microbit-robert Apr 30, 2024
d45eeae
Only precache the pyright-locale file of the fallback language
microbit-robert May 3, 2024
129ad85
Update comments
microbit-robert May 3, 2024
387c439
Support flags from local storage as well as URL
microbit-matt-hillsdon May 28, 2024
2c39a9f
Merge branch 'localstorage-flags' into pwa
microbit-matt-hillsdon May 28, 2024
de5a8ea
Update Pyright
microbit-matt-hillsdon May 28, 2024
de7fdd4
Remove the defaultOnStages for pwa flag
microbit-matt-hillsdon May 28, 2024
4fb45ed
Merge branch 'main' into pwa
microbit-matt-hillsdon May 28, 2024
f168fb7
Fix conflict mess
microbit-matt-hillsdon May 28, 2024
589b815
Tweak enablement; add cache id
microbit-matt-hillsdon May 29, 2024
2b1cc97
More caution
microbit-matt-hillsdon May 29, 2024
7bc9cf5
cacheId only applies to pre-cache
microbit-matt-hillsdon May 29, 2024
369a982
Fix extra slash
microbit-matt-hillsdon May 29, 2024
61213d2
Clean up if the PWA flag is disabled
microbit-matt-hillsdon May 29, 2024
cae3884
Tweak message
microbit-matt-hillsdon May 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="%BASE_URL%favicon.ico" />
<link rel="apple-touch-icon" href="%BASE_URL%logo512.png" sizes="512x512" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#6c4bc1" />
<title>micro:bit Python Editor</title>
<meta
name="description"
content="A Python Editor for the BBC micro:bit, built by the Micro:bit Educational Foundation and the global Python Community."
/>
<meta property="og:title" content="micro:bit Python Editor" />
<meta
property="og:description"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "Has d'<link>actualitzar el teu microprogramari</link> abans de poder connectar amb aquesta micro:bit.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Obert",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "Du musst <link>die Firmware aktualisieren</link>, bevor eine Verbindung zu diesem micro:bit hergestellt werden kann.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Öffnen",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@
"defaultMessage": "You must <link>update your firmware before</link> you can connect to this micro:bit.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Open",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "Debes <link>actualizar el firmware</link> para poder conectar a este micro:bit.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Abrir",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "Vous devez <link>mettre à jour le micrologiciel</link> avant de pouvoir vous connecter à ce micro:bit.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Ouvrir",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "このmicro:bitに接続するには、<link>ファームウェアを更新</link>する必要があります。",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "開く",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "이 micro:bit에 연결하기 전에 <link>펌웨어를 업데이트</link>해야 합니다.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "열기",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "Je moet <link>firmware updaten voordat</link> je verbinding kan maken met deze micro:bit.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Open",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "您必须 <link>update your firmware before</link> 才能连接到此 micro:bit。",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "打开",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "您必須<link>更新您的韌體</link>,然後才能連線至此 micro:bit。",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "開啟",
"description": "Open button text"
Expand Down
Loading
Loading