feat: support module_version for add-to-app releases#121
feat: support module_version for add-to-app releases#121eseidel wants to merge 7 commits intoadd-build-tracefrom
Conversation
When shorebird.yaml contains a release_version field, use it as the release version instead of the host app's version+versionCode. This enables add-to-app (AAR/iOS framework) releases where the module's identity needs to be independent of the host app's version. The CLI injects this field during `shorebird release aar` builds. Falls back to existing behavior when release_version is absent, so this is fully backwards-compatible. Part of shorebirdtech/shorebird#793
When the SHOREBIRD_RELEASE_VERSION environment variable is set, write it as release_version into the compiled shorebird.yaml. This follows the same pattern as SHOREBIRD_PUBLIC_KEY. The Shorebird CLI sets this env var during `shorebird release aar` builds. The engine reads release_version from the compiled yaml and uses it instead of the host app's version for patch checking. Part of shorebirdtech/shorebird#793
The concept applies to both AAR and iOS framework releases — module_version is the platform-agnostic name for the version of an embeddable Flutter module.
Design discussion: module_version vs release_version in the protocolThe current approach in this PR works by having the engine substitute
However, this means the host app's actual version is thrown away. The server has no way to distinguish a module version (git hash) from an app version, and can't report which host app versions are running a given module. Alternative: plumb module_version as a separate fieldInstead of overriding
The updater would then send both in the This requires touching more code:
But avoids future problems:
RecommendationThe current PR is a valid MVP, but we're leaning toward plumbing Leaving this here for discussion before we decide which path to take. |
Instead of overriding release_version in the engine, pass module_version as a separate optional field through the full stack: - YamlConfig: parse module_version from shorebird.yaml - UpdateConfig: propagate module_version - PatchCheckRequest: send module_version alongside release_version - Engine C++: revert release_version override, pass host app version through unchanged The server uses module_version for patch lookup when present, while release_version always contains the host app's version for analytics. This avoids polluting release_version data with git hashes from module releases. Part of shorebirdtech/shorebird#793
Summary
SHOREBIRD_MODULE_VERSIONenv var incompileShorebirdYaml()and writemodule_versioninto the compiledshorebird.yaml(same pattern asSHOREBIRD_PUBLIC_KEY)module_versionfrom shorebird.yaml, add toUpdateConfigandPatchCheckRequestas a separate optional field sent alongsiderelease_versionContext
Part of shorebirdtech/shorebird#793
release_versionalways stays the host app's version.module_versionis a separate field used for patch lookup in add-to-app releases where the module's identity is independent of the host app.Companion PRs:
Test plan
module_versionappears in compiled yaml when env var is set