Skip to content

Commit cc8f6a5

Browse files
author
Luca Forstner
authored
Merge branch 'develop' into fn/e2e-tests
2 parents f149db9 + ccd5f27 commit cc8f6a5

File tree

474 files changed

+22664
-3740
lines changed

Some content is hidden

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

474 files changed

+22664
-3740
lines changed

.craft.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ targets:
1111
- nodejs10.x
1212
- nodejs12.x
1313
- nodejs14.x
14+
- nodejs16.x
15+
- nodejs18.x
1416
license: MIT
1517
- name: gcs
1618
includeNames: /.*\.js.*$/
@@ -22,7 +24,6 @@ targets:
2224
- name: github
2325
includeNames: /^sentry-.*$/
2426
- name: npm
25-
excludeNames: /^sentry-sveltekit-.*$/
2627
- name: registry
2728
sdks:
2829
'npm:@sentry/browser':

.github/codeql/codeql-config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
paths-ignore:
2+
# Our tsconfig files contain comments, which CodeQL complains about
3+
- '**/tsconfig.json'
4+
- '**/tsconfig.*.json'

.github/workflows/build.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,10 @@ jobs:
321321
uses: ./.github/actions/restore-cache
322322
env:
323323
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
324-
- name: Run linter
324+
- name: Lint source files
325325
run: yarn lint
326+
- name: Validate ES5 builds
327+
run: yarn validate:es5
326328

327329
job_circular_dep_check:
328330
name: Circular Dependency Check
@@ -369,7 +371,6 @@ jobs:
369371
path: |
370372
${{ github.workspace }}/packages/browser/build/bundles/**
371373
${{ github.workspace }}/packages/integrations/build/bundles/**
372-
${{ github.workspace }}/packages/tracing/build/bundles/**
373374
${{ github.workspace }}/packages/replay/build/bundles/**
374375
${{ github.workspace }}/packages/**/*.tgz
375376
@@ -480,7 +481,7 @@ jobs:
480481
yarn test:integration
481482
482483
job_browser_playwright_tests:
483-
name: Playwright (${{ matrix.bundle }})${{ (matrix.tracing_only && ' tracing only') || '' }} Tests
484+
name: Playwright (${{ matrix.bundle }}) Tests
484485
needs: [job_get_metadata, job_build]
485486
if: needs.job_get_metadata.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
486487
runs-on: ubuntu-20.04
@@ -497,16 +498,13 @@ jobs:
497498
- bundle_es6_min
498499
- bundle_replay_es6
499500
- bundle_replay_es6_min
500-
tracing_only:
501-
- true
502-
- false
503-
exclude:
504-
# `tracing_only` only makes a difference for bundles - tests of the esm and cjs builds always include the
505-
# tracing tests
506-
- bundle: esm
507-
tracing_only: false
508-
- bundle: cjs
509-
tracing_only: false
501+
- bundle_tracing_es5
502+
- bundle_tracing_es5_min
503+
- bundle_tracing_es6
504+
- bundle_tracing_es6_min
505+
- bundle_tracing_replay_es6
506+
- bundle_tracing_replay_es6_min
507+
510508
steps:
511509
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
512510
uses: actions/checkout@v3
@@ -541,7 +539,6 @@ jobs:
541539
- name: Run Playwright tests
542540
env:
543541
PW_BUNDLE: ${{ matrix.bundle }}
544-
PW_TRACING_ONLY: ${{ matrix.tracing_only }}
545542
run: |
546543
cd packages/browser-integration-tests
547544
yarn test:ci

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
- name: Initialize CodeQL
5151
uses: github/codeql-action/init@v2
5252
with:
53+
config-file: ./.github/codeql/codeql-config.yml
5354
languages: ${{ matrix.language }}
5455
# If you wish to specify custom queries, you can do so here or in a config file.
5556
# By default, queries listed here will override any specified in a config file.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: 'Detect flaky tests'
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
paths:
6+
- 'packages/browser-integration-tests/suites/**'
7+
8+
env:
9+
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
10+
11+
NX_CACHE_RESTORE_KEYS: |
12+
nx-Linux-${{ github.ref }}-${{ github.event.inputs.commit || github.sha }}
13+
nx-Linux-${{ github.ref }}
14+
nx-Linux
15+
16+
# Cancel in progress workflows on pull_requests.
17+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
flaky-detector:
24+
runs-on: ubuntu-20.04
25+
timeout-minutes: 60
26+
name: 'Check tests for flakiness'
27+
steps:
28+
- name: Check out current branch
29+
uses: actions/checkout@v3
30+
- name: Set up Node
31+
uses: volta-cli/action@v4
32+
33+
- name: Install dependencies
34+
run: yarn install --ignore-engines --frozen-lockfile
35+
36+
- name: NX cache
37+
uses: actions/cache/restore@v3
38+
with:
39+
path: .nxcache
40+
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT }}
41+
restore-keys: ${{ env.NX_CACHE_RESTORE_KEYS }}
42+
43+
- name: Build packages
44+
run: yarn build
45+
46+
- name: Get npm cache directory
47+
id: npm-cache-dir
48+
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
49+
- name: Get Playwright version
50+
id: playwright-version
51+
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
52+
- uses: actions/cache@v3
53+
name: Check if Playwright browser is cached
54+
id: playwright-cache
55+
with:
56+
path: ${{ steps.npm-cache-dir.outputs.dir }}
57+
key: ${{ runner.os }}-Playwright-${{steps.playwright-version.outputs.version}}
58+
- name: Install Playwright browser if not cached
59+
if: steps.playwright-cache.outputs.cache-hit != 'true'
60+
run: npx playwright install --with-deps
61+
env:
62+
PLAYWRIGHT_BROWSERS_PATH: ${{steps.npm-cache-dir.outputs.dir}}
63+
- name: Install OS dependencies of Playwright if cache hit
64+
if: steps.playwright-cache.outputs.cache-hit == 'true'
65+
run: npx playwright install-deps
66+
67+
- name: Determine changed tests
68+
uses: getsentry/[email protected]
69+
id: changed
70+
with:
71+
list-files: json
72+
filters: |
73+
browser_integration: packages/browser-integration-tests/suites/**
74+
75+
- name: Detect flaky tests
76+
run: yarn test:detect-flaky
77+
working-directory: packages/browser-integration-tests
78+
env:
79+
CHANGED_TEST_PATHS: ${{ steps.changed.outputs.browser_integration_files }}
80+
# Run 50 times when detecting changed test(s), else run all tests 5x
81+
TEST_RUN_COUNT: ${{ steps.changed.outputs.browser_integration == 'true' && 50 || 5 }}

.github/workflows/release-size-info.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,9 @@ jobs:
1717
name: 'Add size-limit info to release'
1818

1919
steps:
20-
# https://github.com/actions-ecosystem/action-regex-match
21-
- name: Extract version from ref
22-
uses: actions-ecosystem/action-regex-match@v2
23-
id: head_version
24-
with:
25-
# Parse version from head ref, which is refs/tags/<tag_name>
26-
text: ${{ env.GITHUB_REF }}
27-
regex: '^refs\/tags\/([\d.]+)$'
28-
2920
- name: Get version
3021
id: get_version
31-
run: echo "version=${{ github.event.inputs.version || steps.head_version.outputs.group1 }}" >> $GITHUB_OUTPUT
22+
run: echo "version=${{ github.event.inputs.version || github.event.release.tag_name }}" >> $GITHUB_OUTPUT
3223

3324
- name: Update Github Release
3425
if: steps.get_version.outputs.version != ''

.size-limit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ module.exports = [
5353
},
5454
{
5555
name: '@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified)',
56-
path: 'packages/tracing/build/bundles/bundle.tracing.es5.min.js',
56+
path: 'packages/browser/build/bundles/bundle.tracing.es5.min.js',
5757
gzip: true,
5858
limit: '37 KB',
5959
},
6060
{
6161
name: '@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified)',
62-
path: 'packages/tracing/build/bundles/bundle.tracing.min.js',
62+
path: 'packages/browser/build/bundles/bundle.tracing.min.js',
6363
gzip: true,
6464
limit: '35 KB',
6565
},
@@ -80,7 +80,7 @@ module.exports = [
8080
},
8181
{
8282
name: '@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified)',
83-
path: 'packages/tracing/build/bundles/bundle.tracing.replay.min.js',
83+
path: 'packages/browser/build/bundles/bundle.tracing.replay.min.js',
8484
gzip: true,
8585
limit: '80 KB',
8686
},

CHANGELOG.md

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

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

7+
## 7.45.0
8+
9+
- build(cdn): Ensure ES5 bundles do not use non-ES5 code (#7550)
10+
- feat(core): Add trace function (#7556)
11+
- feat(hub): Make scope always defined on the hub (#7551)
12+
- feat(replay): Add `replay_id` to transaction DSC (#7571)
13+
- feat(replay): Capture fetch body size for replay events (#7524)
14+
- feat(sveltekit): Add performance monitoring for client load (#7537)
15+
- feat(sveltekit): Add performance monitoring for server load (#7536)
16+
- feat(sveltekit): Add performance monitoring to Sveltekit server handle (#7532)
17+
- feat(sveltekit): Add SvelteKit routing instrumentation (#7565)
18+
- fix(browser): Ensure keepalive flag is correctly set for parallel requests (#7553)
19+
- fix(core): Ensure `ignoreErrors` only applies to error events (#7573)
20+
- fix(node): Consider tracing error handler for process exit (#7558)
21+
- fix(otel): Make sure we use correct hub on finish (#7577)
22+
- fix(react): Handle case where error.cause already defined (#7557)
23+
24+
## 7.44.2
25+
26+
- fix(cdn): Fix ES5 CDN bundles (#7544)
27+
28+
## 7.44.1
29+
30+
- ref(core): Move beforeEnvelope to client (#7527)
31+
32+
## 7.44.0
33+
34+
This release introduces the first alpha version of `@sentry/sveltekit`, our newest JavaScript SDK for Sveltekit. Check out the [README](./packages/sveltekit/README.md) for usage instructions and what to expect from this alpha release.
35+
36+
- feat(replay): Add `request_body_size` & `response_body_size` to fetch/xhr (#7407)
37+
- feat(replay): Add additional properties for UI clicks (#7395)
38+
- feat(replay): Reduce time limit before pausing a recording (#7356)
39+
- feat(replay): Upgrade `rrweb` and `rrweb-player` (#7508)
40+
- feat(replay): Use new afterSend hook to improve error linking (#7390)
41+
- feat(serverless): Publish lambda layer for Node 16/18 (#7483)
42+
- feat(sveltekit): Add wrapper for client load function (#7447)
43+
- feat(sveltekit): Add wrapper for server load function (#7416)
44+
- feat(sveltekit): Add server-side `handleError` wrapper (#7411)
45+
- feat(sveltekit): Introduce client-side `handleError` wrapper (#7406)
46+
- feat(sveltekit): Add SvelteKit client and server `init` functions (#7408)
47+
- feat(sveltekit): Inject `Sentry.init` calls into server and client bundles (#7391)
48+
- feat(tracing): Expose `BrowserTracing` in non-tracing bundles (#7479)
49+
- fix(core): Permanent idle timeout cancel finishes the transaction with the last finished child
50+
- fix(integrations): Handle lower-case prefix windows paths in `RewriteFrames` (#7506)
51+
- fix(next): Guard against missing serverSideProps (#7517)
52+
- fix(nextjs): Fix broken server component wrapping because of interrupted promise chain (#7456)
53+
- fix(nextjs): Fix runtime error for static pages (#7476)
54+
- fix(profiling): Catch sendProfile rejection (#7446)
55+
- fix(replay): Never capture file input changes (#7485)
56+
- fix(serverless): Explicitly export node package exports (#7457)
57+
- fix(vue): Do not depend on `window.location` for SSR environments (#7518)
58+
59+
60+
**Replay `rrweb` changes:**
61+
62+
`@sentry-internal/rrweb` was updated from 1.105.0 to 1.106.0:
63+
64+
- feat: Ensure password inputs are always masked ([#78](https://github.com/getsentry/rrweb/pull/78))
65+
- fix: Ensure text masking for updated attributes works ([#83](https://github.com/getsentry/rrweb/pull/83))
66+
- fix: Ensure unmaskTextSelector is used for masked attributes ([#81](https://github.com/getsentry/rrweb/pull/81))
67+
- fix: Mask <option> values for selects & radio/checkbox value ([#75](https://github.com/getsentry/rrweb/pull/75))
68+
69+
Work in this release contributed by @woochanleee and @baked-dev. Thank you for your contribution!
70+
771
## 7.43.0
872

973
- feat(nextjs): Run source map upload in Vercel develop and preview environments (#7436)

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
packages/replay @getsentry/replay-sdk
2+
packages/replay-worker @getsentry/replay-sdk
3+
packages/browser-integration-tests/suites/replay @getsentry/replay-sdk

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ Since we are using [`TypeScript`](https://www.typescriptlang.org/), you need to
3333
- `yarn build:dev:filter <name of npm package>`, which runs `yarn build:dev` only in projects relevant to the given package (so, for example, running `yarn build:dev:filter @sentry/react` will build the `react` package, all of its dependencies (`utils`, `core`, `browser`, etc), and all packages which depend on it (currently `gatsby` and `nextjs`))
3434
- `yarn build:dev:watch`, which runs `yarn build:dev` in watch mode (recommended)
3535

36+
37+
## Testing SDK Packages Locally
38+
39+
To test local versions of SDK packages, for instance in test projects, you have a couple of options:
40+
41+
* Use [`yarn link`](https://classic.yarnpkg.com/lang/en/docs/cli/link/) to symlink your package to the test project.
42+
* Use [`yalc` to install SDK packages](./docs/using-yalc.md) as if they were already published.
43+
* Run `build:tarball` in the repo and `yarn add ./path/to/tarball.tgz` in the project.
44+
3645
## Adding Tests
3746

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

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@ faster, so we can get back to enjoying technology. If you want to join us
1818
This is the next line of Sentry JavaScript SDKs, comprised in the `@sentry/` namespace. It will provide a more
1919
convenient interface and improved consistency between various JavaScript environments.
2020

21-
---
22-
23-
**Sentry is Hiring!!!**
24-
25-
Would you like to work on Open Source software and help maintain this repository? Apply today:
26-
https://boards.greenhouse.io/sentry.
27-
28-
---
29-
3021
## Links
3122

3223
- [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/quickstart/)

docs/new-sdk-release-checklist.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ This page serves as a checklist of what to do when releasing a new SDK for the f
4444
- **This is especially important, if you're adding new CDN bundles!**
4545
- Tarballs (*.tgz archives) should work OOTB
4646

47+
48+
- [ ] Make sure it is added to `bundlePlugins.ts:makeTSPlugin` as `paths`, otherwise it will not be ES5 transpiled correctly for CDN builds.
49+
4750
## Cutting the Release
4851

4952
When you’re ready to make the first release, there are a couple of steps that need to be performed in the **correct order**. Note that you can prepare the PRs at any time but the **merging oder** is important:

docs/using-yalc.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Using `yalc` for Local SDK Testing
2+
3+
[Yalc](https://github.com/wclr/yalc) is a simple local dependency repository which we can use to work with local versions of our SDKs.
4+
This is a good alternative to `npm|yarn link` for packages where linking is problematic (e.g. SvelteKit or Angular).
5+
6+
Here's how to set up and use yalc:
7+
8+
## Installing `yalc`
9+
10+
Either install yalc globally,
11+
12+
```sh
13+
npm install -g yalc
14+
15+
yarn global add yalc
16+
```
17+
18+
or add it to your desired test projects (same command without the `-g|global` flags)
19+
20+
## Registering/Updating packages
21+
22+
Whenever you want to make your local changes available to your test projects (e.g. after a local code change), run:
23+
24+
```sh
25+
yarn yalc:publish
26+
```
27+
28+
If you run this command in the root of the repo, this will publish all SDK packages to the local yalc repo. If you run it in a specific SDK package, it will just publish this package. You **don't need to** call `yalc update` in your test project. Already linked test projects will be update automatically.
29+
30+
## Using yalc packages
31+
32+
In your test project, run
33+
34+
```sh
35+
yalc add @sentry/browser #or any other SDK package
36+
```
37+
38+
to add the local SDK package to your project.
39+
40+
**Important:** You need to `yalc add` the dependencies of the SDK package as well (e.g. core, utils, types, etc.).
41+
42+
## Troubleshooting:
43+
44+
### My changes are not applied to the test project
45+
46+
Did you run `yarn build && yarn publish:yalc` after making your changes?
47+
48+
### My test project uses Vite and I still don't see changes
49+
50+
Vite pre-bundles and caches dependencies for dev builds. It [doesn't recognize changes in yalc packages though](https://github.com/wclr/yalc/issues/189) :( To make these changes show up anyway, run `vite dev --force`.
51+

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3-
"version": "7.43.0",
3+
"version": "7.45.0",
44
"npmClient": "yarn",
55
"useWorkspaces": true
66
}

0 commit comments

Comments
 (0)