Skip to content

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/[email protected] None +1 136 kB matteo.collina
npm/@fastify/[email protected] None +1 344 kB matteo.collina
npm/@trivago/[email protected] Transitive: environment +25 4.55 MB behraang
npm/@trpc/[email protected] None 0 258 kB katt
npm/@trpc/[email protected] None 0 720 kB katt
npm/@types/[email protected] None 0 166 kB types
npm/@types/[email protected] None +1 12.3 kB types
npm/@types/[email protected] None 0 5.91 kB types
npm/@types/[email protected] None +9 108 kB types
npm/@types/[email protected] None +2 253 kB types
npm/@types/[email protected] None 0 13.5 kB types
npm/@types/[email protected] None +1 870 kB types
npm/@types/[email protected] Transitive: filesystem, network +4 102 kB types
npm/@types/[email protected] None 0 2.17 MB types
npm/@types/[email protected] None 0 37.8 kB types
npm/@types/[email protected] None +2 1.69 MB types
npm/@types/[email protected] None +4 34.6 kB types
npm/@types/[email protected] None 0 6.17 kB types
npm/@types/[email protected] None 0 6.74 kB types
npm/@typescript-eslint/[email protected] Transitive: environment, filesystem +27 6.6 MB jameshenry
npm/@typescript-eslint/[email protected] Transitive: environment, filesystem +17 1.78 MB jameshenry
npm/[email protected] None +2 22.4 kB fengmk2
npm/[email protected] unsafe Transitive: environment, eval, filesystem +87 9.97 MB vercel-release-bot
npm/[email protected] None 0 19.9 kB lydell
npm/[email protected] environment, filesystem, unsafe Transitive: eval +53 4.83 MB ljharb
npm/[email protected] None 0 72.5 kB eslint-community-bot
npm/[email protected] environment, filesystem Transitive: eval, shell, unsafe +48 9.66 MB eslintbot
npm/[email protected] environment, filesystem, network Transitive: eval +20 877 kB wesleytodd
npm/[email protected] Transitive: eval +19 5.02 MB eomm
npm/[email protected] None +5 1.01 MB pi0

🚮 Removed packages: npm/@fastify/[email protected], npm/@fastify/[email protected], npm/@trivago/[email protected], npm/@trpc/[email protected], npm/@trpc/[email protected], npm/@trpc/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants