Auto-detect TurboModules on the New Architecture
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, react-native, typescript
- Área
- mobile, observability-sre
Línea de trabajo
Read the existing SentryTurboModulePerfSink.h sink interface and prior work in #6162, then review the RN 0.87 TurboModule resolution constraints described here. The proposed direction is native TurboModulePerfLog; coordinate with the team to settle scope and integration details. Done means automatic TurboModule instrumentation works on the New Architecture without requiring users to register each module; crash attribution is a separate follow-up.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
turboModuleContextIntegration is on by default (enableNative), but on the New Architecture it only wraps RNSentry, which is in ignoreTurboModules by default. The default setup therefore records no statistics, span attributes, or slow-call breadcrumbs, and crash context only covers crashes during the SDK's own calls. To get data, users have to list every module in modules: [...].
Current behavior
- Verified in the RN sample (iOS, New Architecture, RN 0.87.1): the TurboModule Playground span has all
turbo_module.*attributes when the sample's modules are passed inmodules, and none with the defaultturboModuleContextIntegration(). - Automatic instrumentation exists only on the Old Architecture (
enableLegacyNativeModules: true), which is gone as of RN 0.82. The automatic path is on the architecture apps are leaving; the manual path is on the one they're moving to.
Why manual registration falls short
- Third-party libraries resolve their modules internally, so users usually don't have the module objects to pass in.
- Libraries that copy methods out at import time (
const { foo } = NativeX) keep the unwrapped functions. - The JS wrapper writes the
turbo_modulecontext and two tags to the scope at the start and end of every call. With scope sync on, each write is a native call (scopeSync.ts), so each instrumented call costs about 6 extra native calls.
RN 0.87 module resolution constraints
- Bridgeless mode (the default) has no
global.__turboModuleProxy;TurboModuleRegistry.get()falls back toNativeModules[name], which reads from the read-onlyglobal.nativeModuleProxy. getModule()caches one JS object per module name, so in-place wrapping reaches other users of the same module, but the cache is a weak reference, so a wrapper must hold strong references.- JS can't enumerate registered modules, and calling
geton every name would eagerly load all modules (some with side effects). - Libraries usually look up their module at import time, before
Sentry.init.
Proposed direction (from team discussion)
- Options considered: patching
TurboModuleRegistry.get/getEnforcingat init (misses lookups before init, not recommended), a Metro resolver redirect viawithSentryConfig(skipped: depends on RN internal paths, keeps JS per-call overhead, misses JSI host objects), and nativeTurboModulePerfLog. - Aleksandr Pantiukhov favors the native
TurboModulePerfLogroute, since it builds on the existingSentryTurboModulePerfSink.hsink interface and needs no new install path. Prior work: #6162. - Native crash attribution can be tracked separately with the Cocoa and Java SDK teams; the rest of the work doesn't depend on it.
Raised by Antonis Lilis while reviewing the docs (getsentry/sentry-docs#19949) and changelog (getsentry/sentry-changelog#224) PRs. Related GitHub issue for the Linear bug: #6886; Linear RN-824.
via Antonis Lilis.
--
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.8k
- Forks
- 371
- Merge medio
- 22 h 3 min
- PR fusionados (30 d)
- 106
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de getsentry/sentry-react-native
-
React-Native
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
getsentry/sentry-react-native#7073 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Improvement React-Native
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
getsentry/sentry-react-native#7055 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
React-Native Replays Task
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
getsentry/sentry-react-native#6680 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Improvement React-Native
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
getsentry/sentry-react-native#6143 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
React-Native Task User Feedbacks
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
getsentry/sentry-react-native#5932 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de getsentry/sentry-react-native
Issues similares
-
area:config bug priority:medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Doezer/Questarr#1451 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
sidebandstudio/clawtrate#1156 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
WenyuChiou/agent-board#1993 ·
Los mantenedores suelen responder en 1 día
-
bug design
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Colorado-Startups/coloradostartups.org#151 ·
Los mantenedores suelen responder en 1 día
-
question
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jarrodwatts/claude-hud#883 · 1 comentario ·
Los mantenedores suelen responder en 1 día