Skip to content

Add lambda gateway handler - #882

Closed
Lilja wants to merge 90 commits into
mainfrom
add-lambda-handler
Closed

Lilja wants to merge 90 commits into
mainfrom
add-lambda-handler

Conversation

@Lilja

@Lilja Lilja commented Sep 4, 2021 •

Copy link
Copy Markdown
Contributor

to do:

  • Add tests
  • Fix example
    • add yarn dev / build
    • add test-start / test dev
    • add to workflows.yml
    • mv app code to src folder
  • Remove TODO:s in code

closes #713

@vercel

vercel Bot commented Sep 4, 2021 •

Copy link
Copy Markdown

@KATT

KATT commented Sep 4, 2021

Copy link
Copy Markdown
Member

On your question, you just need to add a new enteypoint in package.json

Full docs https://preconstruct.tools/tutorials/multiple-entrypoints

@Lilja

Lilja commented Sep 4, 2021 •

Copy link
Copy Markdown
Contributor Author

you just need to add a new enteypoint in package.json

Looking at other examples, they don't use this preconstruct library as they can just import from @trpc/server. I see this going two ways for this PR.

  1. Don't include an example in this pr. That way I guess the definition of done is to create the handler + tests and validate that part is working. Submit a PR with examples later.

or

  1. Implement this preconstruct thing and include this in the same PR.

Which one do you prefer? ^^

@Lilja

Lilja commented Sep 4, 2021

Copy link
Copy Markdown
Contributor Author

Sorry for 10 million commits but i'm having a hard time installing the repo on my windows machine and running the test like a good developer should. I'll try to switch to my mac.
https://i.imgur.com/lyrCaeB.png

@KATT

KATT commented Sep 4, 2021

Copy link
Copy Markdown
Member

No worries. Will squash anyway.

Run yarn dev in root and in a separate terminal run yarn test --watch

@KATT

KATT commented Sep 4, 2021 •

Copy link
Copy Markdown
Member

you just need to add a new enteypoint in package.json

Looking at other examples, they don't use this preconstruct library as they can just import from @trpc/server. I see this going two ways for this PR.

  1. Don't include an example in this pr. That way I guess the definition of done is to create the handler + tests and validate that part is working. Submit a PR with examples later.

or

  1. Implement this preconstruct thing and include this in the same PR.

Which one do you prefer? ^^

The packages use preconstruct, as long as they have entrypoints (look at server's package json) you can simply use @trpc/server/adapter/x in the examples as soon as you've run a build.

@KATT

KATT commented Sep 4, 2021

Copy link
Copy Markdown
Member

Not tested it on windows at all so maybe it doesn't work 😅

# Conflicts:
#	packages/server/package.json
#	packages/server/src/adapters/node-http/types.ts
onError(o) {
opts?.onError?.({
...o,
req: event,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to createContext, I think this should receive event rather than req

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm -- this requires some refactoring of internals that'd be hard for @Lilja to do so ignore this and I'll sort it once you're done with the rest

@KATT

KATT commented Sep 13, 2021

Copy link
Copy Markdown
Member

Hey @Lilja - are you still keen on getting this in or have you lost interest & given up? :)

@Lilja

Lilja commented Sep 15, 2021

Copy link
Copy Markdown
Contributor Author

Sorry about the delay about this PR! I don't think I can progress further with my limited set of knowledge of this codebase. Feel free to pickup where I left off if you wish to pursue having this merged.

@KATT KATT added the ❄️ icebox features / PRs that might be pick up in the future and can be handy to keep track of label Sep 16, 2021
@KATT

KATT commented Sep 16, 2021

Copy link
Copy Markdown
Member

Closing this for now then.

@KATT KATT closed this Sep 16, 2021
@KATT KATT mentioned this pull request Oct 6, 2021
25 of 60 tasks
@Lilja

Lilja commented May 16, 2022

Copy link
Copy Markdown
Contributor Author

I would be interested in picking this up again. How much of the code base this has tried to integrate with has diverged since Iast touched it? Should I just create a new fork and copy some of the changes manually?

This was referenced May 17, 2022
@github-actions

github-actions Bot commented Oct 6, 2022

Copy link
Copy Markdown
Contributor

This pull request has been locked because it had no new activity for 30 days. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 6, 2022
@KATT
KATT deleted the add-lambda-handler branch November 22, 2022 09:47

This branch was successfully deployed

2 active deployments
Preview – todomvc — 62cf8c8a Deployed Sep 7, 2021 by vercel[bot]
Preview – www — 62cf8c8a Deployed Sep 7, 2021 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

♻️ autoupdate ❄️ icebox features / PRs that might be pick up in the future and can be handy to keep track of 🚧 wip work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants