7.0.0
Version 7 of the Sentry JavaScript SDK brings a variety of features and fixes including bundle size and performance improvements, brand new integrations, support for the attachments API, and key bug fixes.
This release does not change or remove any top level public API methods (captureException
, captureMessage
), and only requires changes to certain configuration options or custom clients/integrations/transports.
Note: The v7 version of the JavaScript SDK requires a self-hosted version of Sentry 20.6.0 or higher. If you are using a version of self-hosted Sentry (aka onpremise) older than 20.6.0
then you will need to upgrade.
For detailed overview of all the changes, please see our v7 migration guide.
Breaking Changes
If you are a regular consumer of the Sentry JavaScript SDK you only need to focus on the general items. The internal breaking changes are aimed at libraries that build on top of and extend the JavaScript SDK (like @sentry/electron
or @sentry/react-native
).
General
- Updated CommonJS distributions to use ES6 by default. If you need to support Internet Explorer 11 or old Node.js versions, we recommend using a preprocessing tool like Babel to convert Sentry packages to ES5. (#5005)
- Default
bundle.min.js
to ES6 instead of ES5. ES5 bundles are still available atbundle.es5.min.js
. (#4958) - Updated build system to use TypeScript 3.8.3 (#4895)
- Deprecated
Severity
enum for bundle size reasons. Please use string literals instead. (#4926) - Removed
critical
Severity level. (#5032) whitelistUrls
andblacklistUrls
have been renamed toallowUrls
anddenyUrls
in theSentry.init()
options. (#4850)BaseClient
and it's child classes now requiretransport
,stackParser
, andintegrations
to be explicitly passed in. This was done to improve tree-shakability. (#4927)- Updated package distribution structure and stopped distributing CDN bundles through
@sentry/*
npm packages. See details in our migration docs. (#4900) (#4901) - Simplified
Transport
API. This means custom transports will have to be adjusted accordingly. - Updated how Node Transport Options are passed down.
- Start propogating
baggage
HTTP header alongsidesentry-trace
header to propogate additional tracing related information. (#5133) - Renamed
registerRequestInstrumentation
export toinstrumentOutgoingRequests
in@sentry/tracing
. (#4859) - Renamed
UserAgent
integration toHttpContext
. (#5027) - Replaced
BrowserTracing
integration'smaxTransactionDuration
option withfinalTimeout
option in the@sentry/tracing
package and resetidleTimeout
based on activities count. This should improve accuracy of web-vitals like LCP by 20-30%. (#5044) - Updated
@sentry/angular
to be compiled by the angular compiler. (#4641) - Made tracing package treeshakable (#5166)
- Removed support for Node v6. (#4851)
- Removed
@sentry/minimal
package in favour of using@sentry/hub
. (#4971) - Removed support for Opera browser pre v15 (#4923)
- Removed
ignoreSentryErrors
option from AWS lambda SDK. Errors originating from the SDK will now always be caught internally. (#4994) - Removed
Integrations.BrowserTracing
export from@sentry/nextjs
. Please importBrowserTracing
from@sentry/nextjs
directly. - Removed static
id
property fromBrowserTracing
integration. - Removed
SDK_NAME
export from@sentry/browser
,@sentry/node
,@sentry/tracing
and@sentry/vue
packages. (#5040) - Removed
Angular
,Ember
, andVue
integrations from@sentry/integrations
in favour of the explicit framework packages:@sentry/angular
,@sentry/ember
, and@sentry/vue
. (#4893) - Removed enums
Status
,RequestSessionStatus
, andSessionStatus
. Deprecated enumsSpanStatus
andSeverity
. This was done to save on bundle size. (#4891) (#4889) (#4890) - Removed support for deprecated
@sentry/apm
package. (#4845) - Removed deprecated
user
field from DSN interface.publicKey
should be used instead. (#4864) - Removed deprecated
getActiveDomain
method andDomainAsCarrier
type from@sentry/hub
. (#4858) - Removed
eventStatusFromHttpCode
to save on bundle size. - Removed usage of deprecated
event.stacktrace
field. (#4885) - Removed raven-node backward-compat code (#4942)
- Removed
showReportDialog
method onBrowserClient
(#4973) - Removed deprecated
startSpan
andchild
methods (#4849) - Removed deprecated
frameContextLines
options (#4884) - Removed
Sentry
from window in the Gatsby SDK (#4857)
Internal
- Removed support for the store endpoint (#4969)
- Made hint callback argument non-optional (#5141)
- Switched to using new transports internally (#4943)
- Removed
API
class from@sentry/core
. (#4848) - Refactored
Session
class to use a more functional approach. (#5054) - Removed
Backend
class in favour of moving functionality into theClient
class (for more details, see #4911 and #4919). - Removed forget async utility function (#4941)
- Removed tslint from
@sentry-internal/typescript
(#4940) - Removed
_invokeClient
function from@sentry/hub
(#4972) - Removed top level eventbuilder exports (#4887)
- Added baggage API helpers in
@sentry/utils
(#5066)
Other Changes
Features
- feat(tracing): Add Prisma ORM integration. (#4931)
- feat(react): Add react-router-v6 integration (#5042)
- feat: Add attachments API (#5004)
- feat: Add
name
field toEventProcessor
(#4932) - feat: Expose configurable stack parser (#4902)
- feat(tracing): Make
setMeasurement
public API (#4933) - feat(tracing): Add GB unit to device memory tag value (#4935)
- feat: Export browser integrations individually (#5028)
- feat(core): Send Baggage in Envelope Header (#5104)
Fixes
- fix(browser): Fix memory leak in
addEventListener
instrumentation (#5147) - fix(build): Fix express import in
gcpfunction
(#5097) - fix(ember): Export sha hashes of injected scripts (#5089)
- fix(hub): Add missing parameter to captureException docstring (#5001)
- fix(integrations): Mark ExtraErrorData as already normalized (#5053)
- fix(serverless): Adjust v6 Lambda layer hotfix for v7 (#5006)
- fix(tracing): Adjust sideEffects package.json entry for v7 (#4987)
- fix(tracing): Remove isInstanceOf check in Hub constructor (#5046)
- fix(tracing): Don't use
querySelector
when not available (#5160) - fix(nextjs): Update webpack-plugin and change how cli binary is detected. This should reduce bundle size of NextJS applications. (#4988)
- fix(utils): Fix infinite recursion in
dropUndefinedKeys
(#5163)
Misc
- feat(build): Vendor polyfills injected during build (#5051)
- ref(build): Use rollup to build AWS lambda layer (#5146)
- ref(core): Make event processing log warnings instead of errors (#5010)
- ref(node): Allow node stack parser to work in browser context (#5135)
- ref(serverless): Point DSN to relay in lambda extension (#5126)
- ref(serverless): Do not throw on flush error (#5090)
- ref(utils): Clean up dangerous type casts in object helper file (#5047)
- ref(utils): Add logic to enable skipping of normalization (#5052)