Skip to content

Commit

Permalink
fix: use isomorphic-ws so client doesnt ship ws which depends on node
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Sep 17, 2023
1 parent 9b18bf4 commit c38f490
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
],
"dependencies": {
"@sinclair/typebox": "^0.31.8",
"isomorphic-ws": "^5.0.0",
"it-pushable": "^3.2.1",
"nanoid": "^4.0.2",
"ws": "^8.13.0"
Expand Down
2 changes: 1 addition & 1 deletion router/server.util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Static, TObject } from '@sinclair/typebox';
import { Procedure, ValidProcType } from './builder';
import { Procedure } from './builder';
import { TransportMessage, payloadToTransportMessage } from '../transport/message';
import { pushable } from 'it-pushable';
import type { Pushable } from 'it-pushable';
Expand Down
2 changes: 1 addition & 1 deletion transport/ws.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type WebSocket from 'ws';
import type WebSocket from 'isomorphic-ws';
import { Transport } from './types';
import { NaiveJsonCodec } from '../codec/json';
import { MessageId, OpaqueTransportMessage, TransportClientId } from './message';
Expand Down
3 changes: 2 additions & 1 deletion transport/ws.util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import http from 'http';
import WebSocket, { WebSocketServer } from 'ws';
import WebSocket from 'isomorphic-ws';
import { WebSocketServer } from 'ws';
import { Transport } from './types';
import { OpaqueTransportMessage } from './message';
import { WebSocketTransport } from './ws';
Expand Down

0 comments on commit c38f490

Please sign in to comment.