Cap-go / capacitor-updater

Capacitor plugin for Instant updates: Ship updates, fixes, changes, and features within minutes
https://capgo.app
Mozilla Public License 2.0
532 stars 107 forks source link

feat: Partial / Delta Live Updates #225

Closed webbpage closed 1 month ago

webbpage commented 1 year ago

Feature Request

Delta updates would make for much faster live-update installs

Description

Any project greater than 20MB can create slow/poor update experience for users. This can be avoided by only including the necessary files.

Preferred Solution

Ionic appflow uses a pro-manifest.json file upon deploy the track what has changed since previous manual update. This allows for much smaller downloads, since the pro-manifest is referenced do only download the changes.

Alternatives

I'd even settle for the ability to have a capgo.ignore file that ignores my large js libraries, images to create a better experience for my users.

Platform(s)

ios/android

riderx commented 1 year ago

Hello that one of the top request, currently it's a bit hard to achieve for 2 reason: The updates are not only applied sequentially, you use The updater to try one of your branch, then go back to main or dev and back. You can also test back old version. It's also needed for user who didn't do update since 3 month to get the right files. All this usecases have to work with partial update. There also a second reason, full end-to-end encryption, currently the updater support end-to-end encryption, who is done at the zip level, so changing by file would need to have encryption by file. And the key can change so that also something to take in consideration.

When i talked to most of the client of Capgo who needed this, we found way to optimize assets to get under 10mb.

Many assets who don't need to be into the code bundle, or can be optimized with webp/webm format. it will also accelerate the download into app store and make you loose less users at that stage. Here is a tutorial to make your app lighter: https://capgo.app/blog/optimise-your-images-for-updates/

If you want to show me your usage and need, i'm happy to help on the discord

webbpage commented 1 year ago

Thank you for your response. I'm using the OpenUI5 JS framework which is a significant portion of my app size (even after efforts to optimize). OpenUI5 can be compared to Ionic, but with more advanced UI controls (https://openui5.org/releases/). Currently, if I do not include this JS library directory in my Capgo .zip the update of course breaks. Per my Alternative, it would be cool if the .zip could be unpacked without impacting directories in a "capgo.ignore" file. It sounds like even that is a lot to bite off?

Tallyb commented 7 months ago

Not sure what is the current status, but you should go along the method that PWA and Ionic Appflow are using which is using a manifest that contains files and their hashes and then diff only pack only the files that changed. https://ionic.io/docs/appflow/deploy/differentials

riderx commented 6 months ago

That the Way we went ! We are now almost ready to test it :)

webbpage commented 5 months ago

That is great news - thanks for the update!

riderx commented 5 months ago

It’s currently in pause because we had to fix some issue I capgo but soon back on the topic.

webbpage commented 4 months ago

It looks like there is a need to expedite Partial Updates before other conflicting updates. Can someone confirm that this was prioritized?

https://github.com/Cap-go/capacitor-updater/issues/392

riderx commented 4 months ago

Partial update are still currently in old, and we are preparing the platform to receive this with ease as when we tried to make this change in the current code it brings us to many issue, as the code was not clear enough to do such big change. Partial will happen during this summer for sure

unre4l commented 1 month ago

Hi, is there any update on this topic or perhaps a roadmap? Really looking forward to differntial updates.

riderx commented 1 month ago

We are almost done on native side we need for that to test. And this requires us to have the upload working and we are stuck on that one for now. Upload to presigned s3 work well for one file. But don’t work nice for +300 files with partial update. So I’m actually trying to implement TUS protocol to upgrade our upload implementation. And then we will test in production again and see if our user can upload, al around the world. Then we will un lock the next step to test the native

unre4l commented 1 month ago

Thanks for the heads up on this! So differential updates will be exclusive to the paid service? For the self-hosted scenario, the feature would not necessarily have to provide a solution to the asset upload problem.

riderx commented 1 month ago

First the "paid service" as that what pay my bills :) Then I will look at how it can work for self-hosted.

riderx commented 1 month ago

We got upload to work with TUS protocole ! This also give us the knowledge to not use S3 presign on read as well.

riderx commented 1 month ago

It's finally done you can try it with version 6.3.0 and Capgo cloud, use the bundle upload with --manifest option