Remove Hermes vendoring once React Native ships a Hermes with Node-API
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- android, cpp, react-native, ruby, typescript
- 领域
- build-system, mobile, tooling
调研方向
首先检查 React Native 的 version.properties,并检查 API/napi/ 对应的 Hermes tag,然后验证随附的 Android 和 Apple 工件是否暴露所需的 Node-API 符号和头文件。在移除 vendoring 路径之前,检查列出的 CLI、Gradle、C++、podspec、workflow、app、文档和 package 文件。测试应用能够在不使用 REACT_NATIVE_OVERRIDE_HERMES_DIR 或 build-from-source 配置的情况下,基于原生 React Native 构建并通过测试,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Tracking the removal of vendor-hermes and everything that hangs off it, gated on React Native shipping a Hermes that carries Node-API.
Why we vendor today
After #372 we no longer patch Hermes — we build it from a pinned commit on the static_h branch, which carries the first-party Node-API implementation under API/napi (target hermesNapi). The pin lives in packages/host/src/node/cli/hermes.ts, and the host calls into it directly (hermes_napi_create_env in packages/host/cpp/CxxNodeApiHostModule.cpp, with the hermes_napi_host struct mirrored in packages/host/cpp/HermesNapiHost.hpp).
React Native's own Hermes doesn't have that code yet, which is the only reason we need REACT_NATIVE_OVERRIDE_HERMES_DIR — and therefore the only reason consumers have to build React Native from source at all.
The gate
React Native doesn't tag every nightly, so read the head of the default branch rather than a release:
packages/react-native/sdks/hermes-engine/version.propertieson the default branch offacebook/react-native→HERMES_VERSION_NAME.- Check whether
facebook/hermesat taghermes-v$HERMES_VERSION_NAMEhas anAPI/napi/directory.
State as of 2026-09-19:
HERMES_VERSION_NAME=260318099.0.2(unchanged since at least 2026-09-14 — five consecutive checks, 2026-09-14 through 2026-09-19, have all read the same value)API/napi/hermes_napi.h→ still 404 athermes-v260318099.0.2, whileAPI/hermes/hermes.hresolves at the same tag — so the tag is valid and still carries no Node-API. No open PR references this issue. Still nothing to poll for besides re-checking the gate.
That's the cheap signal to poll. Something like:
version=$(curl -fsSL https://raw.githubusercontent.com/facebook/react-native/main/packages/react-native/sdks/hermes-engine/version.properties | sed -n 's/^HERMES_VERSION_NAME=//p')
curl -fsSLo /dev/null "https://raw.githubusercontent.com/facebook/hermes/hermes-v$version/API/napi/hermes_napi.h" && echo "Node-API has landed in RN's Hermes ($version)"
Necessary, but not sufficient
The version check tells us the source has Node-API in it; before dropping anything we still need the shipped artifacts to expose it:
- the
hermes-engineAAR'slibhermesvm.somust exporthermes_napi_create_env(Hermes has to build thehermesNapitarget and keep it visible under its global-fvisibility=hidden, cf. facebook/hermes#2106 — see the pin comment inhermes.ts), - the same for the Hermes framework shipped through the podspec on Apple platforms,
hermes_napi.h(or an equivalent public header) needs to reach us through prefab / the framework headers, soHermesNapiHost.hppcan include it instead of mirroring the struct,IHermes::getVMRuntimeUnsafe()still has to be reachable from the JSI runtime.
The real acceptance test is the test app building and passing against a stock React Native with no REACT_NATIVE_OVERRIDE_HERMES_DIR set and no build-from-source configuration.
What removal touches
packages/host/src/node/cli/hermes.ts— thevendor-hermescommand, plus its registration inpackages/host/src/node/cli/program.ts(a breaking CLI change, so it wants a major changeset)packages/host/android/build.gradle:7-17— theREACT_NATIVE_OVERRIDE_HERMES_DIRguard, andpackages/host/src/node/gradle.test.ts, which asserts that errorpackages/host/scripts/patch-hermes.rband itsrequire_relativein the podspec.github/workflows/check.yml:330-333— the vendoring step in the Android jobapps/test-app/android/gradle.properties—react.buildFromSource=truebecomes unnecessarypackages/host/cpp/HermesNapiHost.hpp— include the realhermes_napi.hinstead of mirroringhermes_napi_host, which also removes the "re-diff on every pin bump" hazarddocs/ANDROID.md— most of it disappears; Android stops needing a source build (see #411 for its current state)README.md(the supported-versions note),packages/host/README.md,AGENTS.md§ Critical Build Dependenciespackages/host/package.json— thereact-nativepeer dependency can widen from a single nightly to a real range
Related
- #177 — prebuilt Node-API Hermes, the interim mitigation if this takes a while
- #392 —
react-native-macosblocked on the same story - #188 — the consumer-side Gradle settings helper, which becomes moot along with the source-build requirement
- 主要语言
- TypeScript
- 星标
- 188
- 派生
- 10
- 平均合并
- 2 天 17 小时
- 30 天内合并 PR
- 3
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstackincubator/react-native-node-api 的其他 Issue
-
Android 🤖
难度 2/5 1-3 小时 新手友好度 66/100
-
Sanity check of Hermes source directory via environment variable, when building Android projects 未关闭Android 🤖 good first issue
难度 2/5 1-3 小时 新手友好度 78/100
callstackincubator/react-native-node-api#163 · 1 条评论 ·
-
enhancement good first issue gyp-to-cmake
难度 2/5 1-3 小时 新手友好度 72/100
callstackincubator/react-native-node-api#161 · 3 条评论 · 1 个 reaction ·
-
enhancement Host 🏡
难度 5/5 一周以上 新手友好度 25/100
-
Automatable good first issue
难度 3/5 1-2 天 新手友好度 15/100
callstackincubator/react-native-node-api#424 · 1 条评论 ·
查看 callstackincubator/react-native-node-api 的全部 Issue
相似的 Issue
-
S: triage
难度 1/5 1 小时以内 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 76/100
-
fix(errors): EHOSTUNREACH from a happy-eyeballs connect is reported as a resolver error (STAMP-80) 未关闭
难度 2/5 1-3 小时 新手友好度 90/100
snapshot-labs/stamp#666 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
GauravKarakoti/SecureFlow#1070 · 1 条评论 ·
-
comp/desktop P3 type/bug
难度 1/5 1 小时以内 新手友好度 92/100
NousResearch/hermes-agent#118866 ·