DEV Community

terrierscript
terrierscript

Posted on

Thinking about expo ( React native) versioning.

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

Top comments (1)

Collapse
 
gerynugraha profile image
Gery Nugraha

Hi, @terrierscript given that Expo is moving toward eas build did you find a way to do this using eas? As far as I know, they don't support overriding the release channel in command line args