Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Use @types/aws-lambda for typings #18

Closed
wants to merge 2 commits into from

Conversation

lucacasonato
Copy link
Member

This gives access to all the AWS event types and responses.

The Event interface is gone and is replaced by different individual events like APIGatewayProxyEvent. There are now also results: APIGatewayProxyResult.

@hayd
Copy link
Contributor

hayd commented Dec 28, 2019

@lucacasonato fab! (sorry for the slow response), this looks good, I'll rerun the tests (for whatever reason they don't seem to run from other contributers), I suspect will need to update some references to Event... if Event is gone tests must fail. :)

Aside: I'm glad to remove Event as that's a browser global.

@hayd
Copy link
Contributor

hayd commented Dec 28, 2019

Ok, I have this working/passing tests. 672e4ea

One thing I am wondering about is whether we should vendorize the types (to deno.land/x/lambda/mod.d.ts or something), that way it's a little easier for this to be included in the DENO_DIR... That said, it should be in the layer anyway since we do deno fetch hello.ts prior to zipping up.

@lucacasonato
Copy link
Member Author

It might be a good idea to move it into this repo - we wouldn't be reliant on unpkg being up then. It would make updating the version slightly more work though.


I'll rerun the tests (for whatever reason they don't seem to run from other contributers)

You can change that here I think: https://github.com/hayd/deno-lambda/settings/actions.

@hayd
Copy link
Contributor

hayd commented Jan 3, 2020

Sorry for the delay, I will rip this band aid (I was waiting for 0.28.0 but since I might skip this version - #19) and merge this next week.

I'll write a tiny deno script which will download https://unpkg.com/@types/[email protected]/index.d.ts and include it in runtime, that way the version can be updated and run/committed.

Including it in the repo seems a little cleaner, the slightly more work seems worth it. :)

@lucacasonato
Copy link
Member Author

Sounds good. Deno 0.28.1 was just released to fix the linking to OpenSSL https://github.com/denoland/deno/releases/tag/v0.28.1.

@hayd
Copy link
Contributor

hayd commented Jan 5, 2020

cc @brianleroux here too, just to note this would be a breaking API change.

What we could do is keep the old Event... perhaps export Event = APIGatewayProxyEvent ?
Maybe best just to remove... IDK.

Note, the layer caches deno.land/x/lambda/mod.ts so this isn't breaking existing code if it uses the layer.

@brianleroux
Copy link
Contributor

thx for the heads up! nice thing about publishing to SAR is we get real semver so this shouldn't be an issue 👍

@hayd hayd mentioned this pull request Jan 11, 2020
@hayd hayd closed this in #23 Jan 11, 2020
@hayd
Copy link
Contributor

hayd commented Jan 11, 2020

Merged in #23. I will add SAR later this weekend (sorry for the delay).


I do wonder if we should define Event as APIGatewayProxyEvent so that existing examples work and since APIGateway is likely the most used case it would be simpler.. on the other hand APIGatewayProxyEvent is explicit. 🤷‍♂

@hayd
Copy link
Contributor

hayd commented Jan 11, 2020

Thanks @lucacasonato !

@hayd
Copy link
Contributor

hayd commented Jan 11, 2020

Is there a clever way for deno to work out which types are exported so they'd show in the documentation? e.g. use named export rather than * ?

https://deno.land/x/lambda/mod.ts?doc
(to make this non-empty!)

@lucacasonato
Copy link
Member Author

Not right now. export ... from ...; statements are currently ignored by the website.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants