🛍️ 更多精选好物 ›
📊 公开数据一览
| 📦 榜单安装量 | 42 |
| ⭐ GitHub Stars | 11,232(fork 838) |
| 🗓️ 最近推送 | 2026-08-05 |
| 🌱 项目创建 | 2018-10-22 |
| 💻 语言 / License | JavaScript · MIT |
| 🐛 开放Issue | 222 |
📝 工具简介
为运行React Native优化的JavaScript引擎。
📖 怎么用
先建工作目录并克隆源码,`mkdir hermes_workingdir && cd hermes_workingdir && git clone https://github.com/facebook/hermes.git`。然后配置构建,Linux/macOS 用 `cmake -S hermes -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug`,Windows 用 `cmake -S hermes -B build -G 'Visual Studio 16 2019' -A x64`。接着编译,`cmake --build ./build`。最后测试运行,`echo "'use strict'; function hello() { print('Hello World'); } hello();" | ./bin/hermes`。注意 Hermes 版本要和 RN 版本严格匹配,不匹配会闪退。
📋 迷你测评
为React Native定制的JavaScript引擎优化技能。亮点是直接冲着“安全”去,减少内存崩漏风险。适合跑RN应用时更稳,但具体性能提升多少,简介里没提。
📄 README 要点
这是Hermes JavaScript引擎的官方仓库。Hermes是专门为React Native应用快速启动而优化的JS引擎,特点是支持提前静态优化和紧凑字节码。如果你只是想在React Native应用里用现成的Hermes,那不需要看这个仓库,直接按官方指南启用就行。但要注意,每个Hermes版本对应特定的React Native版本,版本不匹配最坏情况会导致应用直接崩溃,所以一定要严格跟随版本。这个仓库主要是给想从源码构建、修改或集成Hermes到应用里的开发者看的,里面也提到了构建Hermes CLI的简要步骤,还有深入讲解Hermes内部原理的技术文章。适合对React Native性能优化有极致追求,或者想深入理解JS引擎底层的开发者。
查看英文原文
Hermes JS Engine 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: Building and Running Hermes Using a custom Hermes build in a React Native app To build a local debug version of the Hermes CLI tools the following steps should get you started on macOS/Linux: [安装/使用命令见下方] Or if you're using Windows, the following should get you going in a Git Bash shell: [安装/使用命令见下方] 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: [安装/使用命令见下方] 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 w
💬 评论(0)
交流使用体验、避坑建议;违规内容将被删除