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

Make graphql-tools dependencies tree-shakable #1305

Closed
Tracked by #1358
n1ru4l opened this issue Jun 20, 2022 · 4 comments
Closed
Tracked by #1358

Make graphql-tools dependencies tree-shakable #1305

n1ru4l opened this issue Jun 20, 2022 · 4 comments
Assignees
Milestone

Comments

@n1ru4l
Copy link
Collaborator

n1ru4l commented Jun 20, 2022

  1. For Bundle Size
    1. Add Bundle Size checks (with images that would be nice)
    2. My long-term vision is to completely drop the @graphql-tools/utils and @graphql-tools/schema dependency from graphql-yoga as it makes up quite a big chunk of the whole bundle. (https://bundlephobia.com/package/@graphql-yoga/common@2.8.3).
    3. In the best-case scenario, the @graphql-tools/schema functionality for constructing a schema is part of graphql-js.
  2. Remove the default schema because it needs makeExecutableSchema even if user passes their own schema
    • What about @graphql-yoga/common/schema? ✅
  3. Export makeExecutableSchema from yoga in a tree shakable way and remove makeExecutableSchema from createServer so by default createServer would take less bundle size and makeExecutableSchema would be tree shaken/gone.
    • schema parameter will accept GraphQLSchema only and users will create the schema by themselves with the exported makeExecutableSchema or some other schema factory lib.
  4. Stop supporting older graphql-js versions

image

@Urigo Urigo added this to the v3 milestone Jul 6, 2022
@theguild-bot theguild-bot mentioned this issue Jul 6, 2022
@n1ru4l
Copy link
Collaborator Author

n1ru4l commented Jul 18, 2022

We decided upon, that we re-export the functionality under @graphql-yoga/common/schema

@n1ru4l
Copy link
Collaborator Author

n1ru4l commented Aug 2, 2022

Unfortunately, because of ESM and TypeScript limitations, we cannot simply provide deep imports.

Instead, we can mark all our files as side-effect free, which allows tree-shaking.

@n1ru4l n1ru4l changed the title Remove graphql-tools dependencies Make graphql-tools dependencies tree-shakable Aug 2, 2022
@n1ru4l n1ru4l closed this as completed Aug 8, 2022
@n1ru4l n1ru4l reopened this Aug 8, 2022
@ardatan
Copy link
Collaborator

ardatan commented Aug 13, 2022

@n1ru4l I think we can close this, no?

@n1ru4l
Copy link
Collaborator Author

n1ru4l commented Aug 15, 2022

yas

@n1ru4l n1ru4l closed this as completed Aug 15, 2022
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

3 participants