Skip to content

Commit ca6b0bd

Browse files
authored
Merge branch 'develop' into ryan953/feedback-tests
2 parents 8b4dc2f + 70e942d commit ca6b0bd

File tree

175 files changed

+5832
-1032
lines changed

Some content is hidden

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

175 files changed

+5832
-1032
lines changed

.craft.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,28 +160,34 @@ targets:
160160
# Sentry Release Registry Target
161161
- name: registry
162162
sdks:
163+
'npm:@sentry/angular':
164+
onlyIfPresent: /^sentry-angular-\d.*\.tgz$/
165+
'npm:@sentry/astro':
166+
onlyIfPresent: /^sentry-astro-\d.*\.tgz$/
167+
'npm:@sentry/aws-serverless':
168+
onlyIfPresent: /^sentry-aws-serverless-\d.*\.tgz$/
163169
'npm:@sentry/browser':
164170
onlyIfPresent: /^sentry-browser-\d.*\.tgz$/
165171
includeNames: /\.js$/
166172
checksums:
167173
- algorithm: sha384
168174
format: base64
169-
'npm:@sentry/node':
170-
onlyIfPresent: /^sentry-node-\d.*\.tgz$/
171-
'npm:@sentry/react':
172-
onlyIfPresent: /^sentry-react-\d.*\.tgz$/
173-
'npm:@sentry/vue':
174-
onlyIfPresent: /^sentry-vue-\d.*\.tgz$/
175+
'npm:@sentry/bun':
176+
onlyIfPresent: /^sentry-bun-\d.*\.tgz$/
177+
'npm:@sentry/deno':
178+
onlyIfPresent: /^sentry-deno-\d.*\.tgz$/
179+
'npm:@sentry/ember':
180+
onlyIfPresent: /^sentry-ember-\d.*\.tgz$/
175181
'npm:@sentry/gatsby':
176182
onlyIfPresent: /^sentry-gatsby-\d.*\.tgz$/
177-
'npm:@sentry/angular':
178-
onlyIfPresent: /^sentry-angular-\d.*\.tgz$/
179-
'npm:@sentry/astro':
180-
onlyIfPresent: /^sentry-astro-\d.*\.tgz$/
181-
'npm:@sentry/wasm':
182-
onlyIfPresent: /^sentry-wasm-\d.*\.tgz$/
183+
'npm:@sentry/google-cloud-serverless':
184+
onlyIfPresent: /^sentry-google-cloud-serverless-\d.*\.tgz$/
183185
'npm:@sentry/nextjs':
184186
onlyIfPresent: /^sentry-nextjs-\d.*\.tgz$/
187+
'npm:@sentry/node':
188+
onlyIfPresent: /^sentry-node-\d.*\.tgz$/
189+
'npm:@sentry/react':
190+
onlyIfPresent: /^sentry-react-\d.*\.tgz$/
185191
'npm:@sentry/remix':
186192
onlyIfPresent: /^sentry-remix-\d.*\.tgz$/
187193
'npm:@sentry/solid':
@@ -190,9 +196,9 @@ targets:
190196
onlyIfPresent: /^sentry-svelte-\d.*\.tgz$/
191197
'npm:@sentry/sveltekit':
192198
onlyIfPresent: /^sentry-sveltekit-\d.*\.tgz$/
193-
'npm:@sentry/bun':
194-
onlyIfPresent: /^sentry-bun-\d.*\.tgz$/
195199
'npm:@sentry/vercel-edge':
196200
onlyIfPresent: /^sentry-vercel-edge-\d.*\.tgz$/
197-
'npm:@sentry/ember':
198-
onlyIfPresent: /^sentry-ember-\d.*\.tgz$/
201+
'npm:@sentry/vue':
202+
onlyIfPresent: /^sentry-vue-\d.*\.tgz$/
203+
'npm:@sentry/wasm':
204+
onlyIfPresent: /^sentry-wasm-\d.*\.tgz$/

.github/workflows/build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ jobs:
235235
runs-on: ubuntu-20.04
236236
if: |
237237
github.event_name == 'pull_request'
238-
&& (github.action == 'opened' || github.action == 'reopened')
238+
&& (github.event.action == 'opened' || github.event.action == 'reopened')
239239
&& github.event.pull_request.author_association != 'COLLABORATOR'
240240
&& github.event.pull_request.author_association != 'MEMBER'
241241
&& github.event.pull_request.author_association != 'OWNER'
@@ -1477,33 +1477,33 @@ jobs:
14771477
node: 22
14781478

14791479
# macos x64
1480-
- os: macos-11
1480+
- os: macos-13
14811481
node: 16
14821482
arch: x64
1483-
- os: macos-11
1483+
- os: macos-13
14841484
node: 18
14851485
arch: x64
1486-
- os: macos-11
1486+
- os: macos-13
14871487
node: 20
14881488
arch: x64
1489-
- os: macos-11
1489+
- os: macos-13
14901490
node: 22
14911491
arch: x64
14921492

14931493
# macos arm64
1494-
- os: macos-12
1494+
- os: macos-13
14951495
arch: arm64
14961496
node: 16
14971497
target_platform: darwin
1498-
- os: macos-12
1498+
- os: macos-13
14991499
arch: arm64
15001500
node: 18
15011501
target_platform: darwin
1502-
- os: macos-12
1502+
- os: macos-13
15031503
arch: arm64
15041504
node: 20
15051505
target_platform: darwin
1506-
- os: macos-12
1506+
- os: macos-13
15071507
arch: arm64
15081508
node: 22
15091509
target_platform: darwin

CHANGELOG.md

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

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

7+
## 8.11.0
8+
9+
### Important Changes
10+
11+
- **feat(core): Add `parentSpan` option to `startSpan*` APIs (#12567)**
12+
13+
We've made it easier to create a span as a child of a specific span via the startSpan\* APIs. This should allow you to
14+
explicitly manage the parent-child relationship of your spans better.
15+
16+
```js
17+
Sentry.startSpan({ name: 'root' }, parent => {
18+
const span = Sentry.startInactiveSpan({ name: 'xxx', parentSpan: parent });
19+
20+
Sentry.startSpan({ name: 'xxx', parentSpan: parent }, () => {});
21+
22+
Sentry.startSpanManual({ name: 'xxx', parentSpan: parent }, () => {});
23+
});
24+
```
25+
26+
### Other Changes
27+
28+
- feat(node): Detect release from more providers (#12529)
29+
- fix(profiling-node): Use correct getGlobalScope import (#12564)
30+
- fix(profiling-node) sample timestamps need to be in seconds (#12563)
31+
- ref: Align `@sentry/node` exports from framework SDKs. (#12589)
32+
33+
## 8.10.0
34+
35+
### Important Changes
36+
37+
- **feat(remix): Migrate to `opentelemetry-instrumentation-remix`. (#12110)**
38+
39+
You can now simplify your remix instrumentation by opting-in like this:
40+
41+
```js
42+
const Sentry = require('@sentry/remix');
43+
44+
Sentry.init({
45+
dsn: YOUR_DSN
46+
// opt-in to new auto instrumentation
47+
autoInstrumentRemix: true,
48+
});
49+
```
50+
51+
With this setup, you do not need to add e.g. `wrapExpressCreateRequestHandler` anymore. Additionally, the quality of the
52+
captured data improves. The old way to use `@sentry/remix` continues to work, but it is encouraged to use the new setup.
53+
54+
### Other Changes
55+
56+
- feat(browser): Export `thirdPartyErrorFilterIntegration` from `@sentry/browser` (#12512)
57+
- feat(feedback): Allow passing `tags` field to any feedback config param (#12197)
58+
- feat(feedback): Improve screenshot quality for retina displays (#12487)
59+
- feat(feedback): Screenshots don't resize after cropping (#12481)
60+
- feat(node) add max lineno and colno limits (#12514)
61+
- feat(profiling) add global profile context while profiler is running (#12394)
62+
- feat(react): Add React version to events (#12390)
63+
- feat(replay): Add url to replay hydration error breadcrumb type (#12521)
64+
- fix(core): Ensure standalone spans respect sampled flag (#12533)
65+
- fix(core): Use maxValueLength in extra error data integration (#12174)
66+
- fix(feedback): Fix scrolling after feedback submission (#12499)
67+
- fix(feedback): Send feedback rejects invalid responses (#12518)
68+
- fix(nextjs): Update @rollup/plugin-commonjs (#12527)
69+
- fix(node): Ensure status is correct for http server span errors (#12477)
70+
- fix(node): Unify`getDynamicSamplingContextFromSpan` (#12522)
71+
- fix(profiling): continuous profile chunks should be in seconds (#12532)
72+
- fix(remix): Add nativeFetch support for accessing request headers (#12479)
73+
- fix(remix): Export no-op as `captureRemixServerException` from client SDK (#12497)
74+
- ref(node) refactor contextlines to use readline (#12221)
75+
76+
Work in this release was contributed by @AndreyKovanov and @kiliman. Thank you for your contributions!
77+
778
## 8.9.2
879

980
- fix(profiling): Update exports so types generate properly (#12469)

CONTRIBUTING.md

Lines changed: 13 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@ To test local versions of SDK packages, for instance in test projects, you have
5858

5959
**Any nontrivial fixes/features should include tests.** You'll find a `test` folder in each package.
6060

61-
Note that _for the `browser` package only_, if you add a new file to the
62-
[integration test suite](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser/test/integration/suites),
63-
you also need to add it to
64-
[the list in `shell.js`](https://github.com/getsentry/sentry-javascript/blob/b74e199254147fd984e7bb1ea24193aee70afa74/packages/browser/test/integration/suites/shell.js#L25)
65-
as well. Adding tests to existing files will work out of the box in all packages.
61+
For browser related changes, you may also add tests in `dev-packages/browser-integration-tests`. Similarly, for node
62+
integration tests can be added in `dev-packages/node-integration-tests`. Finally, we also have E2E test apps in
63+
`dev-packages/e2e-tests`.
6664

6765
## Running Tests
6866

@@ -112,79 +110,25 @@ Similar to building and testing, linting can be done in the project root or in i
112110

113111
Note: you must run `yarn build` before `yarn lint` will work.
114112

115-
## Considerations Before Sending Your First PR
113+
## External Contributors
116114

117-
When contributing to the codebase, please note:
118-
119-
- Make sure to follow the [Commit, Issue & PR guidelines](#commit-issue--pr-guidelines)
120-
- Non-trivial PRs will not be accepted without tests (see above).
121-
- Please do not bump version numbers yourself.
122-
- [`raven-js`](https://github.com/getsentry/sentry-javascript/tree/3.x/packages/raven-js) and
123-
[`raven-node`](https://github.com/getsentry/sentry-javascript/tree/3.x/packages/raven-node) are deprecated, and only
124-
bug and security fix PRs will be accepted targeting the
125-
[3.x branch](https://github.com/getsentry/sentry-javascript/tree/3.x). Any new features and improvements should be to
126-
our new SDKs (`browser`, `node`, and framework-specific packages like `react` and `nextjs`) and the packages which
127-
support them (`core`, `utils`, `integrations`, and the like).
128-
129-
## PR reviews
130-
131-
For feedback in PRs, we use the [LOGAF scale](https://blog.danlew.net/2020/04/15/the-logaf-scale/) to specify how
132-
important a comment is:
133-
134-
- `l`: low - nitpick. You may address this comment, but you don't have to.
135-
- `m`: medium - normal comment. Worth addressing and fixing.
136-
- `h`: high - Very important. We must not merge this PR without addressing this issue.
115+
We highly appreciate external contributions to the SDK. If you want to contribute something, you can just open a PR
116+
against `develop`.
137117

138-
You only need one approval from a maintainer to be able to merge. For some PRs, asking specific or multiple people for
139-
review might be adequate.
118+
The SDK team will check out your PR shortly!
140119

141-
Our different types of reviews:
120+
When contributing to the codebase, please note:
142121

143-
1. **LGTM without any comments.** You can merge immediately.
144-
2. **LGTM with low and medium comments.** The reviewer trusts you to resolve these comments yourself, and you don't need
145-
to wait for another approval.
146-
3. **Only comments.** You must address all the comments and need another review until you merge.
147-
4. **Request changes.** Only use if something critical is in the PR that absolutely must be addressed. We usually use
148-
`h` comments for that. When someone requests changes, the same person must approve the changes to allow merging. Use
149-
this sparingly.
122+
- Make sure to follow the [Commit, Issue & PR guidelines](./docs/commit-issue-pr-guidelines.md)
123+
- Non-trivial PRs will not be accepted without tests (see above).
150124

151125
## Commit, Issue & PR guidelines
152126

153-
### Commits
154-
155-
For commit messages, we use the format:
156-
157-
```
158-
<type>(<scope>): <subject> (<github-id>)
159-
```
160-
161-
For example: `feat(core): Set custom transaction source for event processors (#5722)`.
162-
163-
See [commit message format](https://develop.sentry.dev/commit-messages/#commit-message-format) for details.
164-
165-
The Github-ID can be left out until the PR is merged.
166-
167-
### Issues
168-
169-
Issues should at least be categorized by package, for example `package: Node`. Additional labels for categorization can
170-
be added, and the Sentry SDK team may also add further labels as needed.
171-
172-
### Pull Requests (PRs)
173-
174-
PRs are merged via `Squash and merge`. This means that all commits on the branch will be squashed into a single commit,
175-
and committed as such onto master.
176-
177-
- The PR name can generally follow the commit name (e.g.
178-
`feat(core): Set custom transaction source for event processors`)
179-
- Make sure to rebase the branch on `master` before squashing it
180-
- Make sure to update the commit message of the squashed branch to follow the commit guidelines - including the PR
181-
number
182-
183-
### Gitflow
127+
See [Commit, Issue & PR guidelines](./docs/commit-issue-pr-guidelines.md).
184128

185-
We use [Gitflow](https://docs.github.com/en/get-started/quickstart/github-flow) as a branching model.
129+
## PR Reviews
186130

187-
For more details, [see our Gitflow docs](./docs/gitflow.md).
131+
See [PR Reviews](./docs/pr-reviews.md).
188132

189133
## Publishing a Release
190134

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ convenient interface and improved consistency between various JavaScript environ
2828

2929
## Contents
3030

31-
- [Contributing](https://github.com/getsentry/sentry-javascript/blob/master/CONTRIBUTING.md)
31+
- [Contributing](https://github.com/getsentry/sentry-javascript/blob/develop/CONTRIBUTING.md)
3232
- [Supported Platforms](#supported-platforms)
3333
- [Installation and Usage](#installation-and-usage)
3434
- [Other Packages](#other-packages)
@@ -40,7 +40,6 @@ For each major JavaScript platform, there is a specific high-level SDK that prov
4040
package. Please refer to the README and instructions of those SDKs for more detailed information:
4141

4242
- [`@sentry/browser`](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser): SDK for Browsers
43-
- [`@sentry/bun`](https://github.com/getsentry/sentry-javascript/tree/master/packages/bun): SDK for Bun
4443
- [`@sentry/node`](https://github.com/getsentry/sentry-javascript/tree/master/packages/node): SDK for Node including
4544
integrations for Express
4645
- [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular): Browser SDK for
@@ -52,6 +51,7 @@ package. Please refer to the README and instructions of those SDKs for more deta
5251
- [`@sentry/sveltekit`](https://github.com/getsentry/sentry-javascript/tree/master/packages/sveltekit): SDK for
5352
SvelteKit
5453
- [`@sentry/vue`](https://github.com/getsentry/sentry-javascript/tree/master/packages/vue): Browser SDK for Vue
54+
- [`@sentry/solid`](https://github.com/getsentry/sentry-javascript/tree/master/packages/solid): Browser SDK for Solid
5555
- [`@sentry/gatsby`](https://github.com/getsentry/sentry-javascript/tree/master/packages/gatsby): SDK for Gatsby
5656
- [`@sentry/nextjs`](https://github.com/getsentry/sentry-javascript/tree/master/packages/nextjs): SDK for Next.js
5757
- [`@sentry/remix`](https://github.com/getsentry/sentry-javascript/tree/master/packages/remix): SDK for Remix
@@ -64,6 +64,13 @@ package. Please refer to the README and instructions of those SDKs for more deta
6464
native crashes
6565
- [`@sentry/capacitor`](https://github.com/getsentry/sentry-capacitor): SDK for Capacitor Apps and Ionic with support
6666
for native crashes
67+
- [`@sentry/bun`](https://github.com/getsentry/sentry-javascript/tree/master/packages/bun): SDK for Bun
68+
- [`@sentry/deno`](https://github.com/getsentry/sentry-javascript/tree/master/packages/deno): SDK for Deno
69+
70+
## Version Support Policy
71+
72+
The current version of the SDK is 8.x. Version 7.x of the SDK will continue to receive critical bugfixes until end
73+
of 2024.
6774

6875
## Installation and Usage
6976

@@ -77,14 +84,14 @@ yarn add @sentry/browser
7784
Setup and usage of these SDKs always follows the same principle.
7885

7986
```javascript
80-
import { init, captureMessage } from '@sentry/browser';
87+
import * as Sentry from '@sentry/browser';
8188

82-
init({
89+
Sentry.init({
8390
dsn: '__DSN__',
8491
// ...
8592
});
8693

87-
captureMessage('Hello, world!');
94+
Sentry.captureMessage('Hello, world!');
8895
```
8996

9097
## Other Packages
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
window.sentryOnLoad = function () {
2+
Sentry.init({});
3+
4+
window.__sentryLoaded = true;
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Sentry.forceLoad();
2+
3+
Sentry.captureException('Test exception');
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<script>
6+
window.Sentry = {_customThingOnSentry: 'customThingOnSentry' };
7+
</script>
8+
</head>
9+
<body></body>
10+
</html>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';
5+
6+
sentryTest('keeps data on window.Sentry intact', async ({ getLocalTestUrl, page }) => {
7+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
8+
return route.fulfill({
9+
status: 200,
10+
contentType: 'application/json',
11+
body: JSON.stringify({ id: 'test-id' }),
12+
});
13+
});
14+
15+
const url = await getLocalTestUrl({ testDir: __dirname });
16+
const req = await waitForErrorRequestOnUrl(page, url);
17+
18+
const eventData = envelopeRequestParser(req);
19+
20+
expect(eventData.message).toBe('Test exception');
21+
22+
const customThingy = await page.evaluate('window.Sentry._customThingOnSentry');
23+
expect(customThingy).toBe('customThingOnSentry');
24+
});

0 commit comments

Comments
 (0)