@@ -31,6 +31,14 @@ It replaces the default `language` exports with
3131parser, printer, and visitor, which only support the GraphQL query language and
3232are tested to 100% coverage and built to match GraphQL.js’ performance.
3333
34+ In an average app using the GraphQL library for a GraphQL client aliasing this
35+ package could save you 7kB gzip effortlessly.
36+
37+ > ** Note:** If you’re using ` @urql/core@^4 ` you’re already benefitting from
38+ > ` @0no-co/graphql.web ` ’s size reduction and aliasing ` graphql-web-lite ` will
39+ > only benefit you if you import from ` graphql ` in any of your other code or
40+ > libraries.
41+
3442## Installation
3543
3644` graphql-web-lite ` mirrors the folder structure of the regular ` graphql ` package and
@@ -288,21 +296,10 @@ away.
288296### Bundlesize Impact
289297
290298Most GraphQL client-side libraries use the following common set of imports from the ` graphql ` library.
291- Assuming a transformation like [ ` babel-plugin-modular-graphql ` ] ( https://github.com/kitten/babel-plugin-modular-graphql/ )
292- or granular imports in general this creates a short list of utilities.
293299
294300``` js
295- export { valueFromASTUntyped } from ' graphql/utilities/valueFromASTUntyped.mjs' ;
296- export { GraphQLError } from ' graphql/error/GraphQLError.mjs' ;
297- export { Kind } from ' graphql/language/kinds.mjs' ;
298- export { parse } from ' graphql/language/parser.mjs' ;
299- export { print } from ' graphql/language/printer.mjs' ;
300- export { visit } from ' graphql/language/visitor.mjs' ;
301+ export { BREAK , isSelectionNode , parse , print , GraphQLError , Kind , visit } from ' graphql' ;
301302```
302303
303- The minzipped size of the imports is about ` 11.2kB ` in a given output bundle, which assumes all the above imports are
304- in use. When the GraphQL language parser is dropped from the bundle, for instance by precompiling queries and excluding
305- it in a compilation step, the resulting minzipped size drops to ` 5.55kB ` .
306-
307- When ` graphql-web-lite ` replaces the ` graphql ` package the minzipped size drops from the ` 11.2kB ` figure down to ` 5.44kB ` ,
308- and ` 3.19kB ` without the parser.
304+ The minzipped size of the imports is about ` 10kB ` in a given output bundle, which assumes all the above imports are
305+ in use. When ` graphql-web-lite ` replaces the ` graphql ` package the minzipped size drops to about ` 3kB ` .
0 commit comments