Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit

Permalink
patch(server): bump @fastify/websocket to 10.0.1 (trpc#5592)
Browse files Browse the repository at this point in the history
  • Loading branch information
vafanassieff authored Mar 27, 2024
1 parent 1bd1056 commit 1c757e8
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 73 deletions.
4 changes: 2 additions & 2 deletions examples/fastify-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"test-start": "start-server-and-test 'node dist/server' http-get://localhost:2022 'node dist/client'"
},
"dependencies": {
"@fastify/websocket": "^7.1.2",
"@fastify/websocket": "^10.0.1",
"@trpc/client": "npm:@trpc/client@next",
"@trpc/server": "npm:@trpc/server@next",
"fastify": "^4.13.0",
"fastify": "^4.16.0",
"superjson": "^1.12.4",
"tslib": "^2.5.0",
"ws": "^8.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"dependencies": {},
"peerDependencies": {},
"devDependencies": {
"@fastify/websocket": "^7.1.2",
"@fastify/websocket": "^10.0.1",
"@tanstack/react-query": "^5.25.0",
"@types/aws-lambda": "^8.10.97",
"@types/express": "^4.17.17",
Expand All @@ -142,7 +142,7 @@
"devalue": "^4.0.0",
"eslint": "^8.56.0",
"express": "^4.17.1",
"fastify": "^4.13.0",
"fastify": "^4.16.0",
"fastify-plugin": "^4.5.0",
"hash-sum": "^2.0.0",
"myzod": "^1.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function fastifyTRPCPlugin<TRouter extends AnyRouter>(
...(opts.trpcOptions as unknown as WSSHandlerOptions<TRouter>),
});

fastify.get(prefix ?? '/', { websocket: true }, ({ socket }, req) =>
fastify.get(prefix ?? '/', { websocket: true }, (socket, req) =>
onConnection(socket, req.raw),
);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@cloudflare/workers-types": "^4.0.0",
"@fastify/busboy": "^2.0.0",
"@fastify/websocket": "^7.1.2",
"@fastify/websocket": "^10.0.1",
"@miniflare/core": "^2.9.0",
"@tanstack/react-query": "^5.25.0",
"@testing-library/dom": "^9.0.0",
Expand All @@ -29,7 +29,7 @@
"dataloader": "^2.2.2",
"devalue": "^4.0.0",
"eslint": "^8.56.0",
"fastify": "^4.13.0",
"fastify": "^4.16.0",
"fastify-plugin": "^4.5.0",
"jsdom": "^24.0.0",
"konn": "^0.7.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/tests/server/adapters/fastify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ function createServer(opts: ServerOptions) {
});

instance.register(async function (fastify) {
fastify.get('/ws', { websocket: true }, (connection) => {
connection.socket.on('message', (message) => {
connection.socket.send(message);
fastify.get('/ws', { websocket: true }, (socket) => {
socket.on('message', (message) => {
socket.send(message);
});
});
});
Expand Down
Loading

0 comments on commit 1c757e8

Please sign in to comment.