hermes README

The project's README from github.com/facebook/hermes. As one markdown file: 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.

Hermes Blog - Technical articles and deep dives into Hermes internals.

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:

mkdir hermes_workingdir
cd hermes_workingdir
git clone https://github.com/facebook/hermes.git
cmake -S hermes -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
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/hermes

Contributing

The main purpose of this repository is to continue to evolve Hermes, making it faster and more efficient. We are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Hermes.

Code of Conduct

Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text 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, how to propose bugfixes and improvements, and how to build and test your changes to Hermes.

License

Hermes is MIT licensed.

hermes (facebook/hermes)

Searching Database…

11.4K ·GitHub
What is this?Hermes is a JavaScript engine optimized for fast start-up of React Native apps, using ahead-of-time static optimization and compact bytecode instead of parsing raw JS at runtime.
Is Hermes a library I embed, or a standalone program?It's primarily a JS engine library embedded inside React Native apps, but the repo also builds standalone CLI tools that let you run a piece of JavaScript directly from the command line.
How do I add Hermes to a React Native app?If you just want to use the prebuilt engine, you don't need this source repo at all — you simply follow the React Native instructions to enable Hermes in a new or existing app.
Does any Hermes version work with any React Native version?No — each Hermes release targets a specific React Native version, and the README warns you should strictly follow that pairing since a mismatch can crash your app outright.
Which platforms does Hermes build and run on?The CI covers Android, Apple platforms (including iOS slices), macOS, Linux, and Windows builds, so Hermes targets the full set of platforms React Native itself runs on.
Why does Hermes exist instead of just using the system JS engine?It was built specifically to optimize app start-up time on mobile by precompiling JavaScript ahead of time into compact bytecode, rather than parsing and JIT-compiling source at launch.
Can I try the Hermes CLI without touching React Native at all?Yes — after building the project with cmake/Ninja you get standalone CLI tools in the output directory that can execute a JavaScript file directly.
Where do I go for deeper build options and internals?The README links out to a dedicated 'Building and Running Hermes' guide and a Hermes Blog with technical deep dives for anything beyond the quick-start steps.
What are similar projects?mquickjs, flipper, bgfx, goldie, matrix, porffor, react-native, Detox
Creator
facebook
Size
112 MB
Stars
11.4K
Age
7y
Commits · 90 Days