We have PWA application written in Svelte/Sapper and we like to convert this app on mobile platforms. Because of some business reasons we need explicitly app in the Android and iOS store.
- On Android situation is easy. We will use Google TWA and all will be great.
- On Apple iOS I find it quite difficult. There is no such thing as Google TWA for iOS. And also ton of requirements of Apple store will be quite a pain.
Small note: We don't need any of the native APIs on mobile platforms. Pure JavaScript browser API is enough for us.
So I found Apache Cordova project that I think is the best for our problem and I found template for Svelte syonip/svelte-cordova-template. But it's not enough. Template is solving Svelte but not Sapper.
The best case scenario is that I download some Cordova/Svelte/Sapper template, copy existing source code, fix some issues on the way, export application to xCode project, build it and it will work on iOS without any major issues (but of course I expect some code changes but not total app rewrite).
Do you have perhaps some experience with Svelte/Sapper -> Cordova migration?
Edit1: I think that is will be possible to use Sapper export feature and pass builded files to Cordova. It will have some problems like not functioning routing when user manually change URL address (but for this specific use-case - mobile application - it's not problem because user will not be able to edit URL). Also server-side rendering, preloading and prefetching will be out of the question.
Edit2: After some digging I think it's not possible to convert Sapper application to Cordova. There are many problems with code splitting in Sapper. The biggest problems happens with CORS policies and with fact that Sapper app is designed to work with server and domain, not from filesystem. Maybe it would be possible to use some hidden localhost server in Cordova to serve files but it would be problematic and very nasty.
Edit3: We used existing Svelte/Sapper codebase with Flutter and Google TWA. Flutter app contains webview that is referencing public URL address of the front-end app.