Skip to content

Commit 0074fb8

Browse files
authored
chore: Remove deprecated options and update changelog for v3 major (#654)
1 parent e729f02 commit 0074fb8

File tree

6 files changed

+25
-75
lines changed

6 files changed

+25
-75
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@
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+
727
## 2.23.0
828

929
- chore(deps): bump nanoid from 3.3.6 to 3.3.8 (#641)

packages/bundler-plugin-core/src/index.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,6 @@ export function sentryUnpluginFactory({
105105

106106
const options = normalizeUserOptions(userOptions);
107107

108-
// TODO(v3): Remove this warning
109-
if (userOptions._experiments?.moduleMetadata) {
110-
logger.warn(
111-
"The `_experiments.moduleMetadata` option has been promoted to being stable. You can safely move the option out of the `_experiments` object scope."
112-
);
113-
}
114-
115108
if (unpluginMetaContext.watchMode || options.disable) {
116109
return [
117110
{
@@ -254,10 +247,7 @@ export function sentryUnpluginFactory({
254247
if (bundleSizeOptimizations.excludeDebugStatements) {
255248
replacementValues["__SENTRY_DEBUG__"] = false;
256249
}
257-
if (
258-
bundleSizeOptimizations.excludePerformanceMonitoring ||
259-
bundleSizeOptimizations.excludeTracing
260-
) {
250+
if (bundleSizeOptimizations.excludeTracing) {
261251
replacementValues["__SENTRY_TRACE__"] = false;
262252
}
263253
if (bundleSizeOptimizations.excludeReplayCanvas) {
@@ -437,9 +427,7 @@ export function sentryUnpluginFactory({
437427
plugins.push(
438428
fileDeletionPlugin({
439429
waitUntilSourcemapFileDependenciesAreFreed,
440-
filesToDeleteAfterUpload:
441-
options.sourcemaps?.filesToDeleteAfterUpload ??
442-
options.sourcemaps?.deleteFilesAfterUpload,
430+
filesToDeleteAfterUpload: options.sourcemaps?.filesToDeleteAfterUpload,
443431
logger,
444432
handleRecoverableError,
445433
sentryScope,

packages/bundler-plugin-core/src/options-mapping.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function normalizeUserOptions(userOptions: UserOptions) {
3535
},
3636
},
3737
applicationKey: userOptions.applicationKey,
38-
moduleMetadata: userOptions.moduleMetadata || userOptions._experiments?.moduleMetadata,
38+
moduleMetadata: userOptions.moduleMetadata,
3939
_experiments: userOptions._experiments ?? {},
4040
};
4141

packages/bundler-plugin-core/src/sentry/telemetry.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ export function setTelemetryDataOnScope(options: NormalizedOptions, scope: Scope
8686
// Miscellaneous options
8787
scope.setTag("custom-error-handler", !!errorHandler);
8888
scope.setTag("sourcemaps-assets", !!sourcemaps?.assets);
89-
scope.setTag(
90-
"delete-after-upload",
91-
!!sourcemaps?.deleteFilesAfterUpload || !!sourcemaps?.filesToDeleteAfterUpload
92-
);
89+
scope.setTag("delete-after-upload", !!sourcemaps?.filesToDeleteAfterUpload);
9390
scope.setTag("sourcemaps-disabled", !!sourcemaps?.disable);
9491

9592
scope.setTag("react-annotate", !!reactComponentAnnotation?.enabled);

packages/bundler-plugin-core/src/types.ts

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,6 @@ export interface Options {
127127
// eslint-disable-next-line @typescript-eslint/no-explicit-any
128128
rewriteSources?: (source: string, map: any) => string;
129129

130-
/**
131-
* A glob or an array of globs that specifies the build artifacts that should be deleted after the artifact upload to Sentry has been completed.
132-
*
133-
* The globbing patterns follow the implementation of the `glob` package. (https://www.npmjs.com/package/glob)
134-
*
135-
* Use the `debug` option to print information about which files end up being deleted.
136-
*
137-
* @deprecated Use `filesToDeleteAfterUpload` instead.
138-
*/
139-
// TODO(v3): Remove this option.
140-
deleteFilesAfterUpload?: string | string[];
141-
142130
/**
143131
* A glob or an array of globs that specifies the build artifacts that should be deleted after the artifact upload to Sentry has been completed.
144132
*
@@ -216,18 +204,6 @@ export interface Options {
216204
*/
217205
deploy?: DeployOptions;
218206

219-
/**
220-
* Remove all previously uploaded artifacts for this release on Sentry before the upload.
221-
*
222-
* Defaults to `false`.
223-
*
224-
* @deprecated `cleanArtifacts` is deprecated and currently doesn't do anything. Historically it was needed
225-
* since uploading the same artifacts twice was not allowed. Nowadays, when uploading artifacts with the same name
226-
* more than once to the same release on Sentry, Sentry will prefer the most recent artifact for source mapping.
227-
*/
228-
// TODO(v3): Remove this option
229-
cleanArtifacts?: boolean;
230-
231207
/**
232208
* Legacy method of uploading source maps. (not recommended unless necessary)
233209
*
@@ -253,17 +229,6 @@ export interface Options {
253229
*/
254230
excludeDebugStatements?: boolean;
255231

256-
/**
257-
* If set to `true`, the plugin will attempt to tree-shake (remove) code within the Sentry SDK that is related to tracing and performance monitoring.
258-
* Note that the success of this depends on tree shaking being enabled in your build tooling.
259-
*
260-
* **Notice**: Do not enable this when you're using any performance monitoring-related SDK features (e.g. `Sentry.startTransaction()`).
261-
*
262-
* @deprecated This option has been replaced with the `excludeTracing`. Currently, this option is an alias for `excludeTracing` but `excludePerformanceMonitoring` will be removed in the next major version.
263-
*/
264-
// TODO(v3): Remove this option
265-
excludePerformanceMonitoring?: boolean;
266-
267232
/**
268233
* If set to `true`, the plugin will attempt to tree-shake (remove) code within the Sentry SDK that is related to tracing and performance monitoring.
269234
* Note that the success of this depends on tree shaking being enabled in your build tooling.
@@ -351,7 +316,6 @@ export interface Options {
351316
*
352317
* @experimental API that does not follow semantic versioning and may change in any release
353318
*/
354-
// TODO(v3): Remove these
355319
_experiments?: {
356320
/**
357321
* If set to true, the plugin will inject an additional `SENTRY_BUILD_INFO` variable.
@@ -360,25 +324,6 @@ export interface Options {
360324
* Defaults to `false`.
361325
*/
362326
injectBuildInformation?: boolean;
363-
364-
/**
365-
* NOTE: This option has been promoted to stable.
366-
*
367-
* Metadata that should be associated with the built application.
368-
*
369-
* The metadata is serialized and can be looked up at runtime from within the SDK (for example in the `beforeSend`,
370-
* event processors, or the transport), allowing for custom event filtering logic or routing of events.
371-
*
372-
* Metadata can either be passed directly or alternatively a callback can be provided that will be
373-
* called with the following parameters:
374-
* - `org`: The organization slug.
375-
* - `project`: The project slug.
376-
* - `release`: The release name.
377-
*
378-
* @deprecated Use the non-experimental `moduleMetadata` option instead. (Basically just move this option out of `_experiments`)
379-
*/
380-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
381-
moduleMetadata?: ModuleMetadata | ModuleMetadataCallback;
382327
};
383328

384329
/**

packages/integration-tests/fixtures/bundle-size-optimizations/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ createCjsBundles(
1616
telemetry: false,
1717
bundleSizeOptimizations: {
1818
excludeDebugStatements: true,
19-
excludePerformanceMonitoring: true,
19+
excludeTracing: true,
2020
excludeReplayCanvas: true,
2121
excludeReplayIframe: true,
2222
excludeReplayShadowDom: true,

0 commit comments

Comments
 (0)