Skip to content

The only tool you need to know what is happening and how to fix it.

added react native to traceway fe and be

ddux7c838dd104f9
diff --git a/backend/app/controllers/auth.controller.go b/backend/app/controllers/auth.controller.go
index 54325c4d..9a9a0a00 100644
--- a/backend/app/controllers/auth.controller.go
+++ b/backend/app/controllers/auth.controller.go
@@ -154,7 +154,7 @@ func (a authController) Register(c *gin.Context) {
if !validFrameworks[request.Framework] {
traceway.CaptureMessage("Invalid framework received during registration: " + request.Framework)
- c.JSON(http.StatusBadRequest, gin.H{"error": "Framework must be one of: gin, fiber, chi, fasthttp, stdlib, custom, react, svelte, vuejs, jquery, hono, cloudflare, opentelemetry, symfony, flutter, android"})
+ c.JSON(http.StatusBadRequest, gin.H{"error": "Framework must be one of: gin, fiber, chi, fasthttp, stdlib, custom, react, svelte, vuejs, jquery, react-native, hono, cloudflare, opentelemetry, symfony, flutter, android"})
return
}
diff --git a/backend/app/controllers/clientcontrollers/client.controller.go b/backend/app/controllers/clientcontrollers/client.controller.go
index d7288fcd..be6b5fc6 100644
--- a/backend/app/controllers/clientcontrollers/client.controller.go
+++ b/backend/app/controllers/clientcontrollers/client.controller.go
@@ -337,13 +337,14 @@ func ComputeExceptionHash(stackTrace string, isMessage bool) string {
}
var jsFrameworks = map[string]bool{
- "react": true,
- "svelte": true,
- "vuejs": true,
- "nextjs": true,
- "nestjs": true,
- "express": true,
- "remix": true,
+ "react": true,
+ "svelte": true,
+ "vuejs": true,
+ "nextjs": true,
+ "nestjs": true,
+ "express": true,
+ "remix": true,
+ "react-native": true,
}
func isJsFramework(framework string) bool {
diff --git a/backend/app/controllers/oauth.controller.go b/backend/app/controllers/oauth.controller.go
index 58d472f1..4b466c87 100644
--- a/backend/app/controllers/oauth.controller.go
+++ b/backend/app/controllers/oauth.controller.go
@@ -163,7 +163,7 @@ func (a oauthController) FinishSetup(c *gin.Context) {
}
if !validFrameworks[request.Framework] {
- c.JSON(http.StatusBadRequest, gin.H{"error": "Framework must be one of: gin, fiber, chi, fasthttp, stdlib, custom, react, svelte, vuejs, jquery, hono, cloudflare, opentelemetry, symfony, flutter, android"})
+ c.JSON(http.StatusBadRequest, gin.H{"error": "Framework must be one of: gin, fiber, chi, fasthttp, stdlib, custom, react, svelte, vuejs, jquery, react-native, hono, cloudflare, opentelemetry, symfony, flutter, android"})
return
}
diff --git a/backend/app/controllers/project.controller.go b/backend/app/controllers/project.controller.go
index b2a357af..51962cd8 100644
--- a/backend/app/controllers/project.controller.go
+++ b/backend/app/controllers/project.controller.go
@@ -34,6 +34,7 @@ var validFrameworks = map[string]bool{
"express": true,
"remix": true,
"jquery": true,
+ "react-native": true,
"hono": true,
"cloudflare": true,
"opentelemetry": true,
@@ -89,7 +90,7 @@ func (p projectController) CreateProject(c *gin.Context) {
if !validFrameworks[request.Framework] {
traceway.CaptureMessage("Invalid framework received: " + request.Framework)
- c.JSON(http.StatusBadRequest, gin.H{"error": "Framework must be one of: gin, fiber, chi, fasthttp, stdlib, custom, react, svelte, vuejs, jquery, hono, cloudflare, opentelemetry, symfony, flutter, android"})
+ c.JSON(http.StatusBadRequest, gin.H{"error": "Framework must be one of: gin, fiber, chi, fasthttp, stdlib, custom, react, svelte, vuejs, jquery, react-native, hono, cloudflare, opentelemetry, symfony, flutter, android"})
return
}
diff --git a/frontend/src/lib/components/framework-combobox.svelte b/frontend/src/lib/components/framework-combobox.svelte
index bff0fbb5..dd58a117 100644
--- a/frontend/src/lib/components/framework-combobox.svelte
+++ b/frontend/src/lib/components/framework-combobox.svelte
@@ -28,6 +28,7 @@
{ value: 'stdlib', label: 'Standard Library', description: 'net/http package', group: 'Go' },
{ value: 'custom', label: 'Custom', description: 'Other / manual setup', group: 'Go' },
{ value: 'react', label: 'React', description: 'Frontend UI library', group: 'JavaScript' },
+ { value: 'react-native', label: 'React Native', description: 'React Native and Expo apps', group: 'JavaScript' },
{ value: 'svelte', label: 'Svelte', description: 'Frontend compiler framework', group: 'JavaScript' },
{ value: 'vuejs', label: 'Vue.js', description: 'Progressive frontend framework', group: 'JavaScript' },
{ value: 'jquery', label: 'jQuery', description: 'Legacy-friendly AJAX and DOM library', group: 'JavaScript' },
diff --git a/frontend/src/lib/components/framework-icon.svelte b/frontend/src/lib/components/framework-icon.svelte
index 676fd461..b31a32cc 100644
--- a/frontend/src/lib/components/framework-icon.svelte
+++ b/frontend/src/lib/components/framework-icon.svelte
@@ -23,7 +23,7 @@
<img src="/fasthttp.png" alt="FastHTTP" class={className} />
{:else if framework === 'stdlib'}
<img src="/stdlib.png" alt="Standard Library" class={className} />
-{:else if framework === 'react'}
+{:else if framework === 'react' || framework === 'react-native'}
<svg class={className} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="8" cy="8" r="1.5" fill="#61DAFB"/>
<ellipse cx="8" cy="8" rx="6.5" ry="2.5" stroke="#61DAFB" stroke-width="0.8" fill="none"/>
diff --git a/frontend/src/lib/state/projects.svelte.ts b/frontend/src/lib/state/projects.svelte.ts
index 6bf30a83..939463b9 100644
--- a/frontend/src/lib/state/projects.svelte.ts
+++ b/frontend/src/lib/state/projects.svelte.ts
@@ -1,10 +1,10 @@
import { api } from '$lib/api';
import { authState } from './auth.svelte';
-export type Framework = 'gin' | 'fiber' | 'chi' | 'fasthttp' | 'stdlib' | 'custom' | 'react' | 'svelte' | 'vuejs' | 'nextjs' | 'nestjs' | 'express' | 'remix' | 'jquery' | 'hono' | 'cloudflare' | 'opentelemetry' | 'symfony' | 'flutter' | 'android';
+export type Framework = 'gin' | 'fiber' | 'chi' | 'fasthttp' | 'stdlib' | 'custom' | 'react' | 'svelte' | 'vuejs' | 'nextjs' | 'nestjs' | 'express' | 'remix' | 'jquery' | 'react-native' | 'hono' | 'cloudflare' | 'opentelemetry' | 'symfony' | 'flutter' | 'android';
-export const FRONTEND_FRAMEWORKS: Framework[] = ['react', 'svelte', 'vuejs', 'jquery', 'flutter', 'android'];
-export const JS_FRAMEWORKS: Framework[] = ['react', 'svelte', 'vuejs', 'nextjs', 'nestjs', 'express', 'remix', 'jquery'];
+export const FRONTEND_FRAMEWORKS: Framework[] = ['react', 'svelte', 'vuejs', 'jquery', 'react-native', 'flutter', 'android'];
+export const JS_FRAMEWORKS: Framework[] = ['react', 'svelte', 'vuejs', 'nextjs', 'nestjs', 'express', 'remix', 'jquery', 'react-native'];
export const FRAMEWORK_LABELS: Record<Framework, string> = {
gin: 'Gin',
@@ -21,6 +21,7 @@ export const FRAMEWORK_LABELS: Record<Framework, string> = {
express: 'Express',
remix: 'Remix',
jquery: 'jQuery',
+ 'react-native': 'React Native',
hono: 'Hono',
cloudflare: 'Cloudflare',
opentelemetry: 'OpenTelemetry',
diff --git a/frontend/src/lib/utils/framework-code.ts b/frontend/src/lib/utils/framework-code.ts
index 6956b345..82853499 100644
--- a/frontend/src/lib/utils/framework-code.ts
+++ b/frontend/src/lib/utils/framework-code.ts
@@ -30,6 +30,8 @@ export function getInstallCommand(framework: Framework): string {
return 'npm install @tracewayapp/remix';
case 'jquery':
return 'npm install @tracewayapp/jquery';
+ case 'react-native':
+ return 'npm install @tracewayapp/react-native';
case 'hono':
return '';
case 'symfony':
@@ -222,6 +224,22 @@ init("${connectionString}");
// jQuery AJAX errors are captured automatically
// Distributed trace headers are injected into $.ajax() requests`;
+ case 'react-native':
+ return `import { TracewayProvider, TracewayErrorBoundary } from "@tracewayapp/react-native";
+
+export default function App() {
+ return (
+ <TracewayProvider
+ connectionString="${connectionString}"
+ options={{ version: "1.0.0" }}
+ >
+ <TracewayErrorBoundary fallback={<CrashScreen />}>
+ <RootNavigator />
+ </TracewayErrorBoundary>
+ </TracewayProvider>
+ );
+}`;
+
case 'symfony':
return `<?php
// public/index.php
@@ -414,6 +432,12 @@ captureException(new Error("Test error"));`;
case 'jquery':
return `import { captureException } from "@tracewayapp/jquery";
+captureException(new Error("Test error"));`;
+ case 'react-native':
+ return `import { useTraceway } from "@tracewayapp/react-native";
+
+// In a component using the hook
+const { captureException } = useTraceway();
captureException(new Error("Test error"));`;
default:
return `import { captureException } from "@tracewayapp/${getPackageName(framework)}";
@@ -436,6 +460,7 @@ function getPackageName(framework: Framework): string {
case 'express': return 'express';
case 'remix': return 'remix';
case 'jquery': return 'jquery';
+ case 'react-native': return 'react-native';
default: return 'react';
}
}
@@ -456,6 +481,7 @@ export function getFrameworkLabel(framework: Framework): string {
express: 'Express',
remix: 'Remix',
jquery: 'jQuery',
+ 'react-native': 'React Native',
hono: 'Hono',
cloudflare: 'Cloudflare',
opentelemetry: 'OpenTelemetry',