From 9287517d4583267f2211dc3ae1fb44c946ee491a Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 8 Aug 2022 10:11:40 +0000 Subject: [PATCH 1/2] fix(integration): Don't mangle localforage internals --- rollup/plugins/bundlePlugins.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rollup/plugins/bundlePlugins.js b/rollup/plugins/bundlePlugins.js index 7d4c7a9023cd..30862bc82127 100644 --- a/rollup/plugins/bundlePlugins.js +++ b/rollup/plugins/bundlePlugins.js @@ -92,8 +92,15 @@ export function makeTerserPlugin() { properties: { // allow mangling of private field names... regex: /^_[^_]/, - // ...except for `_experiments`, which we want to remain usable from the outside - reserved: ['_experiments'], + reserved: [ + // ...except for `_experiments`, which we want to remain usable from the outside + '_experiments', + // ...except for some localforage internals, which if we replaced them would break the localforage package + // with the error "Error: Custom driver not compliant": https://github.com/getsentry/sentry-javascript/issues/5527 + '_driver', + '_initStorage', + '_support', + ], }, }, output: { From 7f279da52ad69cbb738dddc13195aacf7baac074 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 8 Aug 2022 10:14:22 +0000 Subject: [PATCH 2/2] Add link --- rollup/plugins/bundlePlugins.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rollup/plugins/bundlePlugins.js b/rollup/plugins/bundlePlugins.js index 30862bc82127..c2c65d8a1a11 100644 --- a/rollup/plugins/bundlePlugins.js +++ b/rollup/plugins/bundlePlugins.js @@ -96,7 +96,8 @@ export function makeTerserPlugin() { // ...except for `_experiments`, which we want to remain usable from the outside '_experiments', // ...except for some localforage internals, which if we replaced them would break the localforage package - // with the error "Error: Custom driver not compliant": https://github.com/getsentry/sentry-javascript/issues/5527 + // with the error "Error: Custom driver not compliant": https://github.com/getsentry/sentry-javascript/issues/5527. + // Reference for which fields are affected: https://localforage.github.io/localForage/ (ctrl-f for "_") '_driver', '_initStorage', '_support',