Feature Flags
Closed this issue · 2 comments
First off, thank you for this fantastic crate!
Overview
This crate exports over 200 structs, and compiling all of them takes a long time! It would be great if we could introduce feature flags so users can pull in the subset of types they need for their project.
Context
When running cargo bloat --time
on my project, I noticed aws_lambda_events
takes just under 30 seconds to compile, more than any other dependency in my project, and more than double the next worst crate (tokio).
I also found using aws_lambda_events
added ~4 seconds to my iterative debug build.
My Specific Use Case
My project is only using these four structs:
use aws_lambda_events::event::apigw::{
ApiGatewayProxyRequest, ApiGatewayProxyRequestContext, ApiGatewayProxyResponse, ApiGatewayRequestIdentity,
};
I'd love it if I could add default-features = false, features = ["apigw_proxy"]
to my Cargo.toml file to reduce code bloat and build times
Great idea!
I have the code for this in a branch, but I'm waiting to get other PRs merged before pushing these changes to avoid having many changes to review.