Skip to content

Fix TS builds, Lambda Runtime, Add Array input support, and fix tests #2

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

deldrid1
Copy link

Hi - I ran into some issues when attempting to use this with @trpc/server v11, and after digging in was impressed anything was working at all given the number of TypeScript issues!

I'm not 100% sure that I have everything exactly right, but tests are passing now and its working for my use case.

Copy link

socket-security bot commented Sep 12, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@fastify/cors@8.5.0 None +1 136 kB matteo.collina
npm/@fastify/swagger@8.15.0 None +1 344 kB matteo.collina
npm/@trivago/prettier-plugin-sort-imports@4.3.0 Transitive: environment +25 4.55 MB behraang
npm/@trpc/client@11.0.0-rc.502 None 0 258 kB katt
npm/@trpc/server@11.0.0-rc.502 None 0 720 kB katt
npm/@types/aws-lambda@8.10.145 None 0 166 kB types
npm/@types/co-body@6.1.3 None +1 12.3 kB types
npm/@types/cors@2.8.17 None 0 5.91 kB types
npm/@types/express@4.17.21 None +9 108 kB types
npm/@types/jest@29.5.12 None +2 253 kB types
npm/@types/jsonwebtoken@9.0.6 None 0 13.5 kB types
npm/@types/lodash.clonedeep@4.5.9 None +1 870 kB types
npm/@types/node-fetch@2.6.11 Transitive: filesystem, network +4 102 kB types
npm/@types/node@20.16.5 None 0 2.17 MB types
npm/@types/react-dom@18.3.0 None 0 37.8 kB types
npm/@types/react@18.3.5 None +2 1.69 MB types
npm/@types/swagger-ui-express@4.1.6 None +4 34.6 kB types
npm/@types/swagger-ui-react@4.18.3 None 0 6.17 kB types
npm/@types/uuid@9.0.8 None 0 6.74 kB types
npm/@typescript-eslint/eslint-plugin@5.62.0 Transitive: environment, filesystem +27 6.6 MB jameshenry
npm/@typescript-eslint/parser@5.62.0 Transitive: environment, filesystem +17 1.78 MB jameshenry
npm/co-body@6.2.0 None +2 22.4 kB fengmk2
npm/eslint-config-next@13.5.6 unsafe Transitive: environment, eval, filesystem +87 9.97 MB vercel-release-bot
npm/eslint-config-prettier@8.10.0 None 0 19.9 kB lydell
npm/eslint-plugin-import@2.30.0 environment, filesystem, unsafe Transitive: eval +53 4.83 MB ljharb
npm/eslint-plugin-promise@6.6.0 None 0 72.5 kB eslint-community-bot
npm/eslint@8.57.0 environment, filesystem Transitive: eval, shell, unsafe +48 9.66 MB eslintbot
npm/express@4.21.0 environment, filesystem, network Transitive: eval +20 877 kB wesleytodd
npm/fastify@4.28.1 Transitive: eval +19 5.02 MB eomm
npm/h3@1.12.0 None +5 1.01 MB pi0

🚮 Removed packages: npm/@fastify/cors@8.2.1, npm/@fastify/swagger@8.5.1, npm/@trivago/prettier-plugin-sort-imports@4.1.1, npm/@trpc/client@11.0.0-rc.467, npm/@trpc/server@10.45.2, npm/@trpc/server@11.0.0-rc.467, npm/@types/aws-lambda@8.10.115, npm/@types/co-body@6.1.0, npm/@types/cors@2.8.13, npm/@types/express@4.17.17, npm/@types/jest@29.5.1, npm/@types/jsonwebtoken@9.0.2, npm/@types/lodash.clonedeep@4.5.7, npm/@types/node-fetch@2.6.4, npm/@types/node@20.2.3, npm/@types/react-dom@18.2.4, npm/@types/react@18.2.6, npm/@types/swagger-ui-express@4.1.3, npm/@types/swagger-ui-react@4.18.0, npm/@types/uuid@9.0.1, npm/@typescript-eslint/eslint-plugin@5.59.7, npm/@typescript-eslint/parser@5.59.7, npm/co-body@6.1.0, npm/eslint-config-next@13.4.3, npm/eslint-config-prettier@8.8.0, npm/eslint-plugin-import@2.27.5, npm/eslint-plugin-promise@6.1.1, npm/eslint@8.41.0, npm/express@4.18.2, npm/fastify@4.17.0, npm/h3@1.6.6

View full report↗︎

@deldrid1
Copy link
Author

deldrid1 commented Sep 12, 2024

I did have to remove the nuxt example due to some peer dependency issues (I think the @next branch of @trpc/client isn't up to date with the fact that trpc-nuxt has a v11 beta which is frustrating...)

Copy link

socket-security bot commented Sep 12, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@@ -24,15 +24,15 @@
"examples/with-express",
"examples/with-interop",
"examples/with-serverless",
"examples/with-fastify",
"examples/with-nuxtjs"
Copy link
Owner

Choose a reason for hiding this comment

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

Is removal of with-nuxtjs intentional?

Copy link
Author

@deldrid1 deldrid1 Sep 13, 2024

Choose a reason for hiding this comment

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

with-fastify wasn't, but nuxt was. See the comment up above

Unfortunately, there are some peer dependency issues that prevented me from getting that one going. Rather than have npm install problems, I opted to just take it out here for the time being.

Copy link
Owner

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Nice work! Thank you!

path: queryPath,
procedure,
});
if(procedure._def.type === "mutation" || procedure._def.type === "query" ){
Copy link
Owner

Choose a reason for hiding this comment

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

This seems to exclude subscriptions from the cache. Is it your intention?

Copy link
Owner

Choose a reason for hiding this comment

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

Can you add some comments about the intention?

Copy link
Author

Choose a reason for hiding this comment

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

I don't think WebSockets or Server-sent Events (SSE) are being properly handled by openapi-trpc? Happy to revert this if you don't think its a valid change.

import type { RootConfig } from '@trpc/server/dist/core/internals/config';
import { TRPC_ERROR_CODE_KEY } from '@trpc/server/rpc';
import type { RouterDef } from '@trpc/server/src/core/router';
import type { APIGatewayProxyEvent, APIGatewayProxyEventV2 } from 'aws-lambda';
Copy link
Owner

Choose a reason for hiding this comment

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

I think an import of aws-lambda should be moved to non-shared file.

Copy link
Author

Choose a reason for hiding this comment

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

Its a type import so nothing runtime is affected - its only used during TypeScript builds of the project and is a devDependency. Can you justify the additional complexity of simply not listing it here?

deldrid1 and others added 2 commits September 18, 2024 16:33
Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
@deldrid1 deldrid1 changed the title Fix TS builds, Lambda Runtime, and tests Fix TS builds, Lambda Runtime, Add Array input support, and fix tests Sep 18, 2024
@kdy1 kdy1 closed this Sep 21, 2024
@kdy1 kdy1 reopened this Sep 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants