Skip to content

Proposal: @react-native-community/template versioning scheme #2345

@blakef

Description

@blakef

Background

As part of the move to support changes in the RFC-0759 React Native Frameworks, we're going to have to come up with a semver based versioning scheme to use with the @react-native-community/template package.

Proposal

  1. Track only the npm MINOR number, and use the latest PATCH
  2. Clean up the init command:
  --version <string>              Shortcut for `--template react-native@version`
  • version text should just read --template @react-native-community/template@version

Example

community-cli-template-scheme

As with the existing template, the version of React Native should be exactly pinned so users can manage upgrading from their template version manually. The downside of this approach is that we have to maintain this compatibility list as part of the release process, which no-longer is done for "free" as part of the react-native release process.

Problems

React Native version pinning

$ npx @react-native-community/cli init --version 0.75.0 Foobar

Currently we pin the version of React Native to each template release. Since the template was bound to the react-native npm package this wasn't an issue. We'd automatically get a release with each release of react-native. We no longer get this.

The first approach that comes to mind is:

  1. bump the PATCH version for every PATCH release of React Native. For example:
  1. Update a map of some kind between { [react-native-version]: template-version } within the package.json that init can lookup using https://registry.npmjs.org/react-native/latest which is guaranteed to have all reverse lookups.
"name": "@react-native-community/template",
...
"react-native-versions": {
  "0.74.0": "0.74.0",
  "0.74.1": "0.74.0",
  "0.74.2": "0.74.0",
  "0.74.3": "0.74.0",
  "0.74.4": "0.74.0",
  "0.74.5": "0.74.0",
  "0.74.6": "0.74.1",
  "0.75.0-rc1": "0.75.0",
  "0.75.0-rc2": "0.75.1",
  "0.75.0-rc3": "0.75.2",
  "0.75.0": "0.75.2",
  "0.75.1": "0.75.3",
  ...
}

It's entirely possible that we can do some basic work to compress that a little (see the sequence of 0.74.0-5 with matching template version of 0.74.0), but for now it might be good just keep it simple.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions