Hermes is a small and lightweight JavaScript engine optimized for running React Native apps..
Перейти к файлу
Vladimir Morozov 16062c0cd1
Implement new rules for release versions (#133)
## Summary

We need to implement a simple versioning schema for hermes-windows releases from release branches and
pre-releases from the main branch.
Thanks a lot to @dannyvv who implemented the version generation for this PR.

## The versioning schema

The versioning schema is described in the new `doc\WindowsVersioning.md ` document:
- The **pre-release package versions** built in the `main` branch look like
**0.0.0-2209.9002-8af7870c** where the `<major>.<minor>.<patch>` versions are
always `'0.0.0'`, and the prerelease part that follows after `'-'` is
`'yyMM.drrr-hhhhhhhh'`. Where `'yy'` are two numbers for the year, `'MM'` are
two numbers for the month, `'d'` is the day without `0` prefix, `'rrr'` is a
three digit number for the today's revision, and `'hhhhhhhh'` are the first 8
hexadecimal numbers from the source GitHub commit hash.
- The **pre-release file versions** look like `0.0.2209.9002` where the the
encoding is `'0.0.yyMM.drrr'`. Where numbers after `'0.0.'` have the same
encoding as for the pre-release package version.
- The **released package versions** use the usual semantic schema which is
based on RNW release numbers like `0.70.1`, where the `'0.70'` is the
`<major>.<minor>` release of RNW and RN, and the last number is a `'patch'`
number for that release. Note that the `'patch'` number will not match the
`'patch'` number of the RNW. We are going to generate the `'patch'` number
using ADO build revision with format `'r'` that avoids `0` prefixes for the
version to be valid semantic version.
- The `release file versions` look like `0.70.1.0` to match the version of the package. The last part of the file version number is always `0`.

Note, that the release version is going to be generated by the release pipeline.
We do not expect the release version to be set somewhere in the source files or by using the processes like beachball.

## Implementation details

- The `publish.yml` has a new `Setup` job that generates version numbers for the package and files using the new `setVersionNumber.js` script. The result of this job is used by `jobs.yml` to create two new variables `semanticVersion` and `fileVersion`. One is used for package semantic version and the other for the DLL/EXE file versions.
- The `semanticVersion` and `fileVersion` are passed to `cibuild.ps1` where they are used to update CMake project version and `package.json` version. The `fileVersion` is passed to CMake build as `HERMES_FILE_VERSION` definition.
- We ensure that `hermes.dll`, `inspector.dll`, and `hermes.exe` projects have the `version.rc` generated with the product and file versions, and with other meta-data settings.
- The generated Nuget packages pickup their versions from the `package.json` file.
- We set back versions in `package.json` and `CMakeLists.txt` to `0.12.0` to match `facebook/hermes` repo. This is done to reduce the diff between the two repos. We are always going to generate these versions in our release pipeline.
- The `ReactNative.Hermes.Windows.Fat.nuspec` is updated to match the `ReactNative.Hermes.Windows.nuspec` because it was missing some files such as `License`, and also had some unnecessary files such as `ninja` build scripts. Now the only extra files there are the symbol `*.pdb` files.
2022-09-30 03:54:52 +00:00
.ado Implement new rules for release versions (#133) 2022-09-30 03:54:52 +00:00
.circleci Export wasm CLI artifact (#801) 2022-08-27 10:14:48 -07:00
.github Merge tag 'hermes-2022-07-15-RNv0.70.0-88dd5731a19ab6b38b0a0a2d4386ba959f2a2c98' 2022-08-16 06:29:07 -07:00
API Implement new rules for release versions (#133) 2022-09-30 03:54:52 +00:00
android Bump version to 0.12.0 2022-08-16 11:18:07 -07:00
cmake/modules Merge tag 'hermes-2022-07-15-RNv0.70.0-88dd5731a19ab6b38b0a0a2d4386ba959f2a2c98' 2022-08-16 06:29:07 -07:00
doc Implement new rules for release versions (#133) 2022-09-30 03:54:52 +00:00
external Merge branch 'meta/main' 2022-09-01 08:32:59 -07:00
include Unfork some hermes-windows changes (#128) 2022-09-07 07:00:11 +00:00
lib Unfork some hermes-windows changes (#128) 2022-09-07 07:00:11 +00:00
lldb Update copyright headers from Facebook to Meta 2021-12-30 15:08:38 -08:00
npm Implement new rules for release versions (#133) 2022-09-30 03:54:52 +00:00
public Merge branch 'meta/main' 2022-09-01 08:32:59 -07:00
test Fix BigInt conversion from boolean objects 2022-08-23 13:49:08 -07:00
tools Implement new rules for release versions (#133) 2022-09-30 03:54:52 +00:00
unittests Fix CMake build that uses VS 2022 (#129) 2022-09-09 18:29:15 +00:00
unsupported Remove unsupported/static_h 2022-08-19 21:41:53 -07:00
utils Merge branch 'meta/main' 2022-09-01 07:58:47 -07:00
website Merge branch 'meta/main' 2022-09-01 07:58:47 -07:00
.clang-format Initial commit 2019-07-10 09:43:55 -07:00
.clang-tidy EASY: disable facebook-hte-MissingBraces 2020-12-10 19:39:32 -08:00
.gitignore Enable security rules (#73) 2022-02-10 19:25:19 +00:00
CMakeLists.txt Implement new rules for release versions (#133) 2022-09-30 03:54:52 +00:00
CODE_OF_CONDUCT.md Repo Metadata 2021-09-09 07:55:43 -07:00
CONTRIBUTING.md Merge tag 'v0.11.0' into merge_v0.11 2022-02-09 07:38:57 -08:00
GuardianCustomConfiguration.json Make pipeline compliant 2022-02-18 10:57:27 -08:00
LICENSE Merge tag 'v0.11.0' into merge_v0.11 2022-02-09 07:38:57 -08:00
README.md Merge tag 'hermes-2022-04-28-RNv0.69.0-15d07c2edd29a4ea0b8f15ab0588a0c1adb1200f' 2022-08-16 05:58:08 -07:00
SECURITY.md Repo Metadata 2021-09-09 07:55:43 -07:00
git-revision Initial commit 2019-07-10 09:43:55 -07:00
hermes-engine.podspec Bump version to 0.12.0 2022-08-16 11:18:07 -07:00

README.md

Hermes JS Engine

MIT license npm version PRs Welcome Hermes logo - large H with wings

Hermes is a JavaScript engine optimized for fast start-up of React Native apps. It features ahead-of-time static optimization and compact bytecode.

If you're only interested in using pre-built Hermes in a new or existing React Native app, you do not need to follow this guide or have direct access to the Hermes source. Instead, just follow these instructions to enable Hermes.

Noted that each Hermes release is aimed at a specific RN version. The rule of thumb is to always follow Hermes releases strictly. Version mismatch can result in instant crash of your apps in the worst case scenario.

If you want to know how to build and hack on Hermes directly, and/or integrate Hermes built from source into a React Native app then read on.

The instructions here very briefly cover steps to build the Hermes CLI. They assume you have typical native development tools setup for your OS, and support for cmake and Ninja. For more details of required dependencies, building Hermes with different options, etc. follow these links instead:

To build a local debug version of the Hermes CLI tools the following steps should get you started on macOS/Linux: The following commands should get you going in a Windows Command Prompt:

mkdir hermes_workingdir
cd hermes_workingdir
git clone https://github.com/facebook/hermes.git
cmake -S hermes -B build -G Ninja
cmake --build ./build

Or if you're using Windows, the following should get you going in a Git Bash shell:

mkdir hermes_workingdir
cd hermes_workingdir
git -c core.autocrlf=false clone https://github.com/facebook/hermes.git
cmake -S hermes -B build -G 'Visual Studio 16 2019' -A x64
cmake --build ./build

You will now be in a directory with the output of building Hermes into CLI tools. From here you can run a piece of JavaScript as follows:

echo 'use strict'; function hello() { print('Hello World'); } hello(); | .\bin\Release\hermes.exe

For more details on Hermes for Android, see here.

Contributing

The main purpose of this repository is to brings Hermes support to React Native Windows. We are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can participate.

Code of Conduct

Both Microsoft and Facebook have adopted Codes of Conduct that we expect project participants to adhere to. Microsoft's Code of Conduct can be found here and Facebook's here. Please read through them so that you can understand what actions will and will not be tolerated.

Contributing Guide

Read our contributing guide to learn about our development process as well as how to propose bugfixes and improvements.

License

Hermes is MIT licensed.