Repository navigation
Let development tooling observe each JavaScript buffer ReactInstance evaluates (#60561) - #60561
Open
RobertHerhold wants to merge 1 commit into
Open
RobertHerhold wants to merge 1 commit into
RobertHerhold wants to merge 1 commit into
Conversation
|
@RobertHerhold has exported this pull request. If you are a Meta employee, you can view the originating Diff in D136024543. |
RobertHerhold
added a commit
to RobertHerhold/react-native
that referenced
this pull request
Dec 4, 2026
…evaluates (react#60561) Summary: Development tooling sometimes needs to know exactly which JavaScript a process ran, for example to tie a recording to the source it came from. `ReactInstance` evaluates JavaScript in four places: the main bundle (`loadScript`), segments registered from files (`registerSegment`), source evaluated through `globalEvalWithSourceUrl` (lazy segments fetched from a dev server and Fast Refresh updates), and Static Hermes units compiled into the binary. This adds `setJSEvaluationObserver`, a process-wide hook in `react/runtime/JSEvaluationObserver.h`. `ReactInstance` calls the installed observer on the JS thread immediately before each evaluation, with the exact bytes it is about to evaluate, the source URL and the kind of evaluation. With no observer installed, each path only counts the evaluation; `setJSEvaluationObserver` returns that count, so an observer installed late can tell that it missed some. The header is in the for-frameworks tier, like `ReactMarker`. Changelog: [General][Added] - Add `setJSEvaluationObserver` to observe the JavaScript `ReactInstance` evaluates Differential Revision: D136024543
RobertHerhold
added a commit
to RobertHerhold/react-native
that referenced
this pull request
Dec 4, 2026
…evaluates (react#60561) Summary: Development tooling sometimes needs to know exactly which JavaScript a process ran, for example to tie a recording to the source it came from. `ReactInstance` evaluates JavaScript in four places: the main bundle (`loadScript`), segments registered from files (`registerSegment`), source evaluated through `globalEvalWithSourceUrl` (lazy segments fetched from a dev server and Fast Refresh updates), and Static Hermes units compiled into the binary. This adds `setJSEvaluationObserver`, a process-wide hook in `react/runtime/JSEvaluationObserver.h`. `ReactInstance` calls the installed observer on the JS thread immediately before each evaluation, with the exact bytes it is about to evaluate, the source URL and the kind of evaluation. With no observer installed, each path only counts the evaluation; `setJSEvaluationObserver` returns that count, so an observer installed late can tell that it missed some. The header is in the for-frameworks tier, like `ReactMarker`. Changelog: [General][Added] - Add `setJSEvaluationObserver` to observe the JavaScript `ReactInstance` evaluates Differential Revision: D136024543
RobertHerhold
force-pushed
the
export-D136024543
branch
from
December 4, 2026 18:29
a8b7bc7 to
20541bd
Compare
RobertHerhold
added a commit
to RobertHerhold/react-native
that referenced
this pull request
Dec 4, 2026
…evaluates (react#60561) Summary: Development tooling sometimes needs to know exactly which JavaScript a process ran, for example to tie a recording to the source it came from. `ReactInstance` evaluates JavaScript in four places: the main bundle (`loadScript`), segments registered from files (`registerSegment`), source evaluated through `globalEvalWithSourceUrl` (lazy segments fetched from a dev server and Fast Refresh updates), and Static Hermes units compiled into the binary. This adds `setJSEvaluationObserver`, a process-wide hook in `react/runtime/JSEvaluationObserver.h`. `ReactInstance` calls the installed observer on the JS thread immediately before each evaluation, with the exact bytes it is about to evaluate, the source URL and the kind of evaluation. With no observer installed, each path only counts the evaluation; `setJSEvaluationObserver` returns that count, so an observer installed late can tell that it missed some. The header is in the for-frameworks tier, like `ReactMarker`. Changelog: [General][Added] - Add `setJSEvaluationObserver` to observe the JavaScript `ReactInstance` evaluates Differential Revision: D136024543 Signed-off-by: Rob Herhold <rherhold@meta.com>
RobertHerhold
force-pushed
the
export-D136024543
branch
from
December 4, 2026 18:36
20541bd to
505443d
Compare
RobertHerhold
added a commit
to RobertHerhold/react-native
that referenced
this pull request
Dec 4, 2026
…evaluates (react#60561) Summary: Development tooling sometimes needs to know exactly which JavaScript a process ran, for example to tie a recording to the source it came from. `ReactInstance` evaluates JavaScript in four places: the main bundle (`loadScript`), segments registered from files (`registerSegment`), source evaluated through `globalEvalWithSourceUrl` (lazy segments fetched from a dev server and Fast Refresh updates), and Static Hermes units compiled into the binary. This adds `setJSEvaluationObserver`, a process-wide hook in `react/runtime/JSEvaluationObserver.h`. `ReactInstance` calls the installed observer on the JS thread immediately before each evaluation, with the exact bytes it is about to evaluate, the source URL and the kind of evaluation. With no observer installed, each path only counts the evaluation; `setJSEvaluationObserver` returns that count, so an observer installed late can tell that it missed some. The header is in the for-frameworks tier, like `ReactMarker`. Changelog: [General][Added] - Add `setJSEvaluationObserver` to observe the JavaScript `ReactInstance` evaluates Differential Revision: D136024543
…evaluates (react#60561) Summary: Development tooling sometimes needs to know exactly which JavaScript a process ran, for example to tie a recording to the source it came from. `ReactInstance` evaluates JavaScript in four places: the main bundle (`loadScript`), segments registered from files (`registerSegment`), source evaluated through `globalEvalWithSourceUrl` (lazy segments fetched from a dev server and Fast Refresh updates), and Static Hermes units compiled into the binary. This adds `setJSEvaluationObserver`, a process-wide hook in `react/runtime/JSEvaluationObserver.h`. `ReactInstance` calls the installed observer on the JS thread immediately before each evaluation, with the exact bytes it is about to evaluate, the source URL and the kind of evaluation. With no observer installed, each path only counts the evaluation; `setJSEvaluationObserver` returns that count, so an observer installed late can tell that it missed some. The header is in the for-frameworks tier, like `ReactMarker`. Changelog: [General][Added] - Add `setJSEvaluationObserver` to observe the JavaScript `ReactInstance` evaluates Differential Revision: D136024543
RobertHerhold
added a commit
to RobertHerhold/react-native
that referenced
this pull request
Dec 4, 2026
…evaluates (react#60561) Summary: Development tooling sometimes needs to know exactly which JavaScript a process ran, for example to tie a recording to the source it came from. `ReactInstance` evaluates JavaScript in four places: the main bundle (`loadScript`), segments registered from files (`registerSegment`), source evaluated through `globalEvalWithSourceUrl` (lazy segments fetched from a dev server and Fast Refresh updates), and Static Hermes units compiled into the binary. This adds `setJSEvaluationObserver`, a process-wide hook in `react/runtime/JSEvaluationObserver.h`. `ReactInstance` calls the installed observer on the JS thread immediately before each evaluation, with the exact bytes it is about to evaluate, the source URL and the kind of evaluation. With no observer installed, each path only counts the evaluation; `setJSEvaluationObserver` returns that count, so an observer installed late can tell that it missed some. The header is in the for-frameworks tier, like `ReactMarker`. Changelog: [General][Added] - Add `setJSEvaluationObserver` to observe the JavaScript `ReactInstance` evaluates Differential Revision: D136024543
RobertHerhold
force-pushed
the
export-D136024543
branch
from
December 4, 2026 21:58
505443d to
b4c1746
Compare
This branch has not been 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:
Development tooling sometimes needs to know exactly which JavaScript a process ran, for example to tie a recording to the source it came from.
ReactInstanceevaluates JavaScript in four places: the main bundle (loadScript), segments registered from files (registerSegment), source evaluated throughglobalEvalWithSourceUrl(lazy segments fetched from a dev server and Fast Refresh updates), and Static Hermes units compiled into the binary.This adds
setJSEvaluationObserver, a process-wide hook inreact/runtime/JSEvaluationObserver.h.ReactInstancecalls the installed observer on the JS thread immediately before each evaluation, with the exact bytes it is about to evaluate, the source URL and the kind of evaluation. With no observer installed, each path only counts the evaluation;setJSEvaluationObserverreturns that count, so an observer installed late can tell that it missed some.The header is in the for-frameworks tier, like
ReactMarker.Changelog:
[General][Added] - Add
setJSEvaluationObserverto observe the JavaScriptReactInstanceevaluatesDifferential Revision: D136024543