Skip to content

Commit e2b0dcd

Browse files
authored
Merge pull request #8588 from getsentry/prepare-release/7.59.3
2 parents 8563e39 + ac1e6db commit e2b0dcd

File tree

14 files changed

+243
-25
lines changed

14 files changed

+243
-25
lines changed

.craft.yml

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,107 @@ minVersion: '0.23.1'
22
changelogPolicy: simple
33
preReleaseCommand: bash scripts/craft-pre-release.sh
44
targets:
5+
# NPM Targets
6+
## 1. Base Packages, node or browser SDKs depend on
7+
## 1.1 Types
8+
- name: npm
9+
id: "@sentry/types"
10+
includeNames: /^sentry-types-\d.*\.tgz$/
11+
## 1.2 Utils
12+
- name: npm
13+
id: "@sentry/utils"
14+
includeNames: /^sentry-utils-\d.*\.tgz$/
15+
## 1.3 Core SDK
16+
- name: npm
17+
id: "@sentry/core"
18+
includeNames: /^sentry-core-\d.*\.tgz$/
19+
## 1.4 Tracing package
20+
- name: npm
21+
id: "@sentry-internal/tracing"
22+
includeNames: /^sentry-internal-tracing-\d.*\.tgz$/
23+
## 1.5 Replay package (browser only)
24+
- name: npm
25+
id: "@sentry/replay"
26+
includeNames: /^sentry-replay-\d.*\.tgz$/
27+
28+
## 2. Browser & Node SDKs
29+
- name: npm
30+
id: "@sentry/browser"
31+
includeNames: /^sentry-browser-\d.*\.tgz$/
32+
- name: npm
33+
id: "@sentry/node"
34+
includeNames: /^sentry-node-\d.*\.tgz$/
35+
36+
## 3 Browser-based Packages
37+
- name: npm
38+
id: "@sentry/angular-ivy"
39+
includeNames: /^sentry-angular-ivy-\d.*\.tgz$/
40+
- name: npm
41+
id: "@sentry/angular"
42+
includeNames: /^sentry-angular-\d.*\.tgz$/
43+
- name: npm
44+
id: "@sentry/ember"
45+
includeNames: /^sentry-ember-\d.*\.tgz$/
46+
- name: npm
47+
id: "@sentry/react"
48+
includeNames: /^sentry-react-\d.*\.tgz$/
49+
- name: npm
50+
id: "@sentry/svelte"
51+
includeNames: /^sentry-svelte-\d.*\.tgz$/
52+
- name: npm
53+
id: "@sentry/vue"
54+
includeNames: /^sentry-vue-\d.*\.tgz$/
55+
- name: npm
56+
id: "@sentry/wasm"
57+
includeNames: /^sentry-wasm-\d.*\.tgz$/
58+
- name: npm
59+
id: "@sentry/integrations"
60+
includeNames: /^sentry-integrations-\d.*\.tgz$/
61+
62+
## 4. Node-based Packages
63+
- name: npm
64+
id: "@sentry/serverless"
65+
includeNames: /^sentry-serverless-\d.*\.tgz$/
66+
- name: npm
67+
id: "@sentry/opentelemetry-node"
68+
includeNames: /^sentry-opentelemetry-node-\d.*\.tgz$/
69+
70+
## 5. Fullstack/Meta Frameworks (depending on Node and Browser or Framework SDKs)
71+
- name: npm
72+
id: "@sentry/nextjs"
73+
includeNames: /^sentry-nextjs-\d.*\.tgz$/
74+
- name: npm
75+
id: "@sentry/remix"
76+
includeNames: /^sentry-remix-\d.*\.tgz$/
77+
- name: npm
78+
id: "@sentry/sveltekit"
79+
includeNames: /^sentry-sveltekit-\d.*\.tgz$/
80+
- name: npm
81+
id: "@sentry/gatsby"
82+
includeNames: /^sentry-gatsby-\d.*\.tgz$/
83+
84+
## 6. Other Packages
85+
## 6.1
86+
- name: npm
87+
id: "@sentry-internal/typescript"
88+
includeNames: /^sentry-internal-typescript-\d.*\.tgz$/
89+
- name: npm
90+
id: "@sentry-internal/eslint-plugin-sdk"
91+
includeNames: /^sentry-internal-eslint-plugin-sdk-\d.*\.tgz$/
92+
## 6.2
93+
- name: npm
94+
id: "@sentry-internal/eslint-config-sdk"
95+
includeNames: /^sentry-internal-eslint-config-sdk-\d.*\.tgz$/
96+
97+
## 7. Deprecated packages we still release (but no packages depend on them anymore)
98+
- name: npm
99+
id: "@sentry/hub"
100+
includeNames: /^sentry-hub-\d.*\.tgz$/
101+
- name: npm
102+
id: "@sentry/tracing"
103+
includeNames: /^sentry-tracing-\d.*\.tgz$/
104+
105+
# AWS Lambda Layer target
5106
- name: aws-lambda-layer
6107
includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha)\.\d+)?\.zip$/
7108
layerName: SentryNodeServerlessSDK
@@ -14,16 +115,22 @@ targets:
14115
- nodejs16.x
15116
- nodejs18.x
16117
license: MIT
118+
119+
# CDN Bundle Target
17120
- name: gcs
121+
id: "browser-cdn-bundles"
18122
includeNames: /.*\.js.*$/
19123
bucket: sentry-js-sdk
20124
paths:
21125
- path: /{{version}}/
22126
metadata:
23127
cacheControl: 'public, max-age=31536000'
128+
129+
# Github Release Target
24130
- name: github
25131
includeNames: /^sentry-.*$/
26-
- name: npm
132+
133+
# Sentry Release Registry Target
27134
- name: registry
28135
sdks:
29136
'npm:@sentry/browser':

CHANGELOG.md

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

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

7+
## 7.59.3
8+
9+
- fix(browser): 0 is a valid index (#8581)
10+
- fix(nextjs): Ensure Webpack plugin is available after dynamic require (#8584)
11+
- types(browser): Add browser profiling client options (#8565)
12+
713
## 7.59.2
814

915
No changes. This release was published to fix publishing issues with 7.59.0 and 7.59.1.

docs/new-sdk-release-checklist.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ When you’re ready to make the first release, there are a couple of steps that
5858
- [ ] 1) If not yet done, be sure to remove the `private: true` property from your SDK’s `package.json`. Additionally, ensure that `"publishConfig": {"access": "public"}` is set.
5959
- [ ] 2) Make sure that the new SDK is **not added** in`[craft.yml](https://github.com/getsentry/sentry-javascript/blob/master/.craft.yml)` as a target for the **Sentry release registry**\
6060
*Once this is added, craft will try to publish an entry in the next release which does not work and caused failed release runs in the past*
61-
- [ ] 3) Make sure the new SDK is not excluded from the github & npm targets in `.craft.yml`
62-
- [ ] 4) Cut a new release (as usual, via GH release action and Craft)
61+
- [ ] 3) Add an `npm` target in `craft.yml` for the new package. Make sure to insert it in the right place, after all the Sentry dependencies of your package but before packages that depend on your new package (if applicable).
62+
```yml
63+
- name: npm
64+
id: npm:@sentry/[yourPackage]
65+
includeNames: /^sentry-[yourPackage]-\d.*\.tgz$/
66+
```
67+
- [ ] 4) Cut a new release (as usual, see [Publishing Release](https://github.com/getsentry/sentry-javascript/blob/develop/docs/publishing-a-release.md))
6368
6469
### After the Release
6570

packages/browser/src/client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Scope } from '@sentry/core';
22
import { BaseClient, SDK_VERSION } from '@sentry/core';
33
import type {
4+
BrowserClientProfilingOptions,
45
BrowserClientReplayOptions,
56
ClientOptions,
67
Event,
@@ -23,7 +24,9 @@ import { createUserFeedbackEnvelope } from './userfeedback';
2324
* Configuration options for the Sentry Browser SDK.
2425
* @see @sentry/types Options for more information.
2526
*/
26-
export type BrowserOptions = Options<BrowserTransportOptions> & BrowserClientReplayOptions;
27+
export type BrowserOptions = Options<BrowserTransportOptions> &
28+
BrowserClientReplayOptions &
29+
BrowserClientProfilingOptions;
2730

2831
/**
2932
* Configuration options for the Sentry Browser SDK Client class

packages/browser/src/profiling/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ export function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): Profi
249249
if (profile.frames[stackTop.frameId] === undefined) {
250250
profile.frames[stackTop.frameId] = {
251251
function: frame.name,
252-
file: frame.resourceId ? input.resources[frame.resourceId] : undefined,
253-
line: frame.line,
254-
column: frame.column,
252+
abs_path: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined,
253+
lineno: frame.line,
254+
colno: frame.column,
255255
};
256256
}
257257

packages/core/test/lib/transports/offline.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ describe('makeOfflineTransport', () => {
326326
expect(getCalls()).toEqual([]);
327327
});
328328

329+
// eslint-disable-next-line jest/no-disabled-tests
329330
it.skip(
330331
'Follows the Retry-After header',
331332
async () => {

packages/eslint-config-sdk/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"eslint-config-prettier": "^6.11.0",
2727
"eslint-plugin-deprecation": "^1.1.0",
2828
"eslint-plugin-import": "^2.22.0",
29+
"eslint-plugin-jest": "^27.2.2",
2930
"eslint-plugin-jsdoc": "^30.0.3",
3031
"eslint-plugin-simple-import-sort": "^5.0.3"
3132
},

packages/eslint-config-sdk/src/index.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ module.exports = {
167167
},
168168
},
169169
{
170-
// Configuration for test files
170+
// Configuration for files in test directories
171171
env: {
172172
jest: true,
173173
},
@@ -186,6 +186,24 @@ module.exports = {
186186
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
187187
},
188188
},
189+
{
190+
// Configuration only for test files (this won't apply to utils or other files in test directories)
191+
plugins: ['jest'],
192+
env: {
193+
jest: true,
194+
},
195+
files: ['test.ts', '*.test.ts', '*.test.tsx', '*.test.js', '*.test.jsx'],
196+
rules: {
197+
// Prevent permanent usage of `it.only`, `fit`, `test.only` etc
198+
// We want to avoid debugging leftovers making their way into the codebase
199+
'jest/no-focused-tests': 'error',
200+
201+
// Prevent permanent usage of `it.skip`, `xit`, `test.skip` etc
202+
// We want to avoid debugging leftovers making their way into the codebase
203+
// If there's a good reason to skip a test (e.g. bad flakiness), just add an ignore comment
204+
'jest/no-disabled-tests': 'error',
205+
},
206+
},
189207
{
190208
// Configuration for config files like webpack/rollup
191209
files: ['*.config.js'],

packages/nextjs/src/config/webpack.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/* eslint-disable max-lines */
33
import { getSentryRelease } from '@sentry/node';
44
import { arrayify, dropUndefinedKeys, escapeStringForRegex, loadModule, logger } from '@sentry/utils';
5+
import type SentryCliPlugin from '@sentry/webpack-plugin';
56
import * as chalk from 'chalk';
67
import * as fs from 'fs';
78
import * as path from 'path';
@@ -312,15 +313,16 @@ export function constructWebpackConfigFunction(
312313
// without, the option to use `hidden-source-map` only applies to the client-side build.
313314
newConfig.devtool = userSentryOptions.hideSourceMaps && !isServer ? 'hidden-source-map' : 'source-map';
314315

315-
const SentryWebpackPlugin = loadModule('@sentry/webpack-plugin');
316-
317-
newConfig.plugins = newConfig.plugins || [];
318-
newConfig.plugins.push(
319-
// @ts-expect-error - this exists, the dynamic import just doesn't know about it
320-
new SentryWebpackPlugin(
321-
getWebpackPluginOptions(buildContext, userSentryWebpackPluginOptions, userSentryOptions),
322-
),
323-
);
316+
const SentryWebpackPlugin = loadModule<SentryCliPlugin>('@sentry/webpack-plugin');
317+
if (SentryWebpackPlugin) {
318+
newConfig.plugins = newConfig.plugins || [];
319+
newConfig.plugins.push(
320+
// @ts-expect-error - this exists, the dynamic import just doesn't know about it
321+
new SentryWebpackPlugin(
322+
getWebpackPluginOptions(buildContext, userSentryWebpackPluginOptions, userSentryOptions),
323+
),
324+
);
325+
}
324326
}
325327
}
326328

@@ -769,10 +771,10 @@ function shouldEnableWebpackPlugin(buildContext: BuildContext, userSentryOptions
769771
// architecture-specific version of the `sentry-cli` binary. If `yarn install`, `npm install`, or `npm ci` are run
770772
// with the `--ignore-scripts` option, this will be blocked and the missing binary will cause an error when users
771773
// try to build their apps.
772-
const SentryWebpackPlugin = loadModule('@sentry/webpack-plugin');
774+
const SentryWebpackPlugin = loadModule<SentryCliPlugin>('@sentry/webpack-plugin');
773775

774776
// @ts-expect-error - this exists, the dynamic import just doesn't know it
775-
if (!SentryWebpackPlugin.cliBinaryExists()) {
777+
if (!SentryWebpackPlugin || !SentryWebpackPlugin.cliBinaryExists()) {
776778
// eslint-disable-next-line no-console
777779
console.error(
778780
`${chalk.red('error')} - ${chalk.bold('Sentry CLI binary not found.')} Source maps will not be uploaded.\n`,

packages/node/test/integrations/undici.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ conditionalTest({ min: 16 })('Undici integration', () => {
194194
});
195195

196196
// This flakes on CI for some reason: https://github.com/getsentry/sentry-javascript/pull/8449
197+
// eslint-disable-next-line jest/no-disabled-tests
197198
it.skip('attaches the sentry trace and baggage headers if there is an active span', async () => {
198199
expect.assertions(3);
199200

@@ -214,6 +215,7 @@ conditionalTest({ min: 16 })('Undici integration', () => {
214215
});
215216

216217
// This flakes on CI for some reason: https://github.com/getsentry/sentry-javascript/pull/8449
218+
// eslint-disable-next-line jest/no-disabled-tests
217219
it.skip('attaches the sentry trace and baggage headers if there is no active span', async () => {
218220
const scope = hub.getScope();
219221

@@ -228,6 +230,7 @@ conditionalTest({ min: 16 })('Undici integration', () => {
228230
});
229231

230232
// This flakes on CI for some reason: https://github.com/getsentry/sentry-javascript/pull/8449
233+
// eslint-disable-next-line jest/no-disabled-tests
231234
it.skip('attaches headers if `shouldCreateSpanForRequest` does not create a span using propagation context', async () => {
232235
const transaction = hub.startTransaction({ name: 'test-transaction' }) as Transaction;
233236
const scope = hub.getScope();
@@ -259,6 +262,7 @@ conditionalTest({ min: 16 })('Undici integration', () => {
259262
});
260263

261264
// This flakes on CI for some reason: https://github.com/getsentry/sentry-javascript/pull/8449
265+
// eslint-disable-next-line jest/no-disabled-tests
262266
it.skip('uses tracePropagationTargets', async () => {
263267
const transaction = hub.startTransaction({ name: 'test-transaction' }) as Transaction;
264268
hub.getScope().setSpan(transaction);

packages/types/src/browseroptions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,11 @@ export type BrowserClientReplayOptions = {
1616
*/
1717
replaysOnErrorSampleRate?: number;
1818
};
19+
20+
export type BrowserClientProfilingOptions = {
21+
/**
22+
* The sample rate for profiling
23+
* 1.0 will profile all transactions and 0 will profile none.
24+
*/
25+
profilesSampleRate?: number;
26+
};

packages/types/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,5 @@ export type { WrappedFunction } from './wrappedfunction';
115115
export type { Instrumenter } from './instrumenter';
116116
export type { HandlerDataFetch, HandlerDataXhr, SentryXhrData, SentryWrappedXMLHttpRequest } from './instrument';
117117

118-
export type { BrowserClientReplayOptions } from './browseroptions';
118+
export type { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './browseroptions';
119119
export type { CheckIn, MonitorConfig, SerializedCheckIn } from './checkin';

packages/types/src/profiling.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ export type ThreadCpuStack = FrameId[];
1414
export type ThreadCpuFrame = {
1515
function: string;
1616
file?: string;
17-
line?: number;
18-
column?: number;
17+
lineno?: number;
18+
colno?: number;
19+
abs_path?: string;
1920
};
2021

2122
export interface ThreadCpuProfile {

0 commit comments

Comments
 (0)