Releases: robertcepa/toucan-js
[email protected]
Major Changes
-
fce854c and c29ddfa: This release upgrades the underlying Sentry SDKs to v8.
- Toucan now extends ScopeClass instead of Hub.
- Class-based integrations have been removed in Sentry v8. Toucan adapts to this change by renaming:
Dedupe
integration todedupeIntegration
ExtraErrorData
integration toextraErrorDataIntegration
RewriteFrames
integration torewriteFramesIntegration
SessionTiming
integration tosessionTimingIntegration
LinkedErrors
integration tolinkedErrorsIntegration
RequestData
integration torequestDataIntegration
- Additionally,
Transaction
integration is no longer provided. - Toucan instance can now be deeply copied using
Toucan.clone()
.
Refer to Sentry v8 release notes and Sentry v7->v8 for additional context.
Special shout-out to @timfish for their contribution 🚀
[email protected]
Minor Changes
- 2c75016: Update sentry dependencies to 7.112.2
[email protected]
[email protected]
[email protected]
Patch Changes
- c7c0b64: Update sentry dependencies to v7.65.0
[email protected]
Patch Changes
- 19eaef2: Update sentry dependencies to v7.63.0
[email protected]
Patch Changes
- 321ecdd: Update sentry dependencies to v7.61.0
[email protected]
Minor Changes
- 3ce9e8e: You can now wrap fetch by passing fetcher to transportOptions.
- 87e50c9: Add setEnabled method
- 66f08ca: The following integrations are now re-exported from
toucan-js
for type compatibility:Dedupe
,ExtraErrorData
,RewriteFrames
,SessionTiming
,Transaction
.
Patch Changes
- 370954f: Update sentry dependencies to v7.60.0
- 86c2be8: Update dependency miniflare to v2.12.1
- 17b22f1: Update dependency rollup to v3.19.1
- cde3c15: Update dependency @rollup/plugin-commonjs to v24
- ac869b6: Update dependency @rollup/plugin-commonjs to v23.0.7
- d697e6f: Update dependency ts-jest to v29.0.5
- c478f14: Update dependency @rollup/plugin-replace to v5.0.2
[email protected]
Minor Changes
- 5f6cea5: Update Sentry dependencies to 7.28.1
[email protected]
This is a complete rewrite of toucan-js
. The goal of this update is to reuse more components from @sentry/core, fix long-standing issues with source maps, and provide starters using various bundlers (esbuild, rollup, vite, webpack).
The good news is that toucan-js
now supports pretty much all SDK options and methods provided in official Sentry SDKs for JavaScript that you all are used to and love.
The bad news is that I may fail to document all breaking changes, because toucan-js
now delegates to a lot of code written by someone else. So use this release with caution. :)
- All methods and options available on Hub that previously weren't available or didn't work are now supported. This includes integrations!
- On integrations: some integrations from @sentry/integrations might not work because they use globals, or modify global runtime methods (such as console.log). Refer to README file that documents all supported integrations.
- This monorepo now provides quick starts written in TypeScript, with source maps support and local live reloading experience using open source Cloudflare Workers runtime.
- Total bundle size reduced from
65.3kB
to44.3kB
. This is thanks to replacing stacktrace-js with our own stack parser. Pretty cool given that we added a ton of new features at the same time!
Breaking changes
-
Toucan
now uses Envelopes protocol withPOST /api/<project_id>/envelope/
endpoint, instead of previously usedPOST /api/<project_id>/store/
endpoint. -
Toucan
client is no longer the default export. It is now a named export.Before:
import Toucan from 'toucan-js';
After:
import { Toucan } from 'toucan-js';
-
setFingerprint
is no longer a top level method. This method is now available onScope
. There are many ways to configure scope:
Option 1:
const sentry = new Toucan({
dsn: env.SENTRY_DSN,
context,
request,
initialScope: {
fingerprint: [...]
}
});
Option 2:
const sentry = new Toucan({...});
sentry.configureScope(scope => scope.setFingerprint([...]))
Option 3:
const sentry = new Toucan({...});
sentry.withScope((scope) => scope.setFingerprint([...]));
-
OtherOptions
type has been removed. UseOptions
type instead.Options
type isn't a discriminated union anymore and contains all types. -
event
option has been removed. Usecontext
option instead. -
context.request
is no longer used to track request data. If you want to track request data, use top-levelrequest
option instead. -
allowedCookies
,allowedHeaders
,allowedSearchParams
are no longer top level options, but options on newRequestData
integration that is exported from the SDK. The Toucan client provides a shortcut for these options asrequestDataOptions
top level option. To migrate, either move them torequestDataOptions
, or pass them toRequestData
integration.Before:
import Toucan from 'toucan-js'; const sentry = new Toucan({ dsn: '...', context, allowedCookies: ['myCookie'], allowedHeaders: ['user-agent'], allowedSearchParams: ['utm-source'], });
After (option 1):
import { Toucan } from 'toucan-js'; const sentry = new Toucan({ dsn: '...', context, requestDataOptions: { allowedCookies: ['myCookie'], allowedHeaders: ['user-agent'], allowedSearchParams: ['utm-source'], }, });
After (option 2):
import { Toucan, RequestData } from 'toucan-js'; const sentry = new Toucan({ dsn: '...', context, integrations: [new RequestData({{ allowedCookies: ['myCookie'], allowedHeaders: ['user-agent'], allowedSearchParams: ['utm-source'], }})], });
-
allowed*
options now support boolean values on top of lists and regexes.true
allows everything,false
denies everything. -
tracesSampleRate
andtracesSampler
options no longer affect Sentry events. They only affect transactions. If you want to sample sentry events, usesampleRate
option. Refer to https://docs.sentry.io/platforms/javascript/configuration/sampling/ for more information. -
pkg
option has been removed. -
rewriteFrames
option has been removed. To migrate, useRewriteFrames
integration from @sentry/integrations.Before
import Toucan from 'toucan-js'; const sentry = new Toucan({ dsn: '...', context, rewriteFrames: { root: '/', }, });
After
import { RewriteFrames } from '@sentry/integrations'; import { Toucan } from 'toucan-js'; const sentry = new Toucan({ dsn: '...', context, integrations: [new RewriteFrames({ root: '/' })], });