Skip to content

Commit 1cad7ba

Browse files
committed
Move injectBuildInformation out of _experiments
1 parent b968cf5 commit 1cad7ba

File tree

8 files changed

+16
-32
lines changed

8 files changed

+16
-32
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- `deleteFilesAfterUpload` - Use `filesToDeleteAfterUpload` instead
1818
- `bundleSizeOptimizations.excludePerformanceMonitoring` - Use `bundleSizeOptimizations.excludeTracing` instead
1919
- `_experiments.moduleMetadata` - Use `moduleMetadata` instead
20+
- `_experiments.injectBuildInformation` - Use `injectBuildInformation` instead
2021
- `cleanArtifacts` - Did not do anything
2122

2223
### Other Changes

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export function sentryUnpluginFactory({
279279
} else {
280280
const injectionCode = generateGlobalInjectorCode({
281281
release: options.release.name,
282-
injectBuildInformation: options._experiments.injectBuildInformation || false,
282+
injectBuildInformation: options.injectBuildInformation || false,
283283
});
284284
plugins.push(releaseInjectionPlugin(injectionCode));
285285
}

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

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

4242
return options;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function setTelemetryDataOnScope(options: NormalizedOptions, scope: Scope
7272
}
7373

7474
scope.setTag("module-metadata", !!options.moduleMetadata);
75-
scope.setTag("inject-build-information", !!options._experiments.injectBuildInformation);
75+
scope.setTag("inject-build-information", !!options.injectBuildInformation);
7676

7777
// Optional release pipeline steps
7878
if (release.setCommits) {

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

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -305,26 +305,19 @@ export interface Options {
305305
// eslint-disable-next-line @typescript-eslint/no-explicit-any
306306
moduleMetadata?: ModuleMetadata | ModuleMetadataCallback;
307307

308-
/**
309-
* A key which will embedded in all the bundled files. The SDK will be able to use the key to apply filtering
310-
* rules, for example using the `thirdPartyErrorFilterIntegration`.
311-
*/
312-
applicationKey?: string;
313-
314-
/**
315-
* Options that are considered experimental and subject to change.
316-
*
317-
* @experimental API that does not follow semantic versioning and may change in any release
318-
*/
319-
_experiments?: {
320-
/**
308+
/**
321309
* If set to true, the plugin will inject an additional `SENTRY_BUILD_INFO` variable.
322310
* This contains information about the build, e.g. dependencies, node version and other useful data.
323311
*
324312
* Defaults to `false`.
325313
*/
326-
injectBuildInformation?: boolean;
327-
};
314+
injectBuildInformation?: boolean;
315+
316+
/**
317+
* A key which will embedded in all the bundled files. The SDK will be able to use the key to apply filtering
318+
* rules, for example using the `thirdPartyErrorFilterIntegration`.
319+
*/
320+
applicationKey?: string;
328321

329322
/**
330323
* Options that are useful for building wrappers around the plugin. You likely don't need these options unless you

packages/bundler-plugin-core/test/option-mappings.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ describe("normalizeUserOptions()", () => {
2626
},
2727
silent: false,
2828
telemetry: true,
29-
_experiments: {},
3029
_metaOptions: {
3130
telemetry: {
3231
metaFramework: undefined,
@@ -77,7 +76,6 @@ describe("normalizeUserOptions()", () => {
7776
},
7877
silent: false,
7978
telemetry: true,
80-
_experiments: {},
8179
_metaOptions: {
8280
telemetry: {
8381
metaFramework: undefined,

packages/dev-utils/src/generate-documentation-table.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -412,18 +412,10 @@ type IncludeEntry = {
412412
"A key which will embedded in all the bundled files. The SDK will be able to use the key to apply filtering rules, for example using the `thirdPartyErrorFilterIntegration`.",
413413
},
414414
{
415-
name: "_experiments",
416-
type: "string",
415+
name: "injectBuildInformation",
416+
type: "boolean",
417417
fullDescription:
418-
"Options that are considered experimental and subject to change. This option does not follow semantic versioning and may change in any release.",
419-
children: [
420-
{
421-
name: "injectBuildInformation",
422-
type: "boolean",
423-
fullDescription:
424-
"If set to true, the plugin will inject an additional `SENTRY_BUILD_INFO` variable. This contains information about the build, e.g. dependencies, node version and other useful data.\n\nDefaults to `false`.",
425-
},
426-
],
418+
"If set to true, the plugin will inject an additional `SENTRY_BUILD_INFO` variable. This contains information about the build, e.g. dependencies, node version and other useful data.\n\nDefaults to `false`.",
427419
},
428420
];
429421

packages/integration-tests/fixtures/build-information-injection/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ createCjsBundles({ index: entryPointPath }, outputDir, {
99
name: "build-information-injection-test",
1010
},
1111
telemetry: false,
12-
_experiments: { injectBuildInformation: true },
12+
injectBuildInformation: true,
1313
});

0 commit comments

Comments
 (0)