@logbrew/react-native 0.1.1 → 0.1.3

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.
@@ -0,0 +1,22 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |spec|
6
+ spec.name = "LogBrewReactNative"
7
+ spec.version = package["version"]
8
+ spec.summary = package["description"]
9
+ spec.homepage = "https://github.com/LogBrewCo/sdk"
10
+ spec.license = package["license"]
11
+ spec.authors = { "LogBrew" => "opensource@logbrew.com" }
12
+ spec.platforms = { :ios => "13.0" }
13
+ spec.source = {
14
+ :git => "https://github.com/LogBrewCo/sdk.git",
15
+ :tag => "react-native-v#{spec.version}"
16
+ }
17
+ spec.source_files = "ios/**/*.{h,m,mm}"
18
+ spec.exclude_files = "ios/Tests/**/*"
19
+ spec.dependency "React-Core"
20
+
21
+ install_modules_dependencies(spec) if respond_to?(:install_modules_dependencies, true)
22
+ end
package/README.md CHANGED
@@ -106,6 +106,30 @@ try {
106
106
 
107
107
  Set `includeStack: true` only when your app has decided stack text is safe to send. Non-`Error` thrown values are accepted and converted into issue messages so app error handlers do not need custom guards.
108
108
 
109
+ ### Reversible global JavaScript reports
110
+
111
+ Install the optional global JavaScript handler before root registration when you want supported nonfatal `ErrorUtils` failures captured without an app-owned capture call:
112
+
113
+ ```js
114
+ import { installLogBrewReactNativeGlobalErrorHandler } from "@logbrew/react-native/global-errors";
115
+
116
+ const errorHandler = installLogBrewReactNativeGlobalErrorHandler({
117
+ client,
118
+ onDiagnostic({ code }) {
119
+ console.warn(`LogBrew error handler: ${code}`);
120
+ }
121
+ });
122
+
123
+ // Roll back during teardown or when disabling the integration.
124
+ errorHandler.remove();
125
+ ```
126
+
127
+ Installation is idempotent for the active React Native `ErrorUtils` object. The wrapper captures a fixed-content, path-bounded issue for nonfatal global JavaScript errors and then calls the handler that was installed before it. Capture and diagnostic callback failures cannot prevent that prior handler from running. `remove()` reinstates the previous handler only while LogBrew still owns the global slot, so a later integration is not overwritten.
128
+
129
+ The React Native conditional export obtains LogBrew's synchronous native fatal store through the supported TurboModule or `NativeModules` seam. Before chaining a fatal report, it writes one bounded record to app-private storage that is excluded from operating-system archives. On a later installation it performs stable-ID at-least-once replay, and acknowledgement happens only after local queue admission is observable through the SDK queue counters. Filtered, dropped, unknown-admission, persistence-failed, and acknowledgement-failed records are retained. A failed acknowledgement is retried without admitting the same ID twice in one JavaScript runtime. Use `fatalHealth()` for frozen bounded counters and status, or `discardPendingFatalRecord()` for an explicit rollback discard. The Node ESM and CommonJS entries never import React Native; non-React-Native callers must inject `fatalStore` explicitly.
130
+
131
+ Automatic events exclude the original error message, raw stack, arbitrary metadata, full URLs, hosts, query strings, local absolute paths, payloads, and native error text. `onDiagnostic` receives only a fixed code. This integration does not claim mathematically exactly-once delivery, backend-visible deduplication, native crash capture, Promise rejection ownership, ANR or hang detection, general offline queueing, or symbolication. Unhandled Promise rejections are not installed or patched because React Native does not expose one stable supported ownership seam across its runtimes.
132
+
109
133
  When you prepare React Native release artifacts, wrap the app-owned Metro config once. Production bundles and source maps receive one matching Debug ID, while development and hot-reload serialization remain unchanged:
110
134
 
111
135
  ```js
@@ -0,0 +1,42 @@
1
+ def newArchitectureEnabled() {
2
+ return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
3
+ }
4
+
5
+ apply plugin: "com.android.library"
6
+
7
+ if (newArchitectureEnabled()) {
8
+ apply plugin: "com.facebook.react"
9
+ react {
10
+ jsRootDir = file("../src")
11
+ libraryName = "LogBrewReactNativeSpec"
12
+ codegenJavaPackageName = "co.logbrew.reactnative"
13
+ }
14
+ }
15
+
16
+ android {
17
+ namespace "co.logbrew.reactnative"
18
+ compileSdkVersion rootProject.ext.has("compileSdkVersion")
19
+ ? rootProject.ext.get("compileSdkVersion")
20
+ : 35
21
+
22
+ defaultConfig {
23
+ minSdkVersion rootProject.ext.has("minSdkVersion")
24
+ ? rootProject.ext.get("minSdkVersion")
25
+ : 24
26
+ targetSdkVersion rootProject.ext.has("targetSdkVersion")
27
+ ? rootProject.ext.get("targetSdkVersion")
28
+ : 35
29
+ }
30
+
31
+ sourceSets {
32
+ main {
33
+ java.srcDirs += newArchitectureEnabled()
34
+ ? ["src/newarch/java"]
35
+ : ["src/oldarch/java"]
36
+ }
37
+ }
38
+ }
39
+
40
+ dependencies {
41
+ implementation "com.facebook.react:react-android"
42
+ }
@@ -0,0 +1 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android" />