loading...

Thinking about expo ( React native) versioning.

terrierscript profile image terrierscript ・1 min read

In expo, we need publish new version when build binary.
This behavior is a bit of a problem when enabling OTA.

We can disabling OTA, but it's useful in case of emergency

I think expo versioning for OTA friendly.
This based semantic versioning.

  • x(major) - Breaking Change.
  • y(minor) - Update when upload to apple store or google play store.
  • z(patch) - For OTA. Update without store upload.

minor is difference for semantic versioning.

We can this versioning with semver-extract.

$ semver-extract --pjson --minor -x
1.2.x

and package.json like this

"scripts": {
    "release-channel": "echo v$(semver-extract --pjson --minor -x)",
    "build:ios": "expo build:ios --release-channel=production-$(npm run release-channel --silent)"
}

If we upgrade store, version like 1.2.0 -> 1.3.0 and release channel change to production-v1.2 -> production-v1.3 (different release channel).
The other hand, we publish with OTA, version like 1.2.0 -> 1.2.1 and both version use release channel production-v1.2

Discussion

markdown guide