Skip to content

Commit 7a8fe99

Browse files
author
Luca Forstner
authored
Merge pull request #11976 from getsentry/prepare-release/8.0.0-rc.3
2 parents e987ed3 + 6870373 commit 7a8fe99

File tree

29 files changed

+500
-356
lines changed

29 files changed

+500
-356
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
## 8.0.0-rc.3
8+
9+
### Important Changes
10+
11+
- **feat(bun): Add Bun Global Unhandled Handlers (#11960)**
12+
13+
The Bun SDK will now capture global unhandled errors.
14+
15+
### Other Changes
16+
17+
- feat(node): Log process and thread info on initialisation (#11972)
18+
- fix(aws-serverless): Include ESM artifacts in package (#11973)
19+
- fix(browser): Only start `http.client` spans if there is an active parent span (#11974)
20+
- fix(feedback): Improve CSS theme variable names and layout (#11964)
21+
- fix(node): Ensure `execArgv` are not sent to worker threads (#11963)
22+
- ref(feedback): Simplify feedback function params (#11957)
23+
724
## 8.0.0-rc.2
825

926
### Important Changes
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const Sentry = require('@sentry/node');
2+
const { loggingTransport } = require('@sentry-internal/node-integration-tests');
3+
4+
Sentry.init({
5+
dsn: 'https://[email protected]/1337',
6+
includeLocalVariables: true,
7+
transport: loggingTransport,
8+
});
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* eslint-disable no-unused-vars */
2+
process.on('uncaughtException', () => {
3+
// do nothing - this will prevent the Error below from closing this process
4+
});
5+
6+
class Some {
7+
two(name) {
8+
throw new Error('Enough!');
9+
}
10+
}
11+
12+
function one(name) {
13+
const arr = [1, '2', null];
14+
const obj = {
15+
name,
16+
num: 5,
17+
};
18+
const bool = false;
19+
const num = 0;
20+
const str = '';
21+
const something = undefined;
22+
const somethingElse = null;
23+
24+
const ty = new Some();
25+
26+
ty.two(name);
27+
}
28+
29+
setTimeout(() => {
30+
one('some name');
31+
}, 1000);

dev-packages/node-integration-tests/suites/public-api/LocalVariables/test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ conditionalTest({ min: 18 })('LocalVariables integration', () => {
5959
.start(done);
6060
});
6161

62+
test('Should include local variables when instrumenting via --require', done => {
63+
const requirePath = path.resolve(__dirname, 'local-variables-instrument.js');
64+
65+
createRunner(__dirname, 'local-variables-no-sentry.js')
66+
.withFlags(`--require=${requirePath}`)
67+
.ignore('session')
68+
.expect({ event: EXPECTED_LOCAL_VARIABLES_EVENT })
69+
.start(done);
70+
});
71+
6272
test('Should include local variables with ESM', done => {
6373
createRunner(__dirname, 'local-variables-caught.mjs')
6474
.ignore('session')

packages/aws-serverless/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"files": [
1313
"cjs",
14+
"esm",
1415
"types",
1516
"types-ts3.8",
1617
"import-hook.mjs",

packages/browser/src/tracing/request.ts

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
SEMANTIC_ATTRIBUTE_SENTRY_OP,
88
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
99
SentryNonRecordingSpan,
10+
getActiveSpan,
1011
getClient,
1112
getCurrentScope,
1213
getDynamicSamplingContextFromClient,
@@ -324,20 +325,23 @@ export function xhrCallback(
324325
const fullUrl = getFullURL(sentryXhrData.url);
325326
const host = fullUrl ? parseUrl(fullUrl).host : undefined;
326327

327-
const span = shouldCreateSpanResult
328-
? startInactiveSpan({
329-
name: `${sentryXhrData.method} ${sentryXhrData.url}`,
330-
attributes: {
331-
type: 'xhr',
332-
'http.method': sentryXhrData.method,
333-
'http.url': fullUrl,
334-
url: sentryXhrData.url,
335-
'server.address': host,
336-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser',
337-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client',
338-
},
339-
})
340-
: new SentryNonRecordingSpan();
328+
const hasParent = !!getActiveSpan();
329+
330+
const span =
331+
shouldCreateSpanResult && hasParent
332+
? startInactiveSpan({
333+
name: `${sentryXhrData.method} ${sentryXhrData.url}`,
334+
attributes: {
335+
type: 'xhr',
336+
'http.method': sentryXhrData.method,
337+
'http.url': fullUrl,
338+
url: sentryXhrData.url,
339+
'server.address': host,
340+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser',
341+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client',
342+
},
343+
})
344+
: new SentryNonRecordingSpan();
341345

342346
xhr.__sentry_xhr_span_id__ = span.spanContext().spanId;
343347
spans[xhr.__sentry_xhr_span_id__] = span;
@@ -348,9 +352,10 @@ export function xhrCallback(
348352
addTracingHeadersToXhrRequest(
349353
xhr,
350354
client,
351-
// If performance is disabled (TWP), we do not want to use the span as base for the trace headers,
355+
// If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction),
356+
// we do not want to use the span as base for the trace headers,
352357
// which means that the headers will be generated from the scope and the sampling decision is deferred
353-
hasTracingEnabled() ? span : undefined,
358+
hasTracingEnabled() && hasParent ? span : undefined,
354359
);
355360
}
356361

packages/bun/src/sdk.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
modulesIntegration,
1313
nativeNodeFetchIntegration,
1414
nodeContextIntegration,
15+
onUncaughtExceptionIntegration,
16+
onUnhandledRejectionIntegration,
1517
} from '@sentry/node';
1618
import type { Integration, Options } from '@sentry/types';
1719

@@ -33,9 +35,9 @@ export function getDefaultIntegrations(_options: Options): Integration[] {
3335
consoleIntegration(),
3436
httpIntegration(),
3537
nativeNodeFetchIntegration(),
36-
// Global Handlers # TODO (waiting for https://github.com/oven-sh/bun/issues/5091)
37-
// new NodeIntegrations.OnUncaughtException(),
38-
// new NodeIntegrations.OnUnhandledRejection(),
38+
// Global Handlers
39+
onUncaughtExceptionIntegration(),
40+
onUnhandledRejectionIntegration(),
3941
// Event Info
4042
contextLinesIntegration(),
4143
nodeContextIntegration(),

packages/core/src/fetch.ts

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
} from './tracing';
1818
import { SentryNonRecordingSpan } from './tracing/sentryNonRecordingSpan';
1919
import { hasTracingEnabled } from './utils/hasTracingEnabled';
20-
import { spanToTraceHeader } from './utils/spanUtils';
20+
import { getActiveSpan, spanToTraceHeader } from './utils/spanUtils';
2121

2222
type PolymorphicRequestHeaders =
2323
| Record<string, string | undefined>
@@ -70,20 +70,23 @@ export function instrumentFetchRequest(
7070
const fullUrl = getFullURL(url);
7171
const host = fullUrl ? parseUrl(fullUrl).host : undefined;
7272

73-
const span = shouldCreateSpanResult
74-
? startInactiveSpan({
75-
name: `${method} ${url}`,
76-
attributes: {
77-
url,
78-
type: 'fetch',
79-
'http.method': method,
80-
'http.url': fullUrl,
81-
'server.address': host,
82-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,
83-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client',
84-
},
85-
})
86-
: new SentryNonRecordingSpan();
73+
const hasParent = !!getActiveSpan();
74+
75+
const span =
76+
shouldCreateSpanResult && hasParent
77+
? startInactiveSpan({
78+
name: `${method} ${url}`,
79+
attributes: {
80+
url,
81+
type: 'fetch',
82+
'http.method': method,
83+
'http.url': fullUrl,
84+
'server.address': host,
85+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,
86+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client',
87+
},
88+
})
89+
: new SentryNonRecordingSpan();
8790

8891
handlerData.fetchData.__span = span.spanContext().spanId;
8992
spans[span.spanContext().spanId] = span;
@@ -102,9 +105,10 @@ export function instrumentFetchRequest(
102105
client,
103106
scope,
104107
options,
105-
// If performance is disabled (TWP), we do not want to use the span as base for the trace headers,
108+
// If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction),
109+
// we do not want to use the span as base for the trace headers,
106110
// which means that the headers will be generated from the scope and the sampling decision is deferred
107-
hasTracingEnabled() ? span : undefined,
111+
hasTracingEnabled() && hasParent ? span : undefined,
108112
);
109113
}
110114

packages/feedback/src/constants/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ export const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;
99
export const DOCUMENT = WINDOW.document;
1010
export const NAVIGATOR = WINDOW.navigator;
1111

12-
export const ACTOR_LABEL = 'Report a Bug';
12+
export const TRIGGER_LABEL = 'Report a Bug';
1313
export const CANCEL_BUTTON_LABEL = 'Cancel';
1414
export const SUBMIT_BUTTON_LABEL = 'Send Bug Report';
15+
export const CONFIRM_BUTTON_LABEL = 'Confirm';
1516
export const FORM_TITLE = 'Report a Bug';
1617
export const EMAIL_PLACEHOLDER = '[email protected]';
1718
export const EMAIL_LABEL = 'Email';
@@ -20,7 +21,9 @@ export const MESSAGE_LABEL = 'Description';
2021
export const NAME_PLACEHOLDER = 'Your Name';
2122
export const NAME_LABEL = 'Name';
2223
export const SUCCESS_MESSAGE_TEXT = 'Thank you for your report!';
23-
export const IS_REQUIRED_TEXT = '(required)';
24+
export const IS_REQUIRED_LABEL = '(required)';
25+
export const ADD_SCREENSHOT_LABEL = 'Add a screenshot';
26+
export const REMOVE_SCREENSHOT_LABEL = 'Remove screenshot';
2427

2528
export const FEEDBACK_WIDGET_SOURCE = 'widget';
2629
export const FEEDBACK_API_SOURCE = 'api';
Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,58 @@
1-
const LIGHT_BACKGROUND = '#ffffff';
21
const INHERIT = 'inherit';
3-
const SUBMIT_COLOR = 'rgba(108, 95, 199, 1)';
2+
const PURPLE = 'rgba(88, 74, 192, 1)';
3+
const PURPLE_HOVER = 'rgba(108, 95, 199, 1)';
44

55
export const LIGHT_THEME = {
6-
fontFamily: "system-ui, 'Helvetica Neue', Arial, sans-serif",
7-
fontSize: '14px',
8-
96
foreground: '#2b2233',
10-
background: LIGHT_BACKGROUND,
11-
success: '#268d75',
12-
error: '#df3338',
13-
14-
zIndex: 100000,
7+
successForeground: '#268d75',
8+
errorForeground: '#df3338',
9+
background: '#ffffff',
1510
border: '1.5px solid rgba(41, 35, 47, 0.13)',
1611
boxShadow: '0px 4px 24px 0px rgba(43, 34, 51, 0.12)',
1712

18-
backgroundHover: '#f6f6f7',
19-
borderRadius: '25px',
20-
21-
formBorderRadius: '20px',
22-
formContentBorderRadius: '6px',
23-
24-
submitForeground: LIGHT_BACKGROUND,
25-
submitBackground: 'rgba(88, 74, 192, 1)',
26-
submitForegroundHover: LIGHT_BACKGROUND,
27-
submitBackgroundHover: SUBMIT_COLOR,
28-
submitBorder: SUBMIT_COLOR,
13+
inputForeground: INHERIT,
14+
inputBackground: INHERIT,
15+
inputBackgroundHover: INHERIT,
16+
inputBackgroundFocus: INHERIT,
17+
inputBorder: 'var(--border)',
18+
inputBorderRadius: '6px',
19+
inputOutlineFocus: PURPLE_HOVER,
20+
21+
buttonForeground: INHERIT,
22+
buttonForegroundHover: INHERIT,
23+
buttonBackground: 'var(--background)',
24+
buttonBackgroundHover: '#f6f6f7',
25+
buttonBorder: 'var(--border)',
26+
buttonOutlineFocus: 'var(--input-outline-focus)',
27+
28+
submitForeground: '#ffffff',
29+
submitForegroundHover: '#ffffff',
30+
submitBackground: PURPLE,
31+
submitBackgroundHover: PURPLE_HOVER,
32+
submitBorder: PURPLE_HOVER,
33+
submitBorderRadius: 'var(--button-border-radius)',
2934
submitOutlineFocus: '#29232f',
3035

31-
cancelForeground: 'var(--foreground)',
32-
cancelBackground: 'transparent',
33-
cancelForegroundHover: 'var(--foreground)',
34-
cancelBackgroundHover: 'var(--background-hover)',
35-
cancelBorder: 'var(--border)',
36-
cancelOutlineFocus: 'var(--input-outline-focus)',
36+
triggerBackground: 'var(--background)',
37+
triggerBackgroundHover: 'var(--button-background-hover)',
38+
triggerBorderRadius: '1.7em/50%',
3739

38-
inputBackground: INHERIT,
39-
inputForeground: INHERIT,
40-
inputBorder: 'var(--border)',
41-
inputOutlineFocus: SUBMIT_COLOR,
40+
dialogBackground: 'var(--background)',
41+
dialogBorderRadius: '20px',
4242
};
4343

4444
export const DEFAULT_THEME = {
4545
light: LIGHT_THEME,
4646
dark: {
4747
...LIGHT_THEME,
4848

49-
background: '#29232f',
50-
backgroundHover: '#352f3b',
5149
foreground: '#ebe6ef',
52-
border: '1.5px solid rgba(235, 230, 239, 0.15)',
50+
successForeground: '#2da98c',
51+
errorForeground: '#f55459',
52+
background: '#29232f',
53+
border: '1.5px solid rgba(235, 230, 239, 0.5)',
54+
boxShadow: '0px 4px 24px 0px rgba(43, 34, 51, 0.12)',
5355

54-
success: '#2da98c',
55-
error: '#f55459',
56+
buttonBackgroundHover: '#352f3b',
5657
},
5758
};

packages/feedback/src/core/components/Actor.css.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function createActorStyles(): HTMLStyleElement {
99
.widget__actor {
1010
position: fixed;
1111
z-index: var(--z-index);
12-
margin: 0;
12+
margin: var(--page-margin);
1313
inset: var(--actor-inset);
1414
1515
display: flex;
@@ -20,14 +20,15 @@ export function createActorStyles(): HTMLStyleElement {
2020
font-family: inherit;
2121
font-size: var(--font-size);
2222
font-weight: 600;
23-
line-height: 16px;
23+
line-height: 1.14em;
2424
text-decoration: none;
2525
26-
background-color: var(--background);
27-
border-radius: var(--border-radius);
26+
background-color: var(--trigger-background);
27+
border-radius: var(--trigger-border-radius);
2828
border: var(--border);
2929
box-shadow: var(--box-shadow);
3030
color: var(--foreground);
31+
fill: var(--foreground);
3132
cursor: pointer;
3233
opacity: 1;
3334
transition: transform 0.2s ease-in-out;
@@ -41,12 +42,12 @@ export function createActorStyles(): HTMLStyleElement {
4142
}
4243
4344
.widget__actor:hover {
44-
background-color: var(--background-hover);
45+
background-color: var(--trigger-background-hover);
4546
}
4647
4748
.widget__actor svg {
48-
width: 16px;
49-
height: 16px;
49+
width: 1.14em;
50+
height: 1.14em;
5051
}
5152
5253
@media (max-width: 600px) {

0 commit comments

Comments
 (0)