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
这是什么?Hermes 是一个 JavaScript 引擎,专为加快 React Native 应用的启动速度而优化。它采用提前(AOT)静态优化和紧凑的字节码,而不是在运行时直接解析原始 JS。
Hermes 是一个可以嵌入的库,还是独立的程序?它主要是嵌入在 React Native 应用内部的 JavaScript 引擎库,但仓库中也会构建独立的命令行工具,让你可以直接在命令行中运行一段 JavaScript。
怎样把 Hermes 添加到 React Native 应用中?如果你只想使用预构建的引擎,完全不需要这个源码仓库,只要按照 React Native 的说明,在新建或已有的应用中启用 Hermes 即可。
任何版本的 Hermes 都能配合任何版本的 React Native 使用吗?不能。每个 Hermes 版本都针对特定的 React Native 版本,README 提醒你必须严格遵循这种配对关系,因为版本不匹配可能直接导致应用崩溃。
Hermes 能在哪些平台上构建和运行?持续集成(CI)覆盖了 Android、Apple 平台(包括 iOS 的各个切片)、macOS、Linux 和 Windows 的构建,因此 Hermes 覆盖了 React Native 本身运行的全部平台。
为什么要有 Hermes,而不直接使用系统自带的 JS 引擎?它专为优化移动端应用的启动时间而开发:预先把 JavaScript 编译成紧凑的字节码,而不是在启动时解析并即时编译源代码。
我不接触 React Native,能单独试用 Hermes 命令行工具吗?可以。使用 cmake/Ninja 构建项目后,在输出目录中会得到独立的命令行工具,它们可以直接执行 JavaScript 文件。
想了解更深入的构建选项和内部原理,去哪里看?README 链接到了专门的《Building and Running Hermes》构建指南,以及 Hermes 博客,上面有技术深度文章,可以满足快速入门步骤之外的需求。
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