GitShow/facebook/hyperion
facebook

hyperion

This project enabled intercepting and virtualizing the browser API

by facebook
Star on GitHubForknpm

TypeScript

45 stars34 forks22 contributorsActive · 4w agoSince 2021MIT

Meet the team

See all 22 on GitHub →
reshadi
reshadi519 contributions
schwartzmx
schwartzmx73 contributions
vsylee
vsylee18 contributions
MarcosBustamante
MarcosBustamante10 contributions
atootoonchianmeta
atootoonchianmeta9 contributions
spevilAtMeta
spevilAtMeta8 contributions
Codeysseus
Codeysseus3 contributions
sudojorian
sudojorian2 contributions

Languages

View on GitHub →
TypeScript95.4%
JavaScript3.4%
MDX0.5%
CSS0.4%
HTML0.2%
Ruby0.1%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
75
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · Last activity 4w ago
See all on GitHub →
schwartzmx
[init] RN AutoLoggingOpenPR

init: React Native AutoLogging Commit stack afd586d — Add safe channels and React Native JSX runtime entries Adds failure-isolated hook callback invocation and typed fan-out while retaining strict behavior. Uses safe emission because AutoLogging publishes before invoking application handlers: one throwing subscriber must not block later subscribers, downstream channels, or the application handler. Makes safe piping continue after listener failures and makes honor its paused state for both emission modes. Adds a reusable React element-observation gate and optimized delegation to the original runtime. Adds public React Native and package entries with , , , and compatibility. Exports the existing GUID helper through the supported entry. Adds while keeping legacy implementations source-compatible. 102fcdc — Implement committed React Native AutoLogging surfaces Defines the initial React Native AutoLogging channel, configuration, event-envelope, metadata, session, screen, and heartbeat contracts. Implements with stable handler wrappers, latest committed snapshots, safe event delivery, and preservation of application return values and exceptions. Adds React Context-backed and hierarchy, registry, inheritance, non-interactive ancestry, bounded serialization, and lifecycle publication. Extracts portable heartbeat vocabulary, common metadata bounds, and surface-hierarchy mechanics without coupling React Native to DOM APIs. Retires the original prop-mutation and render-as-mount behavior in favor of committed React lifecycle instrumentation. Introduces provider, privacy, and sampling scaffolding that is removed in when policy ownership moves to subscribers. 5f8a3bb — Add mobile heartbeat session and raw publishers Centralizes React Native runtime setup behind without requiring a React provider. Removes library-owned sampling and privacy filtering so subscribers own filtering, redaction, sampling, persistence, and transport policy. Publishes accepted UI labels and scalar values with source provenance and potentially-sensitive annotations. Implements dependency-injected AppState heartbeat transitions, inactivity suppression, foreground/background scheduling, cleanup, and activity refresh from UI handlers. Adds contiguous event indexes and in-memory application, session, and screen state with six-character base-36 identifiers. Initially adds custom app events; that API and event family are subsequently removed by . afab347 — Add list deep link and React error publishers Adds with application callback composition, stable options, screen and surface context, and bounded impression deduplication. Adds raw deep-link publication with explicit source validation and target URI preservation. Adds React error-boundary publication for real and component-stack input without owning the application error boundary. Routes these publishers through private request messages so public subscribers receive one indexed and timestamped event per accepted request. 7d0ee97 — Add React Native fixtures benchmarks and artifacts Extracts portable AutoLogging types, heartbeat vocabulary, and surface hierarchy behavior into for web and mobile reuse. Uses a name-keyed child map for consistent web and mobile duplicate-surface behavior, including safe stale-child cleanup. Rebuilds the React Native test app around public package entries with UI, surface, heartbeat, screen, list, deep-link, error, StrictMode, and Suspense fixtures. Adds an application-owned event inspector with full payload and transport-envelope views, plus an tree inspector. Adds Babel support for stable event props, runtime microbenchmarks, heap checks, and Metro/Hermes bundle-size measurements with a runnable baseline. Separates web and mobile distribution commands: remains web-only, while emits the xplat handoff artifacts. Adds exact web artifact-manifest validation and dedicated mobile artifact generation without source maps, Flow output, Haste loaders, fbsource dependencies, or DOM-only code in mobile Core. 250af9f — Make React Native JSX observation clone-safe Represents application props directly on the observed outer element so replacements reach the original component. Keeps Hyperion runtime descriptors in instrumented type closures so internal state cannot collide with or leak into application or native-view props. Preserves replacement children, arbitrary props, refs, keys, receivers, and runtime arguments across , , , and . Retains stable handler wrappers, latest callbacks, committed surface snapshots, return values, and thrown exceptions across rerenders. Removes handler-keyed retry state so sibling controls sharing one callback retain independent labels, surfaces, and runtime snapshots. Adds regressions for cloned ScrollView-style elements, injected cells, ref and prop replacement, shared handlers, StrictMode, and Suspense retries. 10fba0c — Restore shared interception compatibility Restores the established web function-component interceptor return path so existing render and flowlet observers continue to execute. Adds a web regression using the real . Makes safe channel piping compatible with legacy downstream implementations that provide but not . Preserves strict emission and existing web event schemas and extraction behavior. 0736dbf — Add independent mobile AutoLogging feature gates Adds typed gates for automatic UI, surface mutation, screen transition, list impression, deep-link, and React-error events. Defaults omitted modern features to enabled while allowing each publisher family to be disabled independently of the runtime master switch. Prevents partially disabled legacy configuration from accidentally enabling modern observation. Keeps required internal state and application callbacks working when corresponding event publication is disabled. Avoids installing the JSX element instrumenter when automatic UI events are disabled. The custom-event gate introduced at this point is later removed with the custom-event API in . ebb64bc — Publish mobile input labels with provenance Publishes explicitly supplied text-input placeholders instead of suppressing them in the core runtime. Marks placeholder labels as potentially sensitive sourced from . Publishes accepted callback input values as potentially sensitive with provenance. Leaves filtering, redaction, persistence, and transport decisions to subscribers. Does not serialize raw handler argument arrays or native event objects. 67f5cfc — Restore legacy React Native AutoLogging compatibility Retains the injected React and JSX intercepted-module initialization fields used by WWW/AMA. Preserves independent legacy interception and publishing controls. Restores the and compatibility channels. Keeps heartbeat and modern event families disabled by default for legacy initialization. Adds strict type and runtime coverage for the existing initialization fixture. Adds TODOs to remove the compatibility aliases and installer after WWW/AMA migration. d3d2679 — Generate WWW-compatible React Native artifacts Emits native-specific filenames for entries that directly import React Native or React JSX runtimes. Keeps JSX observation and the legacy installer dependency-neutral under generic filenames. Rewrites generated cross-artifact references to bare Haste module names. Validates required entries, dependency boundaries, filenames, and import resolution during . Does not change normal web distribution generation. 6102055 — Inject React Native lifecycle dependencies Removes the eager import from the portable mobile runtime. Adds narrow structural types for injected capabilities. Accesses the injected AppState only when heartbeat is enabled. Preserves disabled, heartbeat-disabled, legacy, cleanup, and idempotent behavior. Emits a dependency-neutral main artifact and byte-identical alias. Adds lifecycle injection, transition, cleanup, missing-adapter, and artifact dependency tests. 20fac55 — Use an application-owned mobile AutoLogging channel Requires callers to create, subscribe to, and pass one typed channel through . Uses that exact channel internally without constructing or piping another public channel. Removes , , , and queued subscriber management. Removes , , , the custom-event feature, and the mobile custom-event publisher. Keeps private runtime request messages internal while exporting only the public event contracts. Updates the test app, documentation, declarations, tests, and benchmarks without changing web behavior. be15786 — Install React Native JSX runtimes during AutoLogging init Supports the simplified modern configuration with , , , and . Installs supplied raw runtimes before enabling automatic UI observation so setup is atomic. Runs runtime inspection and installation only when the runtime and are enabled. Retains and as deprecated intercepted-module compatibility adapters. Handles immutable ESM runtime namespaces safely: writable Metro or embedded facades are updated, while immutable namespaces remain unchanged and can use the package JSX entries. Rolls back partially installed runtime slots when a supplied module cannot be updated. Preserves explicit installer compatibility, idempotency, disabled paths, and late-initialization semantics. 030bf97 — Enforce React Native distribution checks in CI Builds both web and mobile distributions through the normal reproducible artifact paths. Runs the complete workspace test suite without conflicting Jest worker options. Enforces React Native runtime timing and mounted-heap budgets. Builds the production Metro baseline and fixture bundles and enforces the incremental size ceiling. Leaves Hermes and simulator validation as local platform checks. Current initialization Initialization must run before relevant JSX is rendered. Runtime inspection and JSX installation are skipped when the master runtime or automatic UI events are disabled. is accessed only when heartbeat is enabled. Intentional differences from web React Native observes supported JSX runtimes and ; web retains its established interceptor. React Native heartbeat uses injected AppState; web uses document visibility and window focus. React Native surfaces use React Context and committed registries without DOM elements. Both platforms share name-keyed surface hierarchy and inheritance mechanics, including duplicate-name replacement behavior. React Native extracts accessibility props, , placeholders, handler values, and explicit list viewability rather than DOM targets and bubbling. React Native session and screen state are in memory rather than browser storage. React Native emits accepted raw scalar data with provenance; subscribers own filtering, sampling, redaction, transport, and persistence. Mobile artifacts use ; normal remains web-only. The standalone web React-element-observation artifact is excluded from ; the established web implementation and behavior remain intact. Validation passed, including exact web artifact-manifest and mobile dependency checks. passed across all workspaces. React Native tests: 10 suites passed, 78 tests passed, and 2 benchmark tests were intentionally skipped by the ordinary test run and executed separately. Runtime and mounted-heap benchmarks passed all existing budgets: Metro incremental bundle: 41,906 bytes / 50,000-byte ceiling. Hermes incremental bundle: 61,245 bytes / 85,000-byte ceiling. Targeted ESLint and Prettier checks for the changed implementation passed. Whole-repository lint retains unrelated pre-existing findings. Mobile artifacts contain no source maps or comments. The portable artifact has no eager or JSX-runtime import. and are byte-identical. Supported modern mobile public events Every modern public payload extends: The runtime extracts accepted scalar values and does not serialize raw handler argument arrays or complete native event objects. Unmount events use to reference their corresponding mount event. Internal messages remain private. The application may wrap a public event for transport without changing the event shape: Legacy compatibility events Legacy initialization retains these channels while migration is in progress: carries . carries . These compatibility payloads intentionally retain their historical shapes and do not extend . Test app changes Interactive Buttons for testing UI events + Mutations Surface Tree Event Explorer

schwartzmx · 4d ago
Daniel15
Remove eslint-disable for fb-www/no-symbol OpenPR

I'm deleting this lint rule from WWW since it's long outdated (was only needed for IE compatibility), so we can remove this eslint-disable now too. Diff that deletes the rule: D115636736

Daniel15 · 1w ago
Avicennasis
docs: fix typos in commentsOpenPR

Summary Fix 5 spelling errors across 4 source files in code comments: → and → in FlowletManager.ts → in IReactComponent.ts → in PropertyInterceptor.ts → in ALTriggerFlowlet.ts Test plan No functional changes — comment-only edits Verified each typo exists in the current branch before fixing

Avicennasis · 2mo ago

Recent fixes

View closed PRs →
MarcosBustamante
Testing Hyperion JS interceptors in a React Native environmentMergedPR

This PR is adding the JS interceptors in a playground react native in order to test its compatibility to RN. It was tested running the tests wrote to the original file, which were also copied in the playground. Only 2 tests didn't pass and need further investigation on what is generating the unexpected behavior. The tests that are not passing are:

MarcosBustamante · 1w ago
schwartzmx
Add an upper limit text size for element text cachingMergedPR

Adds an upper limit to reduce chance of storing large strings in the cache which can increase memory of the cache map

schwartzmx · 1w ago
schwartzmx
Remove flags, always use null-safe getExports and prefer Meta runtimeMergedPR

Remove safeWebpackModuleExports and preferMetaModuleRuntime flags in favor of unconditionally applying both fixes: getExports always uses null-safe access (wexports[0]?.exports ?? null) IIFE checks Meta __debug runtime before __webpack_module_cache__ since Meta's module system is authoritative in Meta's environment Reverts to the simpler IIFE pattern per reviewer feedback.

schwartzmx · 3mo ago
Structured data for AI agents

Repository: facebook/hyperion. Description: This project enabled intercepting and virtualizing the browser API Stars: 45, Forks: 34. Primary language: TypeScript. Languages: TypeScript (95.4%), JavaScript (3.4%), MDX (0.5%), CSS (0.4%), HTML (0.2%). License: MIT. Open PRs: 13, open issues: 4. Last activity: 4w ago. Community health: 75%. Top contributors: reshadi, schwartzmx, vsylee, MarcosBustamante, atootoonchianmeta, spevilAtMeta, Codeysseus, sudojorian, dependabot[bot], xiaotagn and others.

·@ofershap

Replace github.com with gitshow.dev