Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
A more-than-we-would-like amount of code is piling up in our Lambda functions / federated GraphQL services, which affects cold starts.
There are a couple of annoying packages that increase the size significantly, for example the apollo-server-lambda, which I decided to trim this week. By going deep into the package and checking what it contained, I managed to shave of ~1.3MB from each service! The problem with the apollo-server-lambda was that it imported GQL Playground and famous busboy lib for handling file uploads, both of which we weren't using at all (GQL playground was used only on the Apollo Gateway Lambda).
In order to see what else could be removed, I continued my research. The conclusion is that there are still packages that should NOT be in the bundle, like ajv (225kb), bson (203kb), mime-db (186kb), etc. I even saw bluebird (186kb) in I18N GraphQL bundle 😱 🤯.
Anyways, at the moment, I didn't had more time to go and check these, but this is something we'll certainly need to check. There might be a couple of easy wins there. For example, bson lib should go automatically go away with the introduction of DynamoDb, as we won't need the DB Proxy anymore (included in commodo-fields-storage-db-proxy package). We won't be needing @commodo/fields-storage-ref as well, which is additional 47kb.
And so on, and so on...
Hopefully, we'll be able to revisit this before v5 launch.
A more-than-we-would-like amount of code is piling up in our Lambda functions / federated GraphQL services, which affects cold starts.
There are a couple of annoying packages that increase the size significantly, for example the
apollo-server-lambda
, which I decided to trim this week. By going deep into the package and checking what it contained, I managed to shave of ~1.3MB from each service! The problem with theapollo-server-lambda
was that it imported GQL Playground and famousbusboy
lib for handling file uploads, both of which we weren't using at all (GQL playground was used only on the Apollo Gateway Lambda).In order to see what else could be removed, I continued my research. The conclusion is that there are still packages that should NOT be in the bundle, like
ajv
(225kb),bson
(203kb),mime-db
(186kb), etc. I even sawbluebird
(186kb) in I18N GraphQL bundle 😱 🤯.Anyways, at the moment, I didn't had more time to go and check these, but this is something we'll certainly need to check. There might be a couple of easy wins there. For example,
bson
lib should go automatically go away with the introduction of DynamoDb, as we won't need the DB Proxy anymore (included incommodo-fields-storage-db-proxy
package). We won't be needing@commodo/fields-storage-ref
as well, which is additional 47kb.And so on, and so on...
Hopefully, we'll be able to revisit this before v5 launch.