serverless-http
serverless-http copied to clipboard
3.0 breaking changes?
Where can I find release notes for 3.0? Specifically I'd like to know about any breaking changes.
In looking at the commits, I don't personally see anything breaking. @dougmoscrop might have wanted a version bump for the Azure compatibility?
I merged a bunch of older contributor PRs, some that had no tests, and out of caution I didn't want people to pull in those changes (without review). The integration tests I wrote still passed.
I also dropped support (per engines stanza) for node 8 and 10.
I noticed that the return type of the handler changed from
export type Handler = (
event: AWSLambda.APIGatewayProxyEvent | AWSLambda.APIGatewayProxyEventV2,
context: AWSLambda.Context
) => Promise<AWSLambda.APIGatewayProxyResult | AWSLambda.APIGatewayProxyStructuredResultV2>;
to
export type Handler = (
event: Object,
context: Object
) => Promise<Object>;
Should we be casting now? Feels like a bit of a regression from a type safety perspective.
The intended use of this library is to be exported from a module that is being dynamically imported by a hosting provider at runtime, simply wrapping an existing application - honestly I don't think there really was type safety to begin with and I don't see a lot of value in maintaining it, save for making options a bit clearer.
For example, that above original signature is saying that you can give it either type of event and get back either type of response? Well that doesn't make sense, if you give it a V2, you would expect V2 back, so I guess it should be rewritten as a composite type of several kinds of handlers with explicit in/out
export type Handler = APIGatewayProxyHandler | ApiGatewayRestApiHandler | APIGatewayProxyV2Handler | AzureHandler
but then you'd still have to cast and it still doesn't change the fact that the actual runtime arguments are going to be controlled by a completely separate configuration in your IaC template
Fair point. Thanks for the info.
Can we at least get a CHANGELOG or entries in Releases?
I would appreciate some kind of Changelog and list of breaking changes in the future. Thanks for all the work regardless!