serverless-http icon indicating copy to clipboard operation
serverless-http copied to clipboard

3.0 breaking changes?

Open memark opened this issue 2 years ago • 7 comments

Where can I find release notes for 3.0? Specifically I'd like to know about any breaking changes.

memark avatar Apr 12 '22 05:04 memark

In looking at the commits, I don't personally see anything breaking. @dougmoscrop might have wanted a version bump for the Azure compatibility?

Sparticuz avatar Apr 18 '22 19:04 Sparticuz

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.

dougmoscrop avatar Apr 19 '22 00:04 dougmoscrop

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.

agawley avatar Apr 26 '22 14:04 agawley

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

dougmoscrop avatar Apr 26 '22 16:04 dougmoscrop

Fair point. Thanks for the info.

agawley avatar Apr 26 '22 20:04 agawley

Can we at least get a CHANGELOG or entries in Releases?

shellscape avatar Jul 26 '22 15:07 shellscape

I would appreciate some kind of Changelog and list of breaking changes in the future. Thanks for all the work regardless!

Zeikko avatar Nov 24 '22 06:11 Zeikko