Skip to content

Commit d82b0a7

Browse files
committed
Merge branch 'master' into cmanallen/implement-scm-platform
2 parents 4cbd7d7 + 39f4fa5 commit d82b0a7

File tree

306 files changed

+5654
-6148
lines changed

Some content is hidden

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

306 files changed

+5654
-6148
lines changed

.agents/skills/sentry-security/references/serializer-patterns.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ class IssueAlertRuleSerializer(serializers.Serializer):
4040
1. If org has `allow_joinleave` flag → any team is allowed (user could join anyway)
4141
2. If user has `team:admin` scope → any team is allowed
4242
3. If user is a member of the target team → allowed
43-
4. If user is a member of the current owner's team → allowed (can reassign from their team)
44-
5. Otherwise → `ValidationError("You can only assign teams you are a member of")`
43+
4. Otherwise → `ValidationError("You can only assign teams you are a member of")`
4544

4645
### What to look for
4746

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ pyproject.toml @getsentry/owners-pytho
172172
vercel.json @getsentry/owners-js-build
173173
/.github/workflows/frontend.yml @getsentry/owners-js-build
174174
/.github/file-filters.yml @getsentry/owners-js-build
175-
babel.config.* @getsentry/owners-js-build
176175
build-utils/ @getsentry/owners-js-build
177176
eslint.config.ts @getsentry/owners-js-build
178177
jest-balance.json @getsentry/owners-js-build

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ updates:
1515
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups
1616
groups:
1717
# The name of the group, it will be used in PR titles and branch
18-
babel-dependencies:
18+
swc-dependencies:
1919
patterns:
20-
- '@babel/*'
20+
- '@swc/*'
2121
sentry-dependencies:
2222
patterns:
2323
- '@sentry/core'

.github/workflows/frontend.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,17 @@ jobs:
131131

132132
- uses: ./.github/actions/setup-node-pnpm
133133

134+
- name: jest transform cache
135+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
136+
with:
137+
path: |
138+
.cache/jest
139+
~/.cache/swc
140+
key: jest-cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'jest.config.ts') }}-${{ matrix.instance }}
141+
restore-keys: |
142+
jest-cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'jest.config.ts') }}-
143+
jest-cache-${{ runner.os }}-
144+
134145
- name: Download jest-balance.json
135146
id: download-artifact
136147
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11

.vercelignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
!src/sentry/locale/**
99
!build-utils
1010
!build-utils/**
11-
!babel.config.js
1211
!jest.config.js
1312
!now.json
1413
!package.json

eslint.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ export default typescript.config([
462462
'@sentry/no-flag-comments': 'error',
463463
'@sentry/no-static-translations': 'error',
464464
'@sentry/no-styled-shortcut': 'error',
465+
'@sentry/no-unnecessary-use-callback': 'error',
465466
},
466467
},
467468
{
@@ -757,7 +758,7 @@ export default typescript.config([
757758
plugins: {'@emotion': emotion},
758759
rules: {
759760
'@emotion/import-from-emotion': 'off', // Not needed, in v11 we import from @emotion/react
760-
'@emotion/jsx-import': 'off', // Not needed, handled by babel
761+
'@emotion/jsx-import': 'off', // Not needed, handled by swc
761762
'@emotion/no-vanilla': 'error',
762763
'@emotion/pkg-renaming': 'off', // Not needed, we have migrated to v11 and the old package names cannot be used anymore
763764
'@emotion/styled-import': 'error',

jest.config.snapshots.ts

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,47 @@
1-
import type {TransformOptions} from '@babel/core';
21
import type {Config} from '@jest/types';
2+
import type {Options as SwcOptions} from '@swc/core';
33

4-
const babelConfig: TransformOptions = {
5-
presets: [
6-
[
7-
'@babel/preset-react',
8-
{
4+
const swcConfig: SwcOptions = {
5+
isModule: true,
6+
module: {
7+
type: 'commonjs',
8+
},
9+
sourceMaps: 'inline',
10+
jsc: {
11+
target: 'esnext',
12+
parser: {
13+
syntax: 'typescript',
14+
tsx: true,
15+
dynamicImport: true,
16+
},
17+
transform: {
18+
react: {
919
runtime: 'automatic',
1020
importSource: '@emotion/react',
1121
},
12-
],
13-
[
14-
'@babel/preset-env',
15-
{
16-
useBuiltIns: 'usage',
17-
corejs: '3.41',
18-
targets: {
19-
node: 'current',
20-
},
21-
},
22-
],
23-
['@babel/preset-typescript', {allowDeclareFields: true, onlyRemoveTypeImports: true}],
24-
],
25-
plugins: [
26-
[
27-
'@emotion/babel-plugin',
28-
{
29-
sourceMap: false,
30-
},
31-
],
32-
],
22+
},
23+
experimental: {
24+
plugins: [
25+
['@swc-contrib/mut-cjs-exports', {}],
26+
[
27+
'@swc/plugin-emotion',
28+
{
29+
sourceMap: false,
30+
autoLabel: 'never',
31+
},
32+
],
33+
],
34+
},
35+
},
3336
};
3437

3538
/**
36-
* ESM packages that need to be transformed by babel-jest.
39+
* ESM packages that need to be transformed.
3740
*/
3841
const ESM_NODE_MODULES = ['screenfull', 'cbor2', 'nuqs', 'color'];
3942

4043
const config: Config.InitialOptions = {
44+
cacheDirectory: '.cache/jest-snapshots',
4145
// testEnvironment and testMatch are the core differences between this and the main config
4246
testEnvironment: 'node',
4347
testMatch: ['<rootDir>/static/**/*.snapshots.tsx'],
@@ -63,9 +67,7 @@ const config: Config.InitialOptions = {
6367
},
6468

6569
transform: {
66-
'^.+\\.jsx?$': ['babel-jest', babelConfig as any],
67-
'^.+\\.tsx?$': ['babel-jest', babelConfig as any],
68-
'^.+\\.mjs?$': ['babel-jest', babelConfig as any],
70+
'^.+\\.[mc]?[jt]sx?$': ['@swc/jest', swcConfig],
6971
},
7072
transformIgnorePatterns: [
7173
ESM_NODE_MODULES.length

jest.config.ts

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,32 @@ import {execFileSync} from 'node:child_process';
22
import path from 'node:path';
33
import process from 'node:process';
44

5-
import type {TransformOptions} from '@babel/core';
65
import type {Config} from '@jest/types';
6+
import type {Options as SwcOptions} from '@swc/core';
77

8-
const babelConfig: TransformOptions = {
9-
presets: [
10-
[
11-
'@babel/preset-react',
12-
{
8+
const swcConfig: SwcOptions = {
9+
isModule: true,
10+
module: {
11+
type: 'commonjs',
12+
},
13+
sourceMaps: 'inline',
14+
jsc: {
15+
target: 'esnext',
16+
parser: {
17+
syntax: 'typescript',
18+
tsx: true,
19+
dynamicImport: true,
20+
},
21+
transform: {
22+
react: {
1323
runtime: 'automatic',
1424
importSource: '@emotion/react',
1525
},
16-
],
17-
[
18-
'@babel/preset-env',
19-
{
20-
useBuiltIns: 'usage',
21-
corejs: '3.41',
22-
targets: {
23-
node: 'current',
24-
},
25-
},
26-
],
27-
// TODO: Remove allowDeclareFields when we upgrade to Babel 8
28-
['@babel/preset-typescript', {allowDeclareFields: true, onlyRemoveTypeImports: true}],
29-
],
30-
plugins: [
31-
[
32-
'@emotion/babel-plugin',
33-
{
34-
sourceMap: false,
35-
},
36-
],
37-
],
26+
},
27+
experimental: {
28+
plugins: [['@swc-contrib/mut-cjs-exports', {}]],
29+
},
30+
},
3831
};
3932

4033
const {
@@ -284,6 +277,7 @@ const ESM_NODE_MODULES = [
284277

285278
const config: Config.InitialOptions = {
286279
verbose: false,
280+
cacheDirectory: '.cache/jest',
287281
collectCoverageFrom: [
288282
'static/app/**/*.{js,jsx,ts,tsx}',
289283
'!static/app/**/*.spec.{js,jsx,ts,tsx}',
@@ -334,8 +328,7 @@ const config: Config.InitialOptions = {
334328
'<rootDir>/node_modules/reflux',
335329
],
336330
transform: {
337-
'^.+\\.jsx?$': ['babel-jest', babelConfig as any],
338-
'^.+\\.tsx?$': ['babel-jest', babelConfig as any],
331+
'^.+\\.[mc]?[jt]sx?$': ['@swc/jest', swcConfig],
339332
'^.+\\.pegjs?$': '<rootDir>/tests/js/jest-pegjs-transform.js',
340333
},
341334
transformIgnorePatterns: [

knip.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ const config: KnipConfig = {
7777
'tslib', // subdependency of many packages, declare the latest version
7878
'buffer', // rspack.ProvidePlugin, needs better knip plugin
7979
'process', // rspack.ProvidePlugin, needs better knip plugin
80-
'@babel/preset-env', // Still used in jest
81-
'@babel/preset-react', // Still used in jest
82-
'@babel/preset-typescript', // Still used in jest
83-
'@emotion/babel-plugin', // Still used in jest
8480
'odiff-bin', // raw binary consumed by Python backend, not a JS import
81+
'@swc-contrib/mut-cjs-exports', // used in jest config
8582
],
8683
rules: {
8784
binaries: 'off',

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,10 @@
5252
},
5353
"dependencies": {
5454
"@amplitude/analytics-browser": "^1.5.3",
55-
"@babel/core": "~7.29.0",
56-
"@babel/preset-env": "~7.29.0",
57-
"@babel/preset-react": "^7.28.5",
58-
"@babel/preset-typescript": "^7.28.5",
5955
"@dnd-kit/core": "^6.1.0",
6056
"@dnd-kit/modifiers": "7.0.0",
6157
"@dnd-kit/sortable": "^8.0.0",
6258
"@dnd-kit/utilities": "^3.2.2",
63-
"@emotion/babel-plugin": "^11.13.5",
6459
"@emotion/cache": "^11.14.0",
6560
"@emotion/css": "^11.13.5",
6661
"@emotion/is-prop-valid": "^1.3.0",
@@ -122,7 +117,7 @@
122117
"@sentry/webpack-plugin": "4.6.1",
123118
"@stripe/react-stripe-js": "^3.9.2",
124119
"@stripe/stripe-js": "^5.10.0",
125-
"@swc/plugin-emotion": "14.3.0",
120+
"@swc/plugin-emotion": "14.8.0",
126121
"@tanstack/query-async-storage-persister": "5.96.0",
127122
"@tanstack/react-devtools": "0.9.9",
128123
"@tanstack/react-form": "1.28.6",
@@ -242,6 +237,9 @@
242237
"@sentry/jest-environment": "6.1.0",
243238
"@sentry/profiling-node": "10.41.0-beta.0",
244239
"@styled/typescript-styled-plugin": "^1.0.1",
240+
"@swc-contrib/mut-cjs-exports": "14.8.0",
241+
"@swc/core": "1.15.24",
242+
"@swc/jest": "0.2.39",
245243
"@tanstack/eslint-plugin-query": "5.96.0",
246244
"@testing-library/dom": "10.4.1",
247245
"@testing-library/jest-dom": "6.9.1",
@@ -255,7 +253,6 @@
255253
"@typescript-eslint/utils": "8.58.0",
256254
"@typescript/native-preview": "7.0.0-dev.20260401.1",
257255
"@volar/typescript": "^2.4.28",
258-
"babel-jest": "30.3.0",
259256
"eslint": "9.34.0",
260257
"eslint-config-prettier": "10.1.8",
261258
"eslint-import-resolver-typescript": "^3.8.3",

0 commit comments

Comments
 (0)