If you click the save button, it will simply save a HTML file. To allow save offline, I need to add a SyncAdaptor that will sent single tiddler via HTTP request, then service worker can use workbox-background-sync <https://developers.google.com/web/tools/workbox/modules/workbox-background-sync> strategy to wait for onlien, and use cache to hode changes locally, if you reopen the app and it is still offline, syncadaptor can retch skinnytiddlers and changed tiddlers from service worker Cache API.
So to make it a read-write PWA, we need to use SyncAdaptor instead of Saver. And need to implement Cache and background-sync. I'm using Github to store tiddlers now, so I hope there can be a Github SyncAdaptor (and with multiple repo support, so I can save tiddlers tagged with "private" to be saved to a private repo) With Github SyncAdaptor, I can make it a read-write app that works offline and resync upon reconnect. --- I'm currently working on a NodeJS version of TiddlerDesktop (using WebCatalog app), that can save tiddlers instead of save HTML, this will works good with Github SyncAdaptor in the future. 在 2020年4月20日星期一 UTC+8下午12:02:54,TonyM写道: > > lin One two, > > I was very keen to see if TiddlyWiki could become a PWA. I used your link > on my android and the save, saved locally to a tiddlers(n).html file. Can > the changes be saved locally so the app can be accessed at the same address > or as a native icon on the phone?. > > What other imitations do you see? > > I love your contributions to the Tiddlywiki community, very innovative. > > Regards > Tony > > On Wednesday, April 15, 2020 at 4:41:20 AM UTC+10, LinOnetwo wrote: >> >> I read the tutorial of PWA today, and created a manifest.webmanifest : >> https://github.com/linonetwo/Tiddlywiki-NodeJS-Github-Template/blob/master/PublicWiki/public/manifest.webmanifest >> to test if it can turn my wiki into an APP that can be installed in my >> mobile phone, and I succeed! >> >> Then I use workbox >> <https://developers.google.com/web/tools/workbox/modules/workbox-precaching> >> (it allows me to write service worker easily) to create a service worker: >> https://github.com/linonetwo/Tiddlywiki-NodeJS-Github-Template/blob/master/PublicWiki/public/service-worker.js >> it make my wiki work offline, so that app really feels like an offline >> app, instead of a website. >> >> Now my wiki can serve as a quick manual APP for me to search in mobile, >> it can open fullscreen, and open in lightening fast speed, and work offline! >> The content of the wiki will get updated only if I deploy a new version >> of wiki, and close the website tab, then reopen the tab (so a service >> worker with new precache content will install >> <https://medium.com/better-programming/let-users-know-when-you-have-updated-your-service-worker-in-create-react-app-b0c2701995b3> >> ) >> >> Please try it out in your phone >> https://tiddlywiki-nodejs-github-template.now.sh >> The code is here: >> https://github.com/linonetwo/Tiddlywiki-NodeJS-Github-Template >> I will write a post about the detail later. >> > -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/de94cc5f-70b0-45cd-a901-4b84c08165e6%40googlegroups.com.
