Skip to content

Commit 587bbc4

Browse files
author
Luca Forstner
committed
Merge remote-tracking branch 'origin/main' into pr/timfish/610
2 parents 9d64d56 + 0074fb8 commit 587bbc4

File tree

37 files changed

+432
-1324
lines changed

37 files changed

+432
-1324
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,20 @@ jobs:
1616
runs-on: ubuntu-latest
1717
name: "Release a new version"
1818
steps:
19+
- name: Get auth token
20+
id: token
21+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
22+
with:
23+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
24+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
1925
- uses: actions/checkout@v4
2026
with:
21-
token: ${{ secrets.GH_RELEASE_PAT }}
27+
token: ${{ steps.token.outputs.token }}
2228
fetch-depth: 0
2329
- name: Prepare release
2430
uses: getsentry/action-prepare-release@v1
2531
env:
26-
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
32+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
2733
with:
2834
version: ${{ github.event.inputs.version }}
2935
force: ${{ github.event.inputs.force }}

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,48 @@
44

55
- "You know what they say ‘Fool me once, strike one, but fool me twice… strike three.’" — Michael Scott
66

7+
## 3.0.0
8+
9+
### Breaking Changes
10+
11+
- Code injected into bundles now uses:
12+
13+
- `const` which was added in ES6 (ES2015) (#646)
14+
- `globalThis` which was added ES2020 but can be polyfilled (#610)
15+
16+
- Deprecated configuration options have been removed:
17+
- `deleteFilesAfterUpload` - Use `filesToDeleteAfterUpload` instead
18+
- `bundleSizeOptimizations.excludePerformanceMonitoring` - Use `bundleSizeOptimizations.excludeTracing` instead
19+
- `_experiments.moduleMetadata` - Use `moduleMetadata` instead
20+
- `cleanArtifacts` - Did not do anything
21+
22+
### Other Changes
23+
24+
- fix(webpack): Ensure process exits when done (#653)
25+
- feat(logger): Use console methods respective to log level (#652)
26+
27+
## 2.23.0
28+
29+
- chore(deps): bump nanoid from 3.3.6 to 3.3.8 (#641)
30+
- feat(core): Detect Railway release name (#639)
31+
- feat(core): Write module injections to `globalThis` (#636)
32+
- feat(react-component-annotate): Allow skipping annotations on specified components (#617)
33+
- ref(core): Rename release management plugin name (#647)
34+
35+
Work in this release contributed by @conor-ob. Thank you for your contribution!
36+
37+
## 2.22.7
38+
39+
- deps: Bump `@sentry/cli` to `2.39.1` and require specific version (#632)
40+
- feat(telemetry): Record if plugin is run in CI (#627)
41+
42+
## 2.22.6
43+
44+
- fix(core): Use sha256 instead of md5 to generate uuids from string (#619)
45+
746
## 2.22.5
847

48+
- fix: Ignore stderr output from git command (#613)
949
- feat: Update Sentry telemetry to v8 (#604)
1050
- deps: Update `@sentry/cli` to `2.36.1` (#609)
1151

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": "2.22.4",
3+
"version": "2.23.0",
44
"npmClient": "yarn",
55
"useWorkspaces": true
66
}

packages/babel-plugin-component-annotate/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ Using pnpm:
4747
pnpm add @sentry/babel-plugin-component-annotate --save-dev
4848
```
4949

50+
## Options
51+
52+
### `ignoredComponents`
53+
54+
Type: `string[]`
55+
56+
A list of strings representing the names of components to ignore. The plugin will not apply `data-sentry` annotations on the DOM element for these components.
57+
5058
## Example
5159

5260
```js
@@ -57,7 +65,8 @@ pnpm add @sentry/babel-plugin-component-annotate --save-dev
5765

5866
plugins: [
5967
// Put this plugin before any other plugins you have that transform JSX code
60-
['@sentry/babel-plugin-component-annotate']
68+
// The options are set by providing an object as the second element in the array, but not required
69+
['@sentry/babel-plugin-component-annotate', {ignoredComponents: ['Foo', 'Bar']}]
6170
],
6271
}
6372
```

packages/babel-plugin-component-annotate/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/babel-plugin-component-annotate",
3-
"version": "2.22.4",
3+
"version": "2.23.0",
44
"description": "A Babel plugin that annotates frontend components with additional data to enrich the experience in Sentry",
55
"repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/babel-plugin-component-annotate",
@@ -56,8 +56,8 @@
5656
"@babel/preset-typescript": "7.17.12",
5757
"@rollup/plugin-babel": "5.3.1",
5858
"@rollup/plugin-node-resolve": "13.3.0",
59-
"@sentry-internal/eslint-config": "2.22.4",
60-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "2.22.4",
59+
"@sentry-internal/eslint-config": "2.23.0",
60+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "2.23.0",
6161
"@swc/core": "^1.2.205",
6262
"@swc/jest": "^0.2.21",
6363
"@types/jest": "^28.1.3",

packages/babel-plugin-component-annotate/src/index.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,13 @@ const nativeSourceFileName = "dataSentrySourceFile";
4848
interface AnnotationOpts {
4949
native?: boolean;
5050
"annotate-fragments"?: boolean;
51-
ignoreComponents?: IgnoredComponent[];
51+
ignoredComponents?: string[];
5252
}
5353

5454
interface AnnotationPluginPass extends PluginPass {
5555
opts: AnnotationOpts;
5656
}
5757

58-
type IgnoredComponent = [file: string, component: string, element: string];
59-
6058
type AnnotationPlugin = PluginObj<AnnotationPluginPass>;
6159

6260
// We must export the plugin as default, otherwise the Babel loader will not be able to resolve it when configured using its string identifier
@@ -78,7 +76,7 @@ export default function componentNameAnnotatePlugin({ types: t }: typeof Babel):
7876
path.node.id.name,
7977
sourceFileNameFromState(state),
8078
attributeNamesFromState(state),
81-
state.opts.ignoreComponents ?? []
79+
state.opts.ignoredComponents ?? []
8280
);
8381
},
8482
ArrowFunctionExpression(path, state) {
@@ -106,7 +104,7 @@ export default function componentNameAnnotatePlugin({ types: t }: typeof Babel):
106104
parent.id.name,
107105
sourceFileNameFromState(state),
108106
attributeNamesFromState(state),
109-
state.opts.ignoreComponents ?? []
107+
state.opts.ignoredComponents ?? []
110108
);
111109
},
112110
ClassDeclaration(path, state) {
@@ -120,7 +118,7 @@ export default function componentNameAnnotatePlugin({ types: t }: typeof Babel):
120118
return;
121119
}
122120

123-
const ignoredComponents = state.opts.ignoreComponents ?? [];
121+
const ignoredComponents = state.opts.ignoredComponents ?? [];
124122

125123
render.traverse({
126124
ReturnStatement(returnStatement) {
@@ -153,7 +151,7 @@ function functionBodyPushAttributes(
153151
componentName: string,
154152
sourceFileName: string | undefined,
155153
attributeNames: string[],
156-
ignoredComponents: IgnoredComponent[]
154+
ignoredComponents: string[]
157155
) {
158156
let jsxNode: Babel.NodePath;
159157

@@ -249,7 +247,7 @@ function processJSX(
249247
componentName: string | null,
250248
sourceFileName: string | undefined,
251249
attributeNames: string[],
252-
ignoredComponents: IgnoredComponent[]
250+
ignoredComponents: string[]
253251
) {
254252
if (!jsxNode) {
255253
return;
@@ -324,7 +322,7 @@ function applyAttributes(
324322
componentName: string | null,
325323
sourceFileName: string | undefined,
326324
attributeNames: string[],
327-
ignoredComponents: IgnoredComponent[]
325+
ignoredComponents: string[]
328326
) {
329327
const [componentAttributeName, elementAttributeName, sourceFileAttributeName] = attributeNames;
330328

@@ -340,10 +338,7 @@ function applyAttributes(
340338
const elementName = getPathName(t, openingElement);
341339

342340
const isAnIgnoredComponent = ignoredComponents.some(
343-
(ignoredComponent) =>
344-
matchesIgnoreRule(ignoredComponent[0], sourceFileName) &&
345-
matchesIgnoreRule(ignoredComponent[1], componentName) &&
346-
matchesIgnoreRule(ignoredComponent[2], elementName)
341+
(ignoredComponent) => ignoredComponent === componentName || ignoredComponent === elementName
347342
);
348343

349344
// Add a stable attribute for the element name but only for non-DOM names
@@ -501,10 +496,6 @@ function isReactFragment(t: typeof Babel.types, openingElement: Babel.NodePath):
501496
return false;
502497
}
503498

504-
function matchesIgnoreRule(rule: string, name: string | undefined | null) {
505-
return rule === "*" || rule === name;
506-
}
507-
508499
function hasAttributeWithName(
509500
openingElement: Babel.NodePath<Babel.types.JSXOpeningElement>,
510501
name: string | undefined | null

0 commit comments

Comments
 (0)