From 48e67bece805237a3a29564cb94db98dcee8e781 Mon Sep 17 00:00:00 2001 From: gilish <40733156+gilisho@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:42:43 +0300 Subject: [PATCH 1/4] feat(browser): [v7] Add moduleMetadataIntegration lazy loading support --- dev-packages/browser-integration-tests/utils/generatePlugin.ts | 2 ++ packages/integrations/src/modulemetadata.ts | 1 + 2 files changed, 3 insertions(+) create mode 100644 packages/integrations/src/modulemetadata.ts diff --git a/dev-packages/browser-integration-tests/utils/generatePlugin.ts b/dev-packages/browser-integration-tests/utils/generatePlugin.ts index cf2816ab0033..3f3164731532 100644 --- a/dev-packages/browser-integration-tests/utils/generatePlugin.ts +++ b/dev-packages/browser-integration-tests/utils/generatePlugin.ts @@ -41,6 +41,8 @@ const IMPORTED_INTEGRATION_CDN_BUNDLE_PATHS: Record = { ReportingObserver: 'reportingobserver', sessionTimingIntegration: 'sessiontiming', SessionTiming: 'sessiontiming', + moduleMetadataIntegration: 'modulemetadata', + ModuleMetadata: 'modulemetadata', }; const BUNDLE_PATHS: Record> = { diff --git a/packages/integrations/src/modulemetadata.ts b/packages/integrations/src/modulemetadata.ts new file mode 100644 index 000000000000..8ab54712a930 --- /dev/null +++ b/packages/integrations/src/modulemetadata.ts @@ -0,0 +1 @@ +export { moduleMetadataIntegration, ModuleMetadata } from '@sentry/core'; From ea0d14b67ccf4a8d038e5649e4c644a3425f0841 Mon Sep 17 00:00:00 2001 From: gilish <40733156+gilisho@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:48:14 +0300 Subject: [PATCH 2/4] eslint-disable for exporting deprecated ModuleMetadata --- packages/integrations/src/modulemetadata.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/integrations/src/modulemetadata.ts b/packages/integrations/src/modulemetadata.ts index 8ab54712a930..b033b65aa0e9 100644 --- a/packages/integrations/src/modulemetadata.ts +++ b/packages/integrations/src/modulemetadata.ts @@ -1 +1,2 @@ +/* eslint-disable deprecation/deprecation */ export { moduleMetadataIntegration, ModuleMetadata } from '@sentry/core'; From ec77e5a26ead5e0fa203207dba0ad1b67369f01d Mon Sep 17 00:00:00 2001 From: gilish <40733156+gilisho@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:55:47 +0300 Subject: [PATCH 3/4] Generate integration bundle from @sentry/browser --- packages/browser/rollup.bundle.config.mjs | 9 +++++++++ .../src => browser/src/integrations}/modulemetadata.ts | 0 2 files changed, 9 insertions(+) rename packages/{integrations/src => browser/src/integrations}/modulemetadata.ts (100%) diff --git a/packages/browser/rollup.bundle.config.mjs b/packages/browser/rollup.bundle.config.mjs index b5bc67728796..5c4c25266970 100644 --- a/packages/browser/rollup.bundle.config.mjs +++ b/packages/browser/rollup.bundle.config.mjs @@ -33,10 +33,19 @@ targets.forEach(jsVersion => { outputFileBase: () => `bundles/browserprofiling${jsVersion === 'es5' ? '.es5' : ''}`, }); + const moduleMetadataAddonBaseBundleConfig = makeBaseBundleConfig({ + bundleType: 'addon', + entrypoints: ['src/integrations/modulemetadata.ts'], + jsVersion, + licenseTitle: '@sentry/browser', + outputFileBase: () => `bundles/modulemetadata${jsVersion === 'es5' ? '.es5' : ''}`, + }); + builds.push( ...makeBundleConfigVariants(baseBundleConfig), ...makeBundleConfigVariants(tracingBaseBundleConfig), ...makeBundleConfigVariants(browserProfilingAddonBaseBundleConfig), + ...makeBundleConfigVariants(moduleMetadataAddonBaseBundleConfig) ); }); diff --git a/packages/integrations/src/modulemetadata.ts b/packages/browser/src/integrations/modulemetadata.ts similarity index 100% rename from packages/integrations/src/modulemetadata.ts rename to packages/browser/src/integrations/modulemetadata.ts From aca0fea0221096b78cdb3dcce2d3d0ea659cfca7 Mon Sep 17 00:00:00 2001 From: gilish <40733156+gilisho@users.noreply.github.com> Date: Mon, 11 Nov 2024 13:36:19 +0200 Subject: [PATCH 4/4] Fix format --- packages/browser/rollup.bundle.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/browser/rollup.bundle.config.mjs b/packages/browser/rollup.bundle.config.mjs index 5c4c25266970..db07a5be87b4 100644 --- a/packages/browser/rollup.bundle.config.mjs +++ b/packages/browser/rollup.bundle.config.mjs @@ -45,7 +45,7 @@ targets.forEach(jsVersion => { ...makeBundleConfigVariants(baseBundleConfig), ...makeBundleConfigVariants(tracingBaseBundleConfig), ...makeBundleConfigVariants(browserProfilingAddonBaseBundleConfig), - ...makeBundleConfigVariants(moduleMetadataAddonBaseBundleConfig) + ...makeBundleConfigVariants(moduleMetadataAddonBaseBundleConfig), ); });