ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.16k stars 736 forks source link

Build slim HotChocolate.AspNetCore package #3631

Closed petli closed 2 years ago

petli commented 3 years ago

We use HotChocolate.AspNetCore in an API that is deployed as an AWS Lambda, and in that environment it is important to reduce the deploy size as much as possible to have quicker cold starts and better user experience.

When investigating our deploy size the HotChocolate.AspNetCore package stood out, at 15 MB it is an order of magnitude bigger than the next biggest (EFCore). I've tracked this down to the contents of the Resources folder, which appears to be the Banana Cake Pop IDE.

Since we have no need for that tool in the production deployments, would it be possible to move the IDE into a separate nuget package, so we can have a HotChocolate.AspNetCore that is much smaller?

This would break projects that depend on HotChocolate.AspNetCore and use the IDE, though, so I don't expect you to do that in a minor version. So within the version 11 would it be possible to make HotChocolate.AspNetCore into a meta package that pulls in HotChocolate.AspNetCore.Core (which contains everything but the tool) and HotChocolate.AspNetCore.BananaCakePop (which adds the IDE)?

I'm willing to have a go at the initial project and solution restructuring required for this in a PR, if that would help.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jorrit commented 11 months ago

This would be great to have.

If the MapGraphQL would not call any BananaCakePop methods if Enable = false, it would be possible to just remove the assembly from the deployment package to reduce its size. In my case, I want to reduce the Docker image size.