From f33b6b060f8c6552673d6099e5f446a9e14ef539 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Mon, 13 Sep 2021 10:57:19 -0400 Subject: [PATCH] Measure bundlesize using `@apollo/client` root package again. Analogous to 2c0088f6a252d8fd77f8924d1ef54fe1efb17b44, but cherry-picked from `main` to `release-3.5`. Though this increases the bundlesize by +2.7kB (reflecting the weight of `@apollo/client/react`), the same calculation on `main` gives 28.35kB, whereas `release-3.5` now gives 27.62kB, reflecting the massive savings from @brainkim's React refactorings in #8596. --- config/rollup.config.js | 11 +---------- package.json | 4 ++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/config/rollup.config.js b/config/rollup.config.js index 49aa94d54d2..6d4b281c073 100644 --- a/config/rollup.config.js +++ b/config/rollup.config.js @@ -127,16 +127,7 @@ export default [ './dist/index.js', './dist/apollo-client.cjs', ), - // The bundlesize check configured in package.json reflects the total size of - // @apollo/client/core (note the /core), rather than @apollo/client, which - // currently includes React-related exports that may not be used by all - // consumers. We are planning to confine those React exports to - // @apollo/client/react in AC4 (see issue #8190). - prepareCJS( - './dist/core/index.js', - './temp/bundlesize.cjs', - ), prepareCJSMinified( - './temp/bundlesize.cjs', + './dist/apollo-client.cjs', ), ]; diff --git a/package.json b/package.json index f0b032f93c1..3f6b717441b 100644 --- a/package.json +++ b/package.json @@ -54,8 +54,8 @@ "bundlesize": [ { "name": "apollo-client", - "path": "./temp/bundlesize.min.cjs", - "maxSize": "25 kB" + "path": "./dist/apollo-client.min.cjs", + "maxSize": "27.7 kB" } ], "engines": {