Conversation
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: Browser-specific exports for @rivetkit/tracesOverviewThis PR adds browser-specific exports to prevent bundlers from pulling server-only Node.js dependencies into browser bundles. The approach is solid and follows established patterns for creating platform-specific builds. ✅ Strengths
🔍 Issues & Concerns1. Missing type exports in browser stub (High Priority)The // From index.ts - these are missing in index.browser.ts
export type {
EndSpanOptions, EventOptions, ReadRangeOptions, ReadRangeResult,
ReadRangeWire, SpanHandle, SpanStatusInput, StartSpanOptions,
Traces, TracesDriver, TracesOptions, UpdateSpanOptions
} from "./types.js";
export type { OtlpAnyValue, OtlpExportTraceServiceRequestJson, ... } from "./otlp.js";Why this matters: Frontend code imports these types (see Fix: Add all type exports to export function createTraces(): never {
throw new Error("...");
}
// Re-export all types that browser code needs
export type {
EndSpanOptions, EventOptions, ReadRangeOptions, ReadRangeResult,
ReadRangeWire, SpanHandle, SpanStatusInput, StartSpanOptions,
Traces, TracesDriver, TracesOptions, UpdateSpanOptions
} from "./types.js";
export type {
OtlpAnyValue, OtlpExportTraceServiceRequestJson, OtlpInstrumentationScope,
OtlpKeyValue, OtlpResource, OtlpResourceSpans, OtlpScopeSpans,
OtlpSpan, OtlpSpanEvent, OtlpSpanLink, OtlpSpanStatus
} from "./otlp.js";2. Missing
|
More templates
@rivetkit/cloudflare-workers
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/traces
@rivetkit/workflow-engine
@rivetkit/virtual-websocket
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
Graphite Automations"Test" took an action on this PR • (02/05/26)1 assignee was added to this PR based on Kacper Wojciechowski's automation. |
a18121c to
f49653b
Compare
55c8a8a to
73b4513
Compare
| import { | ||
| readRangeWireToOtlp, | ||
| type OtlpAnyValue, | ||
| type OtlpExportTraceServiceRequestJson, | ||
| type OtlpKeyValue, | ||
| type OtlpSpan, | ||
| type OtlpSpanEvent, | ||
| } from "@rivetkit/traces/otlp"; |
There was a problem hiding this comment.
Import sorting issue. The imports were reorganized but may not follow the project's convention. Run the Biome formatter to fix this automatically.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
| "fdb-tuple": "^1.0.0", | ||
| "cbor-x": "^1.6.0", |
There was a problem hiding this comment.
Dependency ordering issue. The 'cbor-x' dependency was moved after 'fdb-tuple' which might violate the project's dependency sorting rules. Dependencies should be alphabetically sorted.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
f49653b to
7bb6306
Compare
73b4513 to
464d190
Compare
Merge activity
|
# Description Added browser-specific exports for the `@rivetkit/traces` package to ensure proper bundling in browser environments. This change: 1. Created a browser-specific entry point (`index.browser.ts`) that provides a stub implementation of `createTraces()` which throws an appropriate error when called in browser contexts 2. Updated the package.json to include browser-specific export conditions for all entry points 3. Reorganized imports in frontend components to use the correct paths and avoid importing server-only code in the browser 4. Consolidated type imports to come from their appropriate modules ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ## How Has This Been Tested? Verified that the frontend components can properly import the trace-related types and functions without pulling in server-only code. ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes

Description
Added browser-specific exports for the
@rivetkit/tracespackage to ensure proper bundling in browser environments. This change:index.browser.ts) that provides a stub implementation ofcreateTraces()which throws an appropriate error when called in browser contextsType of change
How Has This Been Tested?
Verified that the frontend components can properly import the trace-related types and functions without pulling in server-only code.
Checklist: