proto-socket/typescript
toki 518b37b379 perf(typescript): gateway 성능 row를 분리한다
default coordinator gateway와 explicit worker_threads 경로를 같은 성능 record에서 구분해야 병목 해석과 baseline 비교가 정확해진다.
2026-06-04 20:32:09 +09:00
..
bench perf(typescript): gateway 성능 row를 분리한다 2026-06-04 20:32:09 +09:00
crosstest chore: archive completed subtask 02+01_cross_baseline and update crosstest files across all languages 2026-06-03 05:14:16 +09:00
src feat: [G07] TS gateway row processing performance optimization 2026-06-04 19:08:38 +09:00
test feat: [G07] TS gateway row processing performance optimization 2026-06-04 19:08:38 +09:00
.gitignore feat: add typescript implementation and crosstest files 2026-04-24 07:16:37 +09:00
CROSSTEST_CHECKLIST.md feat: dart web crosstest and related test infrastructure updates 2026-05-30 22:59:23 +09:00
IMPLEMENTATION_CHECKLIST.md feat: add typescript implementation and crosstest files 2026-04-24 07:16:37 +09:00
package-lock.json feat: Dart Web E2E 테스트 및 크로스 테스트 추가 2026-05-25 00:30:37 +09:00
package.json feat: Dart Web E2E 테스트 및 크로스 테스트 추가 2026-05-25 00:30:37 +09:00
README.md 교차 테스트 프로세스 정리 및 문서 업데이트 (Go, Dart, TypeScript, Python) 2026-05-21 17:14:34 +09:00
tsconfig.json update: modify tsconfig, add stress test scripts and benchmarks, archive completed subtask 2026-06-02 19:28:30 +09:00

TypeScript Proto Socket

Status: available

This package implements Proto Socket protocol version 0.1 for TypeScript.

Scope

  • Runtime targets: Node.js TCP, Node.js WebSocket, browser native WebSocket.
  • Browser entrypoint (proto-socket): Communicator, BaseClient, BrowserWsClient, connectBrowserWs. Has no ws, node:*, or Buffer dependency.
  • Node entrypoint (proto-socket/node): all of the above plus TcpClient/TcpServer, NodeWsClient/NodeWsServer, connectNodeWs/connectNodeWss using Node.js built-ins.

Import

// browser
import { connectBrowserWs } from "proto-socket";

// node
import { connectNodeWs, NodeWsServer, TcpClient } from "proto-socket/node";

Runtime Dependencies

The TypeScript runtime has no non-protobuf package dependencies. The current canonical message codec and Node.js TCP/TLS/WebSocket transports are implemented with native platform APIs, so this package has no runtime dependencies at all.

Proto Sync

The canonical schema lives in ../proto/message_common.proto. The TypeScript packet codec in src/packets/ must stay wire-compatible with that schema. After proto changes, run from the repository root:

tools/check_proto_sync.sh

Validation

cd typescript
npx tsc --noEmit
npx vitest run
cd go
go run ./crosstest/go_typescript.go
cd dart
dart run crosstest/dart_typescript.dart
cd kotlin
./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinTypescriptKt
cd python
python3 crosstest/python_typescript.py
cd typescript
./node_modules/.bin/tsx crosstest/typescript_dart.ts
./node_modules/.bin/tsx crosstest/typescript_go.ts
./node_modules/.bin/tsx crosstest/typescript_kotlin.ts
./node_modules/.bin/tsx crosstest/typescript_python.ts