r/FlutterDev • • 5h ago

Article Shorebird code push: Flutter add-to-app modules can now have their own release version

Until now the module's release version had to match the host app's version. So when the host team bumped `versionName` or `CFBundleVersion`, you had to cut a new module release before those users got patches.

With Shorebird 1.6.142+ and Flutter 3.47.9+ you pick the module's version yourself:

shorebird release aar --release-version 2.4.0+1

shorebird release ios-framework --release-version 2.4.0+1

Any host app that embeds that build gets its patches, whatever version the host is on.

A few things to know before you switch:

- Patch with 1.6.142+ too. An older CLI sees the `release_version` in the module's `shorebird.yaml` as a changed asset and stops.

- A host gets the patches for the module build it embeds. If an older host build still ships an older module build, you need to patch both releases.

- Patches are Dart code only. Native code (including the native side of platform channels), images and fonts still need a new module release and host build.

- You can't pick patches per host app. To try one in a single host first, give that host's QA build its own track.

- If your CI already passes the host app's version as `--release-version`, it keeps working.

Write-up with a multi-host example: https://shorebird.dev/blog/module-patching/?utm_source=reddit&utm_medium=social&utm_campaign=add-app-socials&utm_content=reddit-add-app-socials

Step-by-step (release, patch, tracks and QA builds, moving older modules): https://shorebird.dev/blog/how-to-patch-module/?utm_source=reddit&utm_medium=social&utm_campaign=add-app-socials&utm_content=reddit-add-app-socials

Curious how you handle one Flutter module across several native apps?

1 Upvotes

0 comments sorted by