Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce bundle size #32

Open
remorses opened this issue May 3, 2020 · 1 comment
Open

Reduce bundle size #32

remorses opened this issue May 3, 2020 · 1 comment

Comments

@remorses
Copy link

remorses commented May 3, 2020

Currently the bundle size is pretty big because of lodash and rxjs https://bundlephobia.com/result?p=graphql-typed-client@1.7.4

Lodash impact can be reduced simply by changing the import paths, rxjs instead requires the consumer tree shaking the library to reduce bundle size

To enable tree shaking this library should expose a module version of the lib and generate the entry point code with the import syntax instead of require, this way Webpack can tree shake the unused rxjs operators

@remorses
Copy link
Author

remorses commented May 3, 2020

Maybe we can remove rxjs altogether? The rxjs dependency is used just for this line (exclduing the map operator that can be easily removed)

From what i understand this code maintains the connection open for multiple subscribers, isn't this already implemented in subscriptions-transport-ws?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant