3.1.0-pre.0 bundle size regression with rollup
See original GitHub issueI know this is prerelease but I just want to give some feedback. This is the same as a comment I made in https://github.com/apollographql/apollo-client/commit/faa64b303447e0d5c745ec27cdd2480338c3763a#r40855898 but I created an issue for more visibility.
I tried out 3.1.0.pre.0
and we are seeing a bundle size regression in our rollup bundle. Here is a snippet from dist/core/index.js
before and after
export { ApolloClient, } from './ApolloClient';
export { ObservableQuery, } from './ObservableQuery';
export { NetworkStatus } from './networkStatus';
export * from './types';
export { isApolloError, ApolloError } from '../errors';
import '../utilities/graphql/directives.js';
import '../utilities/graphql/fragments.js';
export { isReference, makeReference } from '../utilities/graphql/storeUtils.js';
import '../utilities/graphql/getFromAST.js';
import '../utilities/graphql/transform.js';
export { default as Observable } from 'zen-observable';
import '../utilities/common/mergeDeep.js';
import '../utilities/common/cloneDeep.js';
import '../utilities/common/maybeDeepFreeze.js';
I don’t think rollup is able to treeshake the import
s with no specifiers. Please let me know if you need any more info if there are any workarounds.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Investigate bundle size regression · Issue #157 - GitHub
For the moment, I've updated Rollup to the latest release and tweaked the domHelpers util a bit (7130e03). I think the size increase...
Read more >@bugsnag/plugin-node-in-project | Yarn - Package Manager
This plugin detects whether a stackframe is "in project" – i.e. whether it is a descendent of the project root and node within...
Read more >ng-packagr/CHANGELOG.md - UNPKG
44, * update @rollup/plugin-node-resolve to version ^9.0.0 ... 1164, * reduce library bundle size by clean-css ... 1536, * regression in cli defaults ......
Read more >Webpack vs Rollup vs Parcel vs Browserify — Bundle size ...
Build time, bundle size and ease of use comparison between JavaScript bundlers Webpack, Rollup, Parcel and Browserify.
Read more >Updates - CodeKit
23 September 2022. Build 34434 — Download. Bootstrap: The JS file that bundles Bootstrap components is now named so that you can ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@henryqdineen This is great feedback, and really validates the decision to publish
-pre.0
before 3.1.0!I was uneasy with those specifier-less imports too, and couldn’t find a combination of Rollup options to prevent them. I think they have something to do with import hoisting, which is supposedly disabled when
preserveModules: true
is set (which we do), but apparently not? Ironically, Rollup seems to be creating a problem that it can’t solve (tree-shake) later.In any case, I am planning to replace
resolveESMImportsAndFileExtensions
with a step that simply resolves all existing module identifiers, without injecting any new imports or exports.@benjamn I just tried it out by adding
"sideEffects": false
tonode_modules/graphql-tag/package.json
and that did the trick! Are there plans to add that flag to that project? The other solution would work also but seems like a breaking change since we are removing named exports. Thanks as usual!