Repository navigation
Conversation
Summary:
Add the design spec and the task-by-task implementation plan for
extending the Worker constructor to accept a URL, loaded via an
integrator-provided IWorkerSetup (jsi::ICast-based for
ABI-stable extension) that resolves a URL to a jsi::Buffer of script
bytes (bytecode or source), enabling zero-copy / memory-mapped native
loading, plus hooks to configure the worker RuntimeConfig and run
one-time JS setup in the worker runtime. Also covers string-vs-URL
classification with {inline} and opt-in {allowData} data: URL
decoding, URL-object ToString coercion, and the relationship to the
standard Blob/createObjectURL web idiom (host-level, composed on top of
the resolver). Documentation only.
Differential Revision: D114087763
Summary: Add IWorkerSetup and ISetWorkerSetup to hermes-interfaces.h (an ICast-based setter with a getWorkerSetup accessor), and wire HermesRuntimeImpl to store the integrator's opaque provider pointer and expose it via that getter. Give the APITest provider harness a virtual destructor and mark a not-yet-used helper [[maybe_unused]] so the build is warning-free. Differential Revision: D114374137
Summary:
Classify a Worker string argument as a URL when a provider is
registered (unless {inline:true}); resolve it to a jsi::Buffer on the
worker thread, run the init hook, then evaluate. Propagate the provider
to nested worker runtimes. Drop a misleading zero-copy assertion from
the bytecode test.
Differential Revision: D114374130
Summary: Seed a default RuntimeConfig and let the provider adjust it in place before creating the worker runtime. Differential Revision: D114374132
Summary: Match the web USVString coercion: a non-buffer object argument (e.g. an RN URL) is stringified via ToString and classified as a string. Non-string, non-object primitives still throw TypeError. Differential Revision: D114374133
Summary:
With {allowData:true}, natively decode a data: URL (percent or base64)
into worker script bytes on the constructor thread, taking precedence
over the resolver and source. Malformed data: URLs throw TypeError.
Unify string classification via a sourceFromString helper.
Differential Revision: D114374134
Summary:
new Worker({}) now coerces to string source instead of throwing, per
the object ToString coercion change. Drop the stale object-throws
assertion from worker-from-buffer.js.
Differential Revision: D114374136
Summary: Catch non-JSI C++ exceptions from resolveScript/initWorkerRuntime so a throwing integrator resolver terminates the worker instead of aborting the process. Make WorkerFromUrlBytecode assert the resolver buffer is retained then released. Document that a blocking resolver blocks worker teardown (both hermes-interfaces.h copies). Differential Revision: D114374131
Summary: hermes::base64Decode now strips ASCII whitespace (WHATWG forgiving base64) and returns empty output for empty input instead of indexing out of bounds. This makes data: URL decoding (worker scripts and source maps via parseJSONBase64DataURL) spec-compliant and fixes a crash on an empty base64 payload such as data:application/json;base64,. Differential Revision: D114374135
|
@tmikov has exported this pull request. If you are a Meta employee, you can view the originating Diff in D114548566. |
Summary: Pull Request resolved: facebook#2135 Add a Code Style convention recommending condition-scoped variable declarations with an early return (if (auto *x = expr()) ...) over intermediate nullable locals and ternary chains, matching the LLVM/Hermes idiom already used in the codebase. Reviewed By: avp Differential Revision: D114548566
tmikov
force-pushed
the
export-D114548566
branch
from
August 15, 2026 19:06
9416aee to
7a830c6
Compare
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add a Code Style convention recommending condition-scoped variable
declarations with an early return (if (auto *x = expr()) ...) over
intermediate nullable locals and ternary chains, matching the
LLVM/Hermes idiom already used in the codebase.
Reviewed By: avp
Differential Revision: D114548566