From 52ab4bd49e21d4d5d9f751488bcbab5a5dc64963 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 3 Sep 2024 15:31:51 +0200 Subject: [PATCH] add new size limits --- .size-limit.js | 19 +++++++++++++++++++ .../suites/feedback/attachTo/init.js | 5 +---- .../suites/feedback/logger/init.js | 5 +---- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.size-limit.js b/.size-limit.js index d2211d91d5b0..fea0dc49b559 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -10,6 +10,25 @@ module.exports = [ gzip: true, limit: '24 KB', }, + { + name: '@sentry/browser - with treeshaking flags', + path: 'packages/browser/build/npm/esm/index.js', + import: createImport('init'), + gzip: true, + limit: '24 KB', + modifyWebpackConfig: function (config) { + const webpack = require('webpack'); + config.plugins.push( + new webpack.DefinePlugin({ + __SENTRY_DEBUG__: false, + __RRWEB_EXCLUDE_SHADOW_DOM__: true, + __RRWEB_EXCLUDE_IFRAME__: true, + __SENTRY_EXCLUDE_REPLAY_WORKER__: true, + }), + ); + return config; + }, + }, { name: '@sentry/browser (incl. Tracing)', path: 'packages/browser/build/npm/esm/index.js', diff --git a/dev-packages/browser-integration-tests/suites/feedback/attachTo/init.js b/dev-packages/browser-integration-tests/suites/feedback/attachTo/init.js index fb1ec7133556..5eb27143fdc7 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/attachTo/init.js +++ b/dev-packages/browser-integration-tests/suites/feedback/attachTo/init.js @@ -9,12 +9,9 @@ const feedback = feedbackIntegration({ window.Sentry = Sentry; window.feedback = feedback; - Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', - integrations: [ - feedback, - ], + integrations: [feedback], }); feedback.attachTo('#custom-feedback-buttom'); diff --git a/dev-packages/browser-integration-tests/suites/feedback/logger/init.js b/dev-packages/browser-integration-tests/suites/feedback/logger/init.js index de19e3930e39..3251bd6c7a4c 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/logger/init.js +++ b/dev-packages/browser-integration-tests/suites/feedback/logger/init.js @@ -9,13 +9,10 @@ const feedback = feedbackIntegration({ window.Sentry = Sentry; window.feedback = feedback; - Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', debug: true, - integrations: [ - feedback, - ], + integrations: [feedback], }); // This should log an error!