@dynatrace/react-native-plugin 2.339.1 → 2.341.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +116 -18
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.kt +0 -1
  4. package/files/plugin.gradle +1 -1
  5. package/instrumentation/BabelPluginDynatrace.js +1 -1
  6. package/instrumentation/DynatraceInstrumentation.js +1 -1
  7. package/instrumentation/jsx/CreateElement.js +5 -9
  8. package/instrumentation/jsx/ElementHelper.js +5 -6
  9. package/instrumentation/jsx/JsxDevRuntime.js +33 -31
  10. package/instrumentation/jsx/JsxRuntime.js +30 -30
  11. package/instrumentation/jsx/JsxRuntimeHelpers.js +14 -0
  12. package/instrumentation/jsx/components/ClassComponent.js +4 -8
  13. package/instrumentation/jsx/components/ComponentUtil.js +24 -25
  14. package/instrumentation/libs/UserInteraction.js +27 -24
  15. package/instrumentation/libs/react-native/RefreshControl.js +5 -9
  16. package/instrumentation/libs/withOnPressMonitoring.js +66 -57
  17. package/lib/core/DynatraceAction.js +1 -3
  18. package/lib/core/DynatraceInternal.js +38 -40
  19. package/lib/core/ErrorHandler.js +41 -21
  20. package/lib/core/NullAction.js +1 -3
  21. package/lib/core/util/JsonUtils.js +6 -0
  22. package/lib/features/ui-interaction/TouchMetaResolver.js +4 -3
  23. package/lib/next/events/HttpRequestEventData.js +2 -2
  24. package/lib/next/events/interface/HttpRequestEventDataTypes.js +2 -0
  25. package/lib/next/events/modifier/ModifyEventValidation.js +79 -51
  26. package/package.json +6 -5
  27. package/react-native-dynatrace.podspec +1 -1
  28. package/scripts/Config.js +6 -2
  29. package/scripts/DebugFlag.js +20 -0
  30. package/scripts/FileOperationHelper.js +15 -39
  31. package/scripts/Logger.js +2 -3
  32. package/scripts/core/InstrumentCall.js +101 -80
  33. package/scripts/util/CustomArgumentUtil.js +8 -6
  34. package/types.d.ts +159 -8
package/types.d.ts CHANGED
@@ -684,17 +684,17 @@ interface IEventModifier {
684
684
  modifyEvent(event: JSONObject): JSONObject | null;
685
685
  }
686
686
 
687
- /**
688
- * Represents the allowed types for event property values.
689
- */
690
- type EventProperty = string | number | boolean;
691
-
692
687
  type TraceparentHeader = `${string}-${string}-${string}-${string}`;
693
688
  interface TraceContext {
694
689
  traceparent: TraceparentHeader;
695
690
  tracestate: string;
696
691
  }
697
692
 
693
+ /**
694
+ * Represents the allowed types for event property values.
695
+ */
696
+ type EventProperty = string | number | boolean;
697
+
698
698
  /**
699
699
  * Base interface for all events.
700
700
  */
@@ -1845,8 +1845,8 @@ declare class ManualStartupConfiguration implements IConfiguration {
1845
1845
  * Builder for manual startup configuration used with `Dynatrace.start()`.
1846
1846
  */
1847
1847
  declare class ConfigurationBuilder {
1848
- private beaconUrl;
1849
- private applicationId;
1848
+ private readonly beaconUrl;
1849
+ private readonly applicationId;
1850
1850
  private reportCrash;
1851
1851
  private errorHandler;
1852
1852
  private reportFatalErrorAsCrash;
@@ -2346,6 +2346,157 @@ declare class DynatraceWebRequestTiming implements IDynatraceWebRequestTiming {
2346
2346
  getRequestTagHeader(): string;
2347
2347
  }
2348
2348
 
2349
+ /**
2350
+ * Configuration for React Native transformer
2351
+ */
2352
+ interface TransformerReactConfiguration {
2353
+ /**
2354
+ * Path to an upstream transformer to use before Dynatrace transformation
2355
+ */
2356
+ upstreamTransformer?: string;
2357
+ }
2358
+ /**
2359
+ * Configuration for React Native instrumentation
2360
+ */
2361
+ interface InstrumentationReactConfiguration {
2362
+ /**
2363
+ * Whether to automatically start the Dynatrace agent (and insert instrumentation for startup)
2364
+ */
2365
+ autoStart: boolean;
2366
+ /**
2367
+ * Enable debug mode for additional console output during instrumentation and runtime
2368
+ */
2369
+ debug: boolean;
2370
+ /**
2371
+ * Unique name for the bundle. Required for multiple bundle setups and sourcemap deobfuscation.
2372
+ */
2373
+ bundleName?: string;
2374
+ /**
2375
+ * Version of the bundle
2376
+ */
2377
+ bundleVersion?: string;
2378
+ /**
2379
+ * Error handler configuration
2380
+ */
2381
+ errorHandler: {
2382
+ /**
2383
+ * Enable the Dynatrace error/crash handler
2384
+ */
2385
+ enabled: boolean;
2386
+ /**
2387
+ * Report fatal/unhandled errors as crashes instead of errors
2388
+ *
2389
+ * @remarks
2390
+ * When false, fatal errors are reported as errors and the current session remains open
2391
+ */
2392
+ reportFatalErrorAsCrash: boolean;
2393
+ };
2394
+ /**
2395
+ * Lifecycle event monitoring configuration
2396
+ */
2397
+ lifecycle: {
2398
+ /**
2399
+ * Include React component update lifecycle events
2400
+ */
2401
+ includeUpdate: boolean;
2402
+ /**
2403
+ * Determine which files should have lifecycle instrumentation
2404
+ *
2405
+ * @param filename - Path to the file being instrumented
2406
+ * @returns true to instrument the file, false to skip
2407
+ *
2408
+ * @defaultValue Returns false for all files
2409
+ */
2410
+ instrument: (filename: string) => boolean;
2411
+ };
2412
+ /**
2413
+ * User input monitoring configuration
2414
+ */
2415
+ input: {
2416
+ /**
2417
+ * Determine which files should have input instrumentation
2418
+ *
2419
+ * @param filename - Path to the file being instrumented
2420
+ * @returns true to instrument the file, false to skip
2421
+ *
2422
+ * @defaultValue Returns true for all files
2423
+ */
2424
+ instrument: (filename: string) => boolean;
2425
+ /**
2426
+ * Enable action name privacy to exclude automatic text/label detection
2427
+ *
2428
+ * @defaultValue false
2429
+ *
2430
+ * @remarks
2431
+ * When true, action names will not include accessibility labels, button titles,
2432
+ * or inner text. Use dtActionName property to set custom names.
2433
+ */
2434
+ actionNamePrivacy?: boolean;
2435
+ actionNamePreference?: ActionNamePreference;
2436
+ actionNameAlgorithm?: ActionNameAlgorithm;
2437
+ };
2438
+ /**
2439
+ * Navigation monitoring configuration
2440
+ */
2441
+ navigation: {
2442
+ /**
2443
+ * Enable automatic navigation tracking
2444
+ */
2445
+ enabled: boolean;
2446
+ };
2447
+ userInteraction: boolean;
2448
+ sourcemap: {
2449
+ enabled: boolean;
2450
+ androidSourcemapLocation: string;
2451
+ };
2452
+ debugBabelPlugin?: boolean;
2453
+ useLegacyJscodeshift?: boolean;
2454
+ }
2455
+ /**
2456
+ * Combined React configuration including transformer and instrumentation settings
2457
+ */
2458
+ type ReactConfiguration = TransformerReactConfiguration & InstrumentationReactConfiguration;
2459
+ /**
2460
+ * Main Dynatrace configuration structure
2461
+ */
2462
+ interface DynatraceConfiguration {
2463
+ /**
2464
+ * React Native specific configuration
2465
+ */
2466
+ react: ReactConfiguration;
2467
+ /**
2468
+ * Android native agent configuration
2469
+ */
2470
+ android?: NativeConfiguration;
2471
+ /**
2472
+ * iOS native agent configuration
2473
+ */
2474
+ ios?: NativeConfiguration;
2475
+ }
2476
+ /**
2477
+ * The type of dynatrace.config.js
2478
+ * All properties are optional since the user can only specify a subset
2479
+ * Will be merged with defaultConfig to ensure all required values are present
2480
+ * When T is a primitive or a function, then DeepPartial<T> resolves to T for better readability
2481
+ */
2482
+ type DeepPartial<T> = T extends Function ? T : T extends object ? {
2483
+ [K in keyof T]?: DeepPartial<T[K]>;
2484
+ } : T;
2485
+ type DynatraceUserConfiguration = DeepPartial<DynatraceConfiguration>;
2486
+ /**
2487
+ * Native platform (Android/iOS) configuration
2488
+ */
2489
+ interface NativeConfiguration {
2490
+ /**
2491
+ * Platform-specific configuration string
2492
+ *
2493
+ * @remarks
2494
+ * For Android: Contains Gradle DSL configuration block
2495
+ * For iOS: Contains plist key-value pairs
2496
+ */
2497
+ config?: string;
2498
+ }
2499
+
2349
2500
  declare module 'react' {
2350
2501
  namespace JSX {
2351
2502
  interface IntrinsicAttributes extends IDynatraceProperties {
@@ -2354,4 +2505,4 @@ declare module 'react' {
2354
2505
  }
2355
2506
 
2356
2507
  export { ConfigurationBuilder, DataCollectionLevel, Dynatrace, DynatraceWebRequestTiming, EventData, ExceptionEventData, HttpRequestEventData, LogLevel, ManualStartupConfiguration, Platform, SessionPropertyEventData, UserPrivacyOptions };
2357
- export type { IConfiguration, IDynatraceAction, IDynatraceRootAction, IDynatraceWebRequestTiming, IEventModifier, JSONObject };
2508
+ export type { DynatraceUserConfiguration, IConfiguration, IDynatraceAction, IDynatraceRootAction, IDynatraceWebRequestTiming, IEventModifier, JSONObject };