diff --git a/.size-limit.js b/.size-limit.js index 63b2b65..786dd98 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -19,21 +19,21 @@ function modifyWebpackConfig(config) { module.exports = [ { name: 'The size of the Mediator with Embed layout', - limit: '10.1 KB', + limit: '9.5 KB', path: 'dist/index.js', import: '{createMediator, EmbedLayout}', modifyWebpackConfig }, { name: 'The size of the Mediator with Overlay layout', - limit: '10.2 KB', + limit: '9.7 KB', path: 'dist/index.js', import: '{createMediator, OverlayLayout}', modifyWebpackConfig }, { name: 'The size of the Consumer', - limit: '7.3 KB', + limit: '5.3 KB', path: 'dist/index.js', import: '{registerIFrame}', modifyWebpackConfig diff --git a/package.json b/package.json index 98272b2..01cd817 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,9 @@ "dist", "src" ], + "sideEffects": [ + "dist/utils/dom/index.js" + ], "scripts": { "build": "tsc && find src -type f -name \"*.css\" -exec sh -c 'cp \"$1\" \"dist/$(echo \"$1\" | sed \"s|src/||\")\"' _ {} \\;", "test": "jest", @@ -34,7 +37,7 @@ "domready": "^1.0.8", "lodash.debounce": "^4.0.8", "lodash.throttle": "^4.1.1", - "magic-transport": "^3.0.1" + "magic-transport": "^3.0.2" }, "devDependencies": { "@commitlint/cli": "^19.0.3", diff --git a/src/iframe/consumer-resizer.ts b/src/iframe/consumer-resizer.ts index cedfdb2..ac92312 100644 --- a/src/iframe/consumer-resizer.ts +++ b/src/iframe/consumer-resizer.ts @@ -4,13 +4,6 @@ import {mutationEvents, setMutationParams} from '../utils/dom' import {EventEmitter} from '../utils/event-emitter' import type {Size} from '../types' -setMutationParams({ - attributes: true, - childList: true, - subtree: true, - characterData: true -}) - export class IFrameResizer { private events: EventEmitter private transport: Consumer @@ -19,6 +12,13 @@ export class IFrameResizer { public constructor(transport: Consumer) { this.events = new EventEmitter() this.transport = transport + + setMutationParams({ + attributes: true, + childList: true, + subtree: true, + characterData: true + }) } public getSize() { diff --git a/yarn.lock b/yarn.lock index b15d61c..befd993 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6064,10 +6064,10 @@ lunr@^2.3.9: resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== -magic-transport@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/magic-transport/-/magic-transport-3.0.1.tgz#2434819ac9556686b561573c6924ca03908cfe7c" - integrity sha512-yNt9+l4VIYhlWIcHcWX8g6V6DoH6KRIDGcarILpZnVQreLr5635sN+Wxna0tO08dTbAOE1EFE/+mael35PC1fg== +magic-transport@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/magic-transport/-/magic-transport-3.0.2.tgz#34dd7c756071a0d4112b8d7c6198d4fd6f760fe7" + integrity sha512-qkdiuBK1xFt1NYt0OIjBodH5vUbylSfnkmSCGSRL713ltytm0zqrwfZxXnPNPC2OA4Kkm9Jy6gGFYQsu7KRyzw== dependencies: dot-prop "^3.0.0"