Skip to content

Commit 0cb1a4e

Browse files
authored
feat(v7/browser): Add moduleMetadataIntegration lazy loading support (#13822)
This PR fixes #13803. The corresponding PR for latest major version is #13817. I saw the bundles generation for integration is happening in `@sentry/integrations`, so I added a corresponding file for `modulemetadata` in this package that exports that integration from `@sentry/core`, so that the bundle actually gets created for this integration as needed.
1 parent 9b3ec19 commit 0cb1a4e

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

dev-packages/browser-integration-tests/utils/generatePlugin.ts

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ const IMPORTED_INTEGRATION_CDN_BUNDLE_PATHS: Record<string, string> = {
4141
ReportingObserver: 'reportingobserver',
4242
sessionTimingIntegration: 'sessiontiming',
4343
SessionTiming: 'sessiontiming',
44+
moduleMetadataIntegration: 'modulemetadata',
45+
ModuleMetadata: 'modulemetadata',
4446
};
4547

4648
const BUNDLE_PATHS: Record<string, Record<string, string>> = {

packages/browser/rollup.bundle.config.mjs

+9
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,19 @@ targets.forEach(jsVersion => {
3333
outputFileBase: () => `bundles/browserprofiling${jsVersion === 'es5' ? '.es5' : ''}`,
3434
});
3535

36+
const moduleMetadataAddonBaseBundleConfig = makeBaseBundleConfig({
37+
bundleType: 'addon',
38+
entrypoints: ['src/integrations/modulemetadata.ts'],
39+
jsVersion,
40+
licenseTitle: '@sentry/browser',
41+
outputFileBase: () => `bundles/modulemetadata${jsVersion === 'es5' ? '.es5' : ''}`,
42+
});
43+
3644
builds.push(
3745
...makeBundleConfigVariants(baseBundleConfig),
3846
...makeBundleConfigVariants(tracingBaseBundleConfig),
3947
...makeBundleConfigVariants(browserProfilingAddonBaseBundleConfig),
48+
...makeBundleConfigVariants(moduleMetadataAddonBaseBundleConfig),
4049
);
4150
});
4251

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* eslint-disable deprecation/deprecation */
2+
export { moduleMetadataIntegration, ModuleMetadata } from '@sentry/core';

0 commit comments

Comments
 (0)