feat(browser): export initLogtide; dedup framework client init#10
Merged
Conversation
Add `initLogtide` (and the `buildBrowserIntegrations` /
`buildBrowserTransportWrapper` helpers) to `@logtide/browser`, matching the
React integration docs (`import { initLogtide } from '@logtide/browser'`).
The Next.js, SvelteKit and Angular client init now delegate to the shared
`initLogtide`, removing the duplicated browser-init logic. SvelteKit now
defaults `service` to 'sveltekit' (was 'unknown'), aligning it with Next.js
and Angular.
Bump all packages to 0.10.0.
Fixes #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #9 — the React integration docs tell users to
import { initLogtide } from '@logtide/browser', but@logtide/browsernever exported it, producingModule '"@logtide/browser"' has no exported member 'initLogtide'.Changes
@logtide/browser: newinitLogtide(options)export — wires up the global error handler, default browser integrations (click/network breadcrumbs, optional Web Vitals) and offline resilience, then binds the session id to the global scope. Also exports the reusablebuildBrowserIntegrations/buildBrowserTransportWrapperhelpers.@logtide/nextjs,@logtide/sveltekit,@logtide/angular: client init now delegates to the sharedinitLogtide(passing their owndefaultService), removing ~180 lines of duplicated browser-init logic.serviceto'sveltekit'when not provided (previously fell back to'unknown'), aligning it with Next.js ('nextjs') and Angular ('angular'). An explicitservicestill wins.0.9.0 → 0.10.0+ CHANGELOG entry.Tests
TDD: 5 new tests in
packages/browser/tests/init.test.ts.@logtide/browser: 46 tests pass, typecheck + build OK@logtide/nextjs(17),@logtide/sveltekit(20),@logtide/angular(7): tests pass, typecheck OK