Releases: getsentry/sentry-javascript
7.48.0
Important Changes
- feat(node): Add
AsyncLocalStorage
implementation ofAsyncContextStrategy
(#7800)- feat(core): Extend
AsyncContextStrategy
to allow reuse of existing context (#7778) - feat(core): Make
runWithAsyncContext
public API (#7817) - feat(core): Add async context abstraction (#7753)
- feat(node): Adds
domain
implementation ofAsyncContextStrategy
(#7767) - feat(node): Auto-select best
AsyncContextStrategy
for Node.js version (#7804) - feat(node): Migrate to domains used through
AsyncContextStrategy
(#7779)
- feat(core): Extend
This release switches the SDK to use AsyncLocalStorage
as the async context isolation mechanism in the SDK for Node 14+. For Node 10 - 13, we continue to use the Node domain
standard library, since AsyncLocalStorage
is not supported there. Preliminary testing showed a 30% improvement in latency and rps when making the switch from domains to AsyncLocalStorage
on Node 16.
If you want to manually add async context isolation to your application, you can use the new runWithAsyncContext
API.
import * as Sentry from '@sentry/node';
const requestHandler = (ctx, next) => {
return new Promise((resolve) => {
Sentry.runWithAsyncContext(async () => {
const hub = Sentry.getCurrentHub();
hub.configureScope(scope =>
scope.addEventProcessor(event =>
Sentry.addRequestDataToEvent(event, ctx.request, {
include: {
user: false,
},
})
)
);
await next();
resolve();
});
});
};
If you're manually using domains to isolate Sentry data, we strongly recommend switching to this API!
In addition to exporting runWithAsyncContext
publicly, the SDK also uses it internally where we previously used domains.
- feat(sveltekit): Remove
withSentryViteConfig
(#7789)- feat(sveltekit): Remove SDK initialization via dedicated files (#7791)
This release removes our withSentryViteConfig
wrapper we previously instructed you to add to your vite.config.js
file. It is replaced Vite plugins which you simply add to your Vite config, just like the sveltekit()
Vite plugins. We believe this is a more transparent and Vite/SvelteKit-native way of applying build time modifications. Here's how to use the plugins:
// vite.config.js
import { sveltekit } from '@sveltejs/kit/vite';
import { sentrySvelteKit } from '@sentry/sveltekit';
export default {
plugins: [sentrySvelteKit(), sveltekit()],
// ... rest of your Vite config
};
Take a look at the README
for updated instructions!
Furthermore, with this transition, we removed the possibility to intialize the SDK in dedicated sentry.(client|server).config.js
files. Please use SvelteKit's hooks files to initialize the SDK.
Please note that these are breaking changes! We're sorry for the inconvenience but the SvelteKit SDK is still in alpha stage and we want to establish a clean and SvelteKit-friendly API before making the SDK stable. You have been warned ;)
- feat(sveltekit): Add Sentry Vite Plugin to upload source maps (#7811)
This release adds automatic upload of source maps to the SvelteKit SDK. No need to configure anything other than adding our Vite plugins to your SDK. The example above shows you how to do this.
Please make sure to follow the README
to specify your Sentry auth token, as well as org and project slugs.
- feat(replay): Capture request & response headers (#7816)
Replay now captures the content-length
, content-type
, and accept
headers from requests and responses automatically.
Additional Features and Fixes
- feat(browser): Export request instrumentation options (#7818)
- feat(core): Add async context abstraction (#7753)
- feat(core): Add DSC to all outgoing envelopes (#7820)
- feat(core): Cache processed stacks for debug IDs (#7825)
- feat(node): Add checkin envelope types (#7777)
- feat(replay): Add
getReplayId()
method (#7822) - fix(browser): Adjust
BrowserTransportOptions
to support offline transport options (#7775) - fix(browser): DOMException SecurityError stacktrace parsing bug (#7821)
- fix(core): Log warning when tracing extensions are missing (#7601)
- fix(core): Only call
applyDebugMetadata
for error events (#7824) - fix(integrations): Ensure httpclient integration works with Request (#7786)
- fix(node):
reuseExisting
does not need to call bind on domain (#7780) - fix(node): Fix domain scope inheritance (#7799)
- fix(node): Make
trpcMiddleware
factory synchronous (#7802) - fix(serverless): Account when transaction undefined (#7829)
- fix(utils): Make xhr instrumentation independent of parallel running SDK versions (#7836)
Bundle size 📦
Path | Size |
---|---|
@sentry/browser - ES5 CDN Bundle (gzipped + minified) | 21.04 KB |
@sentry/browser - ES5 CDN Bundle (minified) | 65.66 KB |
@sentry/browser - ES6 CDN Bundle (gzipped + minified) | 19.59 KB |
@sentry/browser - ES6 CDN Bundle (minified) | 58.12 KB |
@sentry/browser - Webpack (gzipped + minified) | 21.19 KB |
@sentry/browser - Webpack (minified) | 69.07 KB |
@sentry/react - Webpack (gzipped + minified) | 21.21 KB |
@sentry/nextjs Client - Webpack (gzipped + minified) | 49.06 KB |
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) | 28.61 KB |
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) | 26.85 KB |
@sentry/replay ES6 CDN Bundle (gzipped + minified) | 45.35 KB |
@sentry/replay - Webpack (gzipped + minified) | 39.28 KB |
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) | 64.28 KB |
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) | 57.26 KB |
7.47.0
Important Changes
- feat(browser): Add captureUserFeedback (#7729)
This release adds a new API, Sentry.captureUserFeedback
, to browser-side SDKs that allows you to send user feedback to Sentry without loading and opening Sentry's user feedback dialog. This allows you to obtain user feedback however and whenever you want to and simply send it to Sentry using the SDK.
For instance, you can collect feedback, whenever convenient as shown in this example:
const eventId = Sentry.captureMessage('User Feedback');
const user = Sentry.getCurrentHub().getScope().getUser();
const userFeedback = {
event_id: eventId;
email: user.email
name: user.username
comments: 'I really like your App, thanks!'
}
Sentry.captureUserFeedback(userFeedback);
Note that feedback needs to be coupled to an event but as in the example above, you can just use Sentry.captureMessage
to generate one.
You could also collect feedback in a custom way if an error happens and use the SDK to send it along:
Sentry.init({
dsn: '__DSN__',
beforeSend: event => {
const userFeedback = collectYourUserFeedback();
const feedback = {
...userFeedback,
event_id: event.event_id.
}
Sentry.captureUserFeedback(feedback);
return event;
}
})
- feat(tracing): Deprecate
@sentry/tracing
exports (#7611)
With this release, we officially deprecate all exports from the @sentry/tracing
package, in favour of using them directly from the main SDK package. The @sentry/tracing
package will be removed in a future major release.
Please take a look at the Migration docs for more details.
Additional Features and Fixes
- feat(sveltekit): Add partial instrumentation for client-side
fetch
(#7626) - fix(angular): Handle routes with empty path (#7686)
- fix(angular): Only open report dialog if error was sent (#7750)
- fix(core): Determine debug ID paths from the top of the stack (#7722)
- fix(ember): Ensure only one client is created & Replay works (#7712)
- fix(integrations): Ensure HttpClient integration works with Axios (#7714)
- fix(loader): Ensure JS loader works with tracing & add tests (#7662)
- fix(nextjs): Restore tree shaking capabilities (#7710)
- fix(node): Disable
LocalVariables
integration on Node < v18 (#7748) - fix(node): Redact URL authority only in breadcrumbs and spans (#7740)
- fix(react): Only show report dialog if event was sent to Sentry (#7754)
- fix(remix): Remove unnecessary dependencies (#7708)
- fix(replay): Ensure circular references are handled (#7752)
- fix(sveltekit): Don't capture thrown
Redirect
s as exceptions (#7731) - fix(sveltekit): Log error to console by default in
handleErrorWithSentry
(#7674) - fix(tracing): Make sure idle transaction does not override other transactions (#7725)
Work in this release contributed by @de-don and @TrySound. Thank you for your contributions!
Bundle size 📦
Path | Size |
---|---|
@sentry/browser - ES5 CDN Bundle (gzipped + minified) | 20.89 KB |
@sentry/browser - ES5 CDN Bundle (minified) | 65.29 KB |
@sentry/browser - ES6 CDN Bundle (gzipped + minified) | 19.44 KB |
@sentry/browser - ES6 CDN Bundle (minified) | 57.75 KB |
@sentry/browser - Webpack (gzipped + minified) | 21.06 KB |
@sentry/browser - Webpack (minified) | 68.73 KB |
@sentry/react - Webpack (gzipped + minified) | 21.09 KB |
@sentry/nextjs Client - Webpack (gzipped + minified) | 48.87 KB |
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) | 28.45 KB |
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) | 26.68 KB |
@sentry/replay ES6 CDN Bundle (gzipped + minified) | 44.88 KB |
@sentry/replay - Webpack (gzipped + minified) | 38.87 KB |
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) | 63.77 KB |
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) | 56.8 KB |
7.46.0
Important Changes
- feat(sveltekit): Add Performance Monitoring for SvelteKit
This release adds support for Performance Monitoring in our SvelteKit SDK for the client/server. We've also changed how you should initialize your SDK. Please read our updated SvelteKit README instructions for more details.
- feat(core): Add
ignoreTransactions
option (#7594)
You can now easily filter out certain transactions from being sent to Sentry based on their name.
Sentry.init({
ignoreTransactions: ['/api/healthcheck', '/ping'],
})
- feat(node): Undici integration (#7582)
We've added an integration that automatically instruments Undici and Node server side fetch. This supports Undici v4.7.0
or higher and requires Node v16.7.0
or higher. After adding the integration outgoing requests made by Undici will have associated spans and breadcrumbs in Sentry.
Sentry.init({
integrations: [new Sentry.Integrations.Undici()],
})
In our Next.js and SvelteKit SDKs, this integration is automatically added.
- feat(node): Add Sentry tRPC middleware (#7511)
We've added a new middleware for trpc that automatically adds TRPC information to Sentry transactions. This middleware is meant to be used in combination with a Sentry server integration (Next.js, Express, etc).
import { initTRPC } from '@trpc/server';
import * as Sentry from '@sentry/node';
const t = initTRPC.context().create();
const sentryMiddleware = t.middleware(
Sentry.Handlers.trpcMiddleware({
attachRpcInput: true,
}),
);
const sentrifiedProcedure = t.procedure.use(sentryMiddleware);
- feat(tracing): Remove requirement for
@sentry/tracing
package
With 7.46.0
you no longer require the @sentry/tracing
package to use tracing and performance monitoring with the Sentry JavaScript SDKs. The @sentry/tracing
package will be removed in a future major release, but can still be used with no changes.
Please see the Migration docs for more details.
- fix(node): Convert debugging code to callbacks to fix memory leak in
LocalVariables
integration (#7637)
This fixes a memory leak in the opt-in LocalVariables
integration, which adds local variables to the stacktraces sent to Sentry. The minimum recommended version to use the LocalVariables
is now 7.46.0
.
Additional Features and Fixes
- feat(node): Auto discovery only returns integrations where dependency loads (#7603)
- feat(node): Sanitize URLs in Span descriptions and breadcrumbs (PII) (#7667)
- feat(replay): Add
responseStatus
,decodedBodySize
to perf entries (#7613) - feat(replay): Add experiment to capture request/response bodies (#7589)
- feat(replay): Capture replay mutation breadcrumbs & add experiment (#7568)
- feat(tracing): Ensure
pageload
transaction starts at timeOrigin (#7632) - fix(core): Remove
abs_path
from stack trace (reverting #7167) (#7623) - fix(nextjs): Add loading component type to server component wrapping (#7639)
- fix(nextjs): Don't report
NEXT_NOT_FOUND
andNEXT_REDIRECT
errors (#7642) - fix(nextjs): Rewrite
abs_path
frames (#7619) - fix(nextjs): Show errors and warnings only once during build (#7651)
- fix(nextjs): Use Next.js internal AsyncStorage (#7630)
- fix(nextjs): Gracefully handle undefined
beforeFiles
in rewrites (#7649)
Work in this release contributed by @aldenquimby and @bertho-zero. Thank you for your contributions!
Bundle size 📦
Path | Size |
---|---|
@sentry/browser - ES5 CDN Bundle (gzipped + minified) | 20.62 KB |
@sentry/browser - ES5 CDN Bundle (minified) | 64.4 KB |
@sentry/browser - ES6 CDN Bundle (gzipped + minified) | 19.15 KB |
@sentry/browser - ES6 CDN Bundle (minified) | 56.78 KB |
@sentry/browser - Webpack (gzipped + minified) | 21.53 KB |
@sentry/browser - Webpack (minified) | 72 KB |
@sentry/react - Webpack (gzipped + minified) | 21.55 KB |
@sentry/nextjs Client - Webpack (gzipped + minified) | 52.05 KB |
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) | 28.21 KB |
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) | 26.41 KB |
@sentry/replay ES6 CDN Bundle (gzipped + minified) | 44.74 KB |
@sentry/replay - Webpack (gzipped + minified) | 38.86 KB |
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) | 63.46 KB |
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) | 56.49 KB |
7.45.0
- build(cdn): Ensure ES5 bundles do not use non-ES5 code (#7550)
- feat(core): Add trace function (#7556)
- feat(hub): Make scope always defined on the hub (#7551)
- feat(replay): Add
replay_id
to transaction DSC (#7571) - feat(replay): Capture fetch body size for replay events (#7524)
- feat(sveltekit): Add performance monitoring for client load (#7537)
- feat(sveltekit): Add performance monitoring for server load (#7536)
- feat(sveltekit): Add performance monitoring to Sveltekit server handle (#7532)
- feat(sveltekit): Add SvelteKit routing instrumentation (#7565)
- fix(browser): Ensure keepalive flag is correctly set for parallel requests (#7553)
- fix(core): Ensure
ignoreErrors
only applies to error events (#7573) - fix(node): Consider tracing error handler for process exit (#7558)
- fix(otel): Make sure we use correct hub on finish (#7577)
- fix(react): Handle case where error.cause already defined (#7557)
Bundle size 📦
Path | Size |
---|---|
@sentry/browser - ES5 CDN Bundle (gzipped + minified) | 20.57 KB |
@sentry/browser - ES5 CDN Bundle (minified) | 64.2 KB |
@sentry/browser - ES6 CDN Bundle (gzipped + minified) | 19.13 KB |
@sentry/browser - ES6 CDN Bundle (minified) | 56.58 KB |
@sentry/browser - Webpack (gzipped + minified) | 21.59 KB |
@sentry/browser - Webpack (minified) | 71.66 KB |
@sentry/react - Webpack (gzipped + minified) | 21.61 KB |
@sentry/nextjs Client - Webpack (gzipped + minified) | 51.88 KB |
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) | 27.93 KB |
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) | 26.1 KB |
@sentry/replay ES6 CDN Bundle (gzipped + minified) | 44.33 KB |
@sentry/replay - Webpack (gzipped + minified) | 38.39 KB |
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) | 62.54 KB |
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) | 56.06 KB |
7.44.2
7.44.1
7.44.0
This release introduces the first alpha version of @sentry/sveltekit
, our newest JavaScript SDK for Sveltekit. Check out the README for usage instructions and what to expect from this alpha release.
- feat(replay): Add
request_body_size
&response_body_size
to fetch/xhr (#7407) - feat(replay): Add additional properties for UI clicks (#7395)
- feat(replay): Reduce time limit before pausing a recording (#7356)
- feat(replay): Upgrade
rrweb
andrrweb-player
(#7508) - feat(replay): Use new afterSend hook to improve error linking (#7390)
- feat(serverless): Publish lambda layer for Node 16/18 (#7483)
- feat(sveltekit): Add wrapper for client load function (#7447)
- feat(sveltekit): Add wrapper for server load function (#7416)
- feat(sveltekit): Add server-side
handleError
wrapper (#7411) - feat(sveltekit): Introduce client-side
handleError
wrapper (#7406) - feat(sveltekit): Add SvelteKit client and server
init
functions (#7408) - feat(sveltekit): Inject
Sentry.init
calls into server and client bundles (#7391) - feat(tracing): Expose
BrowserTracing
in non-tracing bundles (#7479) - fix(core): Permanent idle timeout cancel finishes the transaction with the last finished child
- fix(integrations): Handle lower-case prefix windows paths in
RewriteFrames
(#7506) - fix(next): Guard against missing serverSideProps (#7517)
- fix(nextjs): Fix broken server component wrapping because of interrupted promise chain (#7456)
- fix(nextjs): Fix runtime error for static pages (#7476)
- fix(profiling): Catch sendProfile rejection (#7446)
- fix(replay): Never capture file input changes (#7485)
- fix(serverless): Explicitly export node package exports (#7457)
- fix(vue): Do not depend on
window.location
for SSR environments (#7518)
Replay rrweb
changes:
@sentry-internal/rrweb
was updated from 1.105.0 to 1.106.0:
- feat: Ensure password inputs are always masked (#78)
- fix: Ensure text masking for updated attributes works (#83)
- fix: Ensure unmaskTextSelector is used for masked attributes (#81)
- fix: Mask values for selects & radio/checkbox value (#75)
Work in this release contributed by @woochanleee and @baked-dev. Thank you for your contribution!
7.43.0
- feat(nextjs): Run source map upload in Vercel develop and preview environments (#7436)
- feat(types): Add
profilesSampler
option to node client type (#7385) - fix(core): Avoid using
Array.findIndex()
as it is ES5 incompatible (#7400) - fix(nextjs): Add better error messages for missing params during next build (#7434)
- fix(nextjs): Don't crash build when auth token is missing
- fix(node): Revert to dynamic
require
call to fix monkey patching (#7430) - fix(types): Fix node types & add E2E test (#7429)
7.42.0
- feat(core): Add lifecycle hooks (#7370)
- feat(core): Emit hooks for transaction start/finish (#7387)
- feat(nextjs): Connect traces for server components (#7320)
- feat(replay): Attach an error
cause
to send exceptions (#7350) - feat(replay): Consider user input in form field as "user activity" (#7355)
- feat(replay): Update rrweb to 1.105.0 & add breadcrumb when encountering large mutation (#7314)
- feat(tracing): Expose cancelIdleTimeout and add option to make it permanent (#7236)
- feat(tracing): Track PerformanceObserver interactions as spans (#7331)
- fix(core): Ensure
originalException
has typeunknown
(#7361) - fix(core): Avoid using
Object.values()
(#7360) - fix(react): Make redux integration be configurable via
normalizeDepth
(#7379) - fix(tracing): Record LCP and CLS on transaction finish (#7386)
- ref(browser): Improve type safety of breadcrumbs integration (#7382)
- ref(node): Parallelize disk io when reading source files for context lines (#7374)
- ref(node): Partially remove dynamic
require
calls (#7377)
Replay rrweb
changes:
@sentry-internal/rrweb
was updated from 1.104.1 to 1.105.0 (#7314):
7.41.0
- feat: Ensure we use the same default
environment
everywhere (#7327) - feat(profiling): Add JS self profiling in the browser (#7273)
- feat(vue): Allow to set
routeLabel: 'path'
to opt-out of using name (#7326) - fix(profiling): Guard from throwing if profiler constructor throws (#7328)
- fix(react): Use namespace import for react router v6 (#7330)
- fix(remix): Correctly parse
X-Forwarded-For
Http header (#7329)
Work in this release contributed by @OliverJAsh. Thank you for your contribution!