MCPcopy
hub / github.com/facebook/hermes

github.com/facebook/hermes @hermes-v250829098.0.14 sqlite

repository ↗ · DeepWiki ↗ · release hermes-v250829098.0.14 ↗
20,526 symbols 40,654 edges 5,757 files 1,056 documented · 5%
README

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:

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.

Extension points exported contracts — how you extend this code

C (Interface)
(no doc) [6 implementers]
external/flowtest/test/flow/types/interfaces/prop_named_static.js
IPlatformDateTimeFormatter (Interface)
(no doc) [4 implementers]
lib/Platform/Intl/java/com/facebook/hermes/intl/IPlatformDateTimeFormatter.java
MethodDefinitionBase (Interface)
this should not be directly used - instead use MethodDefinitionComputedNameBase or MethodDefinitionNonComputedNameBase
tools/hermes-parser/js/flow-api-translator/src/utils/ts-estree-ast-types.js
Thing (Interface)
(no doc) [2 implementers]
benchmarks/raytracer/original/raytracer.ts
I (Interface)
(no doc)
test/Parser/flow/static-property-errors.js
BabelCommentBlock (Interface)
(no doc)
benchmarks/build-helpers/flow-bundler/src/utils.js
D (Interface)
(no doc) [6 implementers]
external/flowtest/test/flow/types/interfaces/prop_named_static.js
IPlatformNumberFormatter (Interface)
(no doc) [4 implementers]
lib/Platform/Intl/java/com/facebook/hermes/intl/IPlatformNumberFormatter.java

Core symbols most depended-on inside this repo

emit_16
called by 98304
benchmarks/octane/mandreel.js
emit_16
called by 98304
benchmarks/octane/mandreel_latency.js
emit_32
called by 53527
benchmarks/octane/mandreel.js
emit_32
called by 53527
benchmarks/octane/mandreel_latency.js
print
called by 7876
tools/hermes-parser/js/hermes-transform/src/transform/print.js
toEqual
called by 876
tools/hermes-parser/js/flow-typed/jest.js
Malloc
called by 779
benchmarks/octane/mandreel.js
Malloc
called by 779
benchmarks/octane/mandreel_latency.js

Shape

Function 14,531
Method 2,737
Class 2,556
Interface 588
Enum 114

Languages

TypeScript94%
Python4%
Java2%

Modules by API surface

benchmarks/raytracer/typed/js_externs.js2,510 symbols
benchmarks/octane/mandreel_latency.js1,345 symbols
benchmarks/octane/mandreel.js1,345 symbols
tools/hermes-parser/js/prettier-plugin-hermes-parser/index.mjs1,102 symbols
benchmarks/octane/typescript.js368 symbols
benchmarks/bench-runner/resource/test-suites/octane/typescript.js357 symbols
benchmarks/octane/earley-boyer.js323 symbols
benchmarks/bench-runner/resource/test-suites/octane/earley-boyer.js312 symbols
tools/hermes-parser/js/hermes-estree/src/generated/predicates.js301 symbols
benchmarks/octane/pdfjs.js292 symbols
tools/hermes-parser/js/hermes-parser/src/HermesParserNodeDeserializers.js282 symbols
benchmarks/bench-runner/resource/test-suites/octane/pdfjs.js281 symbols

Dependencies from manifests, versioned

@babel/cli7.16.0 · 1×
@babel/code-frame7.16.0 · 1×
@babel/core7.16.5 · 1×
@babel/generator7.7.4 · 1×
@babel/node7.15.8 · 1×
@babel/parser7.7.4 · 1×
@babel/plugin-proposal-class-properties7.16.5 · 1×
@babel/plugin-syntax-flow7.16.7 · 1×
@babel/plugin-transform-classes7.13.0 · 1×
@babel/plugin-transform-flow-strip-types7.16.7 · 1×
@babel/preset-env7.16.5 · 1×
@babel/preset-flow7.20.0 · 1×

For agents

$ claude mcp add hermes \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact