Repository navigation
v0 [1/7]: context propagation — runtime patch, startup probe, Metro helper - #21
Merged
Merged
Conversation
This was referenced Nov 25, 2026
… the Metro helper Carries the active OTel context across promises and timers (§6.1): a global patch of `Promise.prototype.then`, setTimeout, setImmediate, queueMicrotask and requestAnimationFrame, installed once by `setup.ts`, with `setInterval` ticks at ROOT (§6.2). A startup probe checks that context survives `await` and otherwise flags the SDK's tracers as degraded. `withOtel` from `/metro` runs setup before any app module. Unit tests for each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adhorodyski
force-pushed
the
stack/1-js-sdk
branch
from
November 25, 2026 16:25
827c3d7 to
7a870ac
Compare
This was referenced Nov 25, 2026
adhorodyski
marked this pull request as ready for review
November 25, 2026 16:43
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.
What
Promise.prototype.then,setTimeout,setImmediate,queueMicrotaskandrequestAnimationFrameglobally;setIntervalticks run at ROOT (§6.2).setup.tsinstalls it once, as a singleton on aglobalThismarker, so fast refresh or a second copy of the SDK never stacks wrappers.await. If it doesn't, it logs one error and setscom.callstack.context.degraded=trueon the SDK tracers' instrumentation scope.withOtel(/metro): runs setup before any app module. It throws on an unmerged config and keeps the package out of inline requires.fast-jsnow runs theunitJest project. Also drops the dangling./viteexport from v0'spackage.json.Verified locally
bun verify static fast-js: 36 + 22 tests green (12 scenario todos until #27). SDK bundle share at the 383 873 B baseline.Worth deciding here
perf-budget(v0 [3/7]: JS scenarios, hand-off fixtures and JS goldens #27, run on devices in v0 [6/7]: example apps (bare, Expo) and device and web e2e #24) gates the overhead at under 3×.RNContextManagerwritesStackContextManager's protected_currentContext, andscope.tsmutatestracer.instrumentationScope(sdk-trace 3.1 has no API for scope attributes). Both can break on an sdk-trace upgrade;scope.tsthen silently skips the degraded flag.Not in this PR
startReactNativeSdk(#26), scenarios and goldens (#27), native cores (#22, #23).Part of the v0 stack that replaces #20 for review, bottom-up: #21 context → #26 SDK → #27 JS scenarios → #22 Android → #23 iOS → #24 examples + e2e → #25 ops. Review fixes land as new commits on the layer they belong to, and the layers above are rebased. History before the split:
v0-impl/ #20. Nothing publishes: release runs only after CI onmain, and the npm environment does not exist yet.🤖 Generated with Claude Code