Skip to content

Commit d5a5009

Browse files
authored
Merge pull request #18166 from getsentry/prepare-release/10.25.0
meta(changelog): Update changelog for 10.25.0
2 parents d01b2a6 + a730d96 commit d5a5009

File tree

39 files changed

+843
-188
lines changed

39 files changed

+843
-188
lines changed

.size-limit.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ module.exports = [
55
// Browser SDK (ESM)
66
{
77
name: '@sentry/browser',
8-
path: 'packages/browser/build/npm/esm/index.js',
8+
path: 'packages/browser/build/npm/esm/prod/index.js',
99
import: createImport('init'),
1010
gzip: true,
1111
limit: '25 KB',
1212
},
1313
{
1414
name: '@sentry/browser - with treeshaking flags',
15-
path: 'packages/browser/build/npm/esm/index.js',
15+
path: 'packages/browser/build/npm/esm/prod/index.js',
1616
import: createImport('init'),
1717
gzip: true,
1818
limit: '24.1 KB',
@@ -35,28 +35,28 @@ module.exports = [
3535
},
3636
{
3737
name: '@sentry/browser (incl. Tracing)',
38-
path: 'packages/browser/build/npm/esm/index.js',
38+
path: 'packages/browser/build/npm/esm/prod/index.js',
3939
import: createImport('init', 'browserTracingIntegration'),
4040
gzip: true,
4141
limit: '41.3 KB',
4242
},
4343
{
4444
name: '@sentry/browser (incl. Tracing, Profiling)',
45-
path: 'packages/browser/build/npm/esm/index.js',
45+
path: 'packages/browser/build/npm/esm/prod/index.js',
4646
import: createImport('init', 'browserTracingIntegration', 'browserProfilingIntegration'),
4747
gzip: true,
4848
limit: '48 KB',
4949
},
5050
{
5151
name: '@sentry/browser (incl. Tracing, Replay)',
52-
path: 'packages/browser/build/npm/esm/index.js',
52+
path: 'packages/browser/build/npm/esm/prod/index.js',
5353
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
5454
gzip: true,
5555
limit: '80 KB',
5656
},
5757
{
5858
name: '@sentry/browser (incl. Tracing, Replay) - with treeshaking flags',
59-
path: 'packages/browser/build/npm/esm/index.js',
59+
path: 'packages/browser/build/npm/esm/prod/index.js',
6060
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
6161
gzip: true,
6262
limit: '75 KB',
@@ -79,35 +79,35 @@ module.exports = [
7979
},
8080
{
8181
name: '@sentry/browser (incl. Tracing, Replay with Canvas)',
82-
path: 'packages/browser/build/npm/esm/index.js',
82+
path: 'packages/browser/build/npm/esm/prod/index.js',
8383
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'replayCanvasIntegration'),
8484
gzip: true,
8585
limit: '85 KB',
8686
},
8787
{
8888
name: '@sentry/browser (incl. Tracing, Replay, Feedback)',
89-
path: 'packages/browser/build/npm/esm/index.js',
89+
path: 'packages/browser/build/npm/esm/prod/index.js',
9090
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'feedbackIntegration'),
9191
gzip: true,
9292
limit: '97 KB',
9393
},
9494
{
9595
name: '@sentry/browser (incl. Feedback)',
96-
path: 'packages/browser/build/npm/esm/index.js',
96+
path: 'packages/browser/build/npm/esm/prod/index.js',
9797
import: createImport('init', 'feedbackIntegration'),
9898
gzip: true,
9999
limit: '42 KB',
100100
},
101101
{
102102
name: '@sentry/browser (incl. sendFeedback)',
103-
path: 'packages/browser/build/npm/esm/index.js',
103+
path: 'packages/browser/build/npm/esm/prod/index.js',
104104
import: createImport('init', 'sendFeedback'),
105105
gzip: true,
106106
limit: '30 KB',
107107
},
108108
{
109109
name: '@sentry/browser (incl. FeedbackAsync)',
110-
path: 'packages/browser/build/npm/esm/index.js',
110+
path: 'packages/browser/build/npm/esm/prod/index.js',
111111
import: createImport('init', 'feedbackAsyncIntegration'),
112112
gzip: true,
113113
limit: '35 KB',

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+
## 10.25.0
8+
9+
- feat(browser): Include Spotlight in development bundles ([#18078](https://github.com/getsentry/sentry-javascript/pull/18078))
10+
- feat(cloudflare): Add metrics exports ([#18147](https://github.com/getsentry/sentry-javascript/pull/18147))
11+
- feat(core): Truncate request string inputs in OpenAI integration ([#18136](https://github.com/getsentry/sentry-javascript/pull/18136))
12+
- feat(metrics): Add missing metric node exports ([#18149](https://github.com/getsentry/sentry-javascript/pull/18149))
13+
- feat(node): Add `maxCacheKeyLength` to Redis integration (remove truncation) ([#18045](https://github.com/getsentry/sentry-javascript/pull/18045))
14+
- feat(vercel-edge): Add metrics export ([#18148](https://github.com/getsentry/sentry-javascript/pull/18148))
15+
- fix(core): Only consider exception mechanism when updating session status from event with exceptions ([#18137](https://github.com/getsentry/sentry-javascript/pull/18137))
16+
- ref(browser): Remove truncation when not needed ([#18051](https://github.com/getsentry/sentry-javascript/pull/18051))
17+
18+
<details>
19+
<summary> <strong>Internal Changes</strong> </summary>
20+
21+
- chore(build): Fix incorrect versions after merge ([#18154](https://github.com/getsentry/sentry-javascript/pull/18154))
22+
</details>
23+
724
## 10.24.0
825

926
### Important Changes

dev-packages/browser-integration-tests/utils/generatePlugin.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ const IMPORTED_INTEGRATION_CDN_BUNDLE_PATHS: Record<string, string> = {
4646

4747
const BUNDLE_PATHS: Record<string, Record<string, string>> = {
4848
browser: {
49-
cjs: 'build/npm/cjs/index.js',
50-
esm: 'build/npm/esm/index.js',
49+
cjs: 'build/npm/cjs/prod/index.js',
50+
esm: 'build/npm/esm/prod/index.js',
5151
bundle: 'build/bundles/bundle.js',
5252
bundle_min: 'build/bundles/bundle.min.js',
5353
bundle_replay: 'build/bundles/bundle.replay.js',
@@ -67,8 +67,8 @@ const BUNDLE_PATHS: Record<string, Record<string, string>> = {
6767
loader_tracing_replay: 'build/bundles/bundle.tracing.replay.debug.min.js',
6868
},
6969
integrations: {
70-
cjs: 'build/npm/cjs/index.js',
71-
esm: 'build/npm/esm/index.js',
70+
cjs: 'build/npm/cjs/prod/index.js',
71+
esm: 'build/npm/esm/prod/index.js',
7272
bundle: 'build/bundles/[INTEGRATION_NAME].js',
7373
bundle_min: 'build/bundles/[INTEGRATION_NAME].min.js',
7474
},
@@ -77,8 +77,8 @@ const BUNDLE_PATHS: Record<string, Record<string, string>> = {
7777
bundle_min: 'build/bundles/[INTEGRATION_NAME].min.js',
7878
},
7979
wasm: {
80-
cjs: 'build/npm/cjs/index.js',
81-
esm: 'build/npm/esm/index.js',
80+
cjs: 'build/npm/cjs/prod/index.js',
81+
esm: 'build/npm/esm/prod/index.js',
8282
bundle: 'build/bundles/wasm.js',
8383
bundle_min: 'build/bundles/wasm.min.js',
8484
},
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
extends: ['../../.eslintrc.js'],
3+
parserOptions: {
4+
sourceType: 'module',
5+
},
6+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<body>
4+
<script type="module" src="/index.js"></script>
5+
</body>
6+
</html>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { init } from '@sentry/browser';
2+
3+
init({
4+
dsn: 'https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000',
5+
});
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "@sentry-internal/bundler-tests",
3+
"version": "10.24.0",
4+
"description": "Bundler tests for Sentry Browser SDK",
5+
"repository": "git://github.com/getsentry/sentry-javascript.git",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/bundler-tests",
7+
"author": "Sentry",
8+
"license": "MIT",
9+
"private": true,
10+
"main": "./index.mjs",
11+
"scripts": {
12+
"test": "vitest run"
13+
},
14+
"dependencies": {
15+
"@sentry/browser": "10.24.0",
16+
"webpack": "^5.0.0",
17+
"rollup": "^4.0.0",
18+
"vite": "^5.0.0",
19+
"@rollup/plugin-node-resolve": "^15.2.3",
20+
"vitest": "^3.2.4"
21+
},
22+
"volta": {
23+
"extends": "../../package.json"
24+
},
25+
"type": "module"
26+
}
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
import { describe, expect, beforeAll, test } from 'vitest';
2+
import * as path from 'node:path';
3+
import * as fs from 'node:fs';
4+
import { fileURLToPath } from 'node:url';
5+
6+
import webpack from 'webpack';
7+
import { rollup } from 'rollup';
8+
import { build as viteBuild } from 'vite';
9+
import nodeResolve from '@rollup/plugin-node-resolve';
10+
11+
// Helper functions
12+
const __filename = fileURLToPath(import.meta.url);
13+
const __dirname = path.dirname(__filename);
14+
15+
function distDir(name: string): string {
16+
const dir = path.join(__dirname, '..', 'dist', name);
17+
if (!fs.existsSync(dir)) {
18+
fs.mkdirSync(dir, { recursive: true });
19+
}
20+
return dir;
21+
}
22+
23+
function rimraf(dir: string): void {
24+
if (fs.existsSync(dir)) {
25+
fs.rmSync(dir, { recursive: true, force: true });
26+
}
27+
}
28+
29+
function readAllJs(outDir: string): string {
30+
let contents = '';
31+
const stack = [outDir];
32+
while (stack.length) {
33+
const current = stack.pop()!;
34+
for (const entry of fs.readdirSync(current)) {
35+
const full = path.join(current, entry);
36+
const stat = fs.statSync(full);
37+
if (stat.isDirectory()) {
38+
stack.push(full);
39+
} else if (entry.endsWith('.js') || entry.endsWith('.mjs')) {
40+
contents += fs.readFileSync(full, 'utf8');
41+
}
42+
}
43+
}
44+
return contents;
45+
}
46+
47+
function fixtureEntry(name: string): string {
48+
return path.resolve(__dirname, '..', 'fixtures', name, 'index.js');
49+
}
50+
51+
function rootDir(): string {
52+
return path.join(__dirname, '../../..');
53+
}
54+
55+
const SPOTLIGHT_URL = 'localhost:8969';
56+
57+
type BundleMode = 'development' | 'production';
58+
59+
function bundleWithWebpack(mode: BundleMode): Promise<string> {
60+
return new Promise((resolve, reject) => {
61+
const outDir = distDir(`webpack-${mode}`);
62+
rimraf(outDir);
63+
const compiler = webpack({
64+
mode,
65+
entry: fixtureEntry('basic'),
66+
output: { path: outDir, filename: 'bundle.js' },
67+
});
68+
compiler?.run((err: Error | null | undefined, stats: webpack.Stats | undefined) => {
69+
try {
70+
if (err) throw err;
71+
if (stats?.hasErrors()) {
72+
throw new Error(stats.toString('errors-only'));
73+
}
74+
resolve(readAllJs(outDir));
75+
} catch (e) {
76+
reject(e);
77+
} finally {
78+
compiler.close(() => {});
79+
}
80+
});
81+
});
82+
}
83+
84+
async function bundleWithRollup(mode: BundleMode): Promise<string> {
85+
const outDir = distDir(`rollup-${mode}`);
86+
rimraf(outDir);
87+
88+
const bundle = await rollup({
89+
input: fixtureEntry('basic'),
90+
plugins: [
91+
nodeResolve({
92+
// There should really be a default where these get specified automatically
93+
exportConditions: [mode === 'production' ? 'production' : 'development'],
94+
}),
95+
],
96+
});
97+
await bundle.write({ dir: outDir, format: 'esm' });
98+
await bundle.close();
99+
return readAllJs(outDir);
100+
}
101+
102+
async function bundleWithVite(mode: BundleMode): Promise<string> {
103+
const outDir = distDir(`vite-${mode}`);
104+
rimraf(outDir);
105+
106+
// In Vitest, NODE_ENV is always 'test', so we need to override it here
107+
const prev = process.env.NODE_ENV;
108+
process.env.NODE_ENV = mode;
109+
110+
await viteBuild({
111+
mode,
112+
root: path.dirname(fixtureEntry('basic')),
113+
build: { outDir, minify: mode === 'production' },
114+
});
115+
116+
process.env.NODE_ENV = prev;
117+
118+
return readAllJs(outDir);
119+
}
120+
121+
describe('spotlight', () => {
122+
beforeAll(() => {
123+
const distRoot = path.join(rootDir(), 'dist');
124+
rimraf(distRoot);
125+
});
126+
127+
const cases: [string, (mode: BundleMode) => Promise<string>][] = [
128+
['webpack', bundleWithWebpack],
129+
['rollup', bundleWithRollup],
130+
['vite', bundleWithVite],
131+
];
132+
133+
for (const [name, bundler] of cases) {
134+
test(`${name} development bundle contains spotlight`, async () => {
135+
const code = await bundler('development');
136+
expect(code).toContain(SPOTLIGHT_URL);
137+
});
138+
139+
test(`${name} production bundle does not contain spotlight`, async () => {
140+
const code = await bundler('production');
141+
expect(code).not.toContain(SPOTLIGHT_URL);
142+
});
143+
}
144+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
export default defineConfig({
4+
test: {
5+
include: ['tests/**/*.test.*s'],
6+
timeout: 10000,
7+
hookTimeout: 10000,
8+
},
9+
});

dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ const DEPENDENTS: Dependent[] = [
4141
ignoreExports: [
4242
// Not needed for Astro
4343
'setupFastifyErrorHandler',
44-
// Todo(metrics): Add metrics exports for beta
45-
'metrics',
4644
],
4745
},
4846
{
@@ -56,8 +54,6 @@ const DEPENDENTS: Dependent[] = [
5654
'childProcessIntegration',
5755
'systemErrorIntegration',
5856
'pinoIntegration',
59-
// Todo(metrics): Add metrics exports for beta
60-
'metrics',
6157
],
6258
},
6359
{
@@ -79,8 +75,6 @@ const DEPENDENTS: Dependent[] = [
7975
ignoreExports: [
8076
// Not needed for Serverless
8177
'setupFastifyErrorHandler',
82-
// Todo(metrics): Add metrics exports for beta
83-
'metrics',
8478
],
8579
},
8680
{
@@ -90,8 +84,6 @@ const DEPENDENTS: Dependent[] = [
9084
ignoreExports: [
9185
// Not needed for Serverless
9286
'setupFastifyErrorHandler',
93-
// Todo(metrics): Add metrics exports for beta
94-
'metrics',
9587
],
9688
},
9789
{

0 commit comments

Comments
 (0)