Skip to content

Commit 79f4767

Browse files
authored
Merge pull request #13135 from getsentry/prepare-release/8.22
meta: Update changelog for 8.22
2 parents 155a37c + 1f9fc26 commit 79f4767

File tree

83 files changed

+1268
-702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1268
-702
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,8 @@ jobs:
10461046
exclude:
10471047
- is_dependabot: true
10481048
test-application: 'cloudflare-astro'
1049+
- is_dependabot: true
1050+
test-application: 'cloudflare-workers'
10491051

10501052
steps:
10511053
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
@@ -1125,6 +1127,7 @@ jobs:
11251127
test-application:
11261128
[
11271129
'cloudflare-astro',
1130+
'cloudflare-workers',
11281131
'react-send-to-sentry',
11291132
'node-express-send-to-sentry',
11301133
'debug-id-sourcemaps',

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ module.exports = [
149149
name: 'CDN Bundle (incl. Tracing, Replay)',
150150
path: createCDNPath('bundle.tracing.replay.min.js'),
151151
gzip: true,
152-
limit: '72 KB',
152+
limit: '73 KB',
153153
},
154154
{
155155
name: 'CDN Bundle (incl. Tracing, Replay, Feedback)',

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,36 @@
99

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

12+
# 8.22.0
13+
14+
### Important Changes
15+
16+
- **feat(cloudflare): Add plugin for cloudflare pages (#13123)**
17+
18+
This release adds support for Cloudflare Pages to `@sentry/cloudflare`, our SDK for the
19+
[Cloudflare Workers JavaScript Runtime](https://developers.cloudflare.com/workers/)! For details on how to use it,
20+
please see the [README](./packages/cloudflare/README.md). Any feedback/bug reports are greatly appreciated, please
21+
[reach out on GitHub](https://github.com/getsentry/sentry-javascript/issues/12620).
22+
23+
```javascript
24+
// functions/_middleware.js
25+
import * as Sentry from '@sentry/cloudflare';
26+
27+
export const onRequest = Sentry.sentryPagesPlugin({
28+
dsn: __PUBLIC_DSN__,
29+
// Set tracesSampleRate to 1.0 to capture 100% of spans for tracing.
30+
tracesSampleRate: 1.0,
31+
});
32+
```
33+
34+
### Other Changes
35+
36+
- feat(meta-sdks): Remove runtime tags (#13105)
37+
- feat(nestjs): Automatic instrumentation of nestjs guards (#13129)
38+
- feat(nestjs): Filter all HttpExceptions (#13120)
39+
- feat(replay): Capture exception when `internal_sdk_error` client report happens (#13072)
40+
- fix: Use `globalThis` for code injection (#13132)
41+
1242
## 8.21.0
1343

1444
### Important Changes

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export const expectedLCPPerformanceSpan = {
127127
endTimestamp: expect.any(Number),
128128
data: {
129129
value: expect.any(Number),
130-
nodeId: expect.any(Number),
130+
nodeIds: expect.any(Array),
131131
rating: expect.any(String),
132132
size: expect.any(Number),
133133
},
@@ -140,6 +140,7 @@ export const expectedCLSPerformanceSpan = {
140140
endTimestamp: expect.any(Number),
141141
data: {
142142
value: expect.any(Number),
143+
nodeIds: expect.any(Array),
143144
rating: expect.any(String),
144145
size: expect.any(Number),
145146
},
@@ -154,7 +155,7 @@ export const expectedFIDPerformanceSpan = {
154155
value: expect.any(Number),
155156
rating: expect.any(String),
156157
size: expect.any(Number),
157-
nodeId: expect.any(Number),
158+
nodeIds: expect.any(Array),
158159
},
159160
};
160161

@@ -167,7 +168,7 @@ export const expectedINPPerformanceSpan = {
167168
value: expect.any(Number),
168169
rating: expect.any(String),
169170
size: expect.any(Number),
170-
nodeId: expect.any(Number),
171+
nodeIds: expect.any(Array),
171172
},
172173
};
173174

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 140,
3+
"singleQuote": true,
4+
"semi": true,
5+
"useTabs": true
6+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "cloudflare-workers",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"deploy": "wrangler deploy",
7+
"dev": "wrangler dev --var E2E_TEST_DSN=$E2E_TEST_DSN",
8+
"build": "wrangler deploy --dry-run --var E2E_TEST_DSN=$E2E_TEST_DSN",
9+
"test": "vitest",
10+
"typecheck": "tsc --noEmit",
11+
"cf-typegen": "wrangler types",
12+
"test:build": "pnpm install && pnpm build",
13+
"test:assert": "pnpm typecheck"
14+
},
15+
"dependencies": {
16+
"@sentry/cloudflare": "latest || *"
17+
},
18+
"devDependencies": {
19+
"@cloudflare/vitest-pool-workers": "^0.4.5",
20+
"@cloudflare/workers-types": "^4.20240725.0",
21+
"typescript": "^5.5.2",
22+
"vitest": "1.5.0",
23+
"wrangler": "^3.60.3"
24+
},
25+
"volta": {
26+
"extends": "../../package.json"
27+
}
28+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Welcome to Cloudflare Workers! This is your first worker.
3+
*
4+
* - Run `npm run dev` in your terminal to start a development server
5+
* - Open a browser tab at http://localhost:8787/ to see your worker in action
6+
* - Run `npm run deploy` to publish your worker
7+
*
8+
* Bind resources to your worker in `wrangler.toml`. After adding bindings, a type definition for the
9+
* `Env` object can be regenerated with `npm run cf-typegen`.
10+
*
11+
* Learn more at https://developers.cloudflare.com/workers/
12+
*/
13+
import * as Sentry from '@sentry/cloudflare';
14+
15+
export default Sentry.withSentry(
16+
(env: Env) => ({
17+
dsn: env.E2E_TEST_DSN,
18+
// Set tracesSampleRate to 1.0 to capture 100% of spans for tracing.
19+
tracesSampleRate: 1.0,
20+
}),
21+
{
22+
async fetch(request, env, ctx) {
23+
return new Response('Hello World!');
24+
},
25+
} satisfies ExportedHandler<Env>,
26+
);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { describe, expect, it } from 'vitest';
2+
import worker from '../src/index';
3+
// test/index.spec.ts
4+
import { SELF, createExecutionContext, env, waitOnExecutionContext } from 'cloudflare:test';
5+
6+
// For now, you'll need to do something like this to get a correctly-typed
7+
// `Request` to pass to `worker.fetch()`.
8+
const IncomingRequest = Request<unknown, IncomingRequestCfProperties>;
9+
10+
describe('Hello World worker', () => {
11+
it('responds with Hello World! (unit style)', async () => {
12+
const request = new IncomingRequest('http://example.com');
13+
// Create an empty context to pass to `worker.fetch()`.
14+
const ctx = createExecutionContext();
15+
const response = await worker.fetch(request, env, ctx);
16+
// Wait for all `Promise`s passed to `ctx.waitUntil()` to settle before running test assertions
17+
await waitOnExecutionContext(ctx);
18+
expect(await response.text()).toMatchInlineSnapshot(`"Hello World!"`);
19+
});
20+
21+
it('responds with Hello World! (integration style)', async () => {
22+
const response = await SELF.fetch('https://example.com');
23+
expect(await response.text()).toMatchInlineSnapshot(`"Hello World!"`);
24+
});
25+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"types": ["@cloudflare/workers-types/experimental", "@cloudflare/vitest-pool-workers"]
5+
},
6+
"include": ["./**/*.ts", "../src/env.d.ts"],
7+
"exclude": []
8+
}

0 commit comments

Comments
 (0)