Skip to content

feat: Initialize wRPC project structure and implement core features - #1

Merged
Alex-Dolid merged 7 commits into
mainfrom
feature/setup-repo
Aug 9, 2026
Merged

Alex-Dolid merged 7 commits into
mainfrom
feature/setup-repo

Conversation

@Alex-Dolid

Copy link
Copy Markdown
Contributor

This pull request sets up the initial scaffolding for the @alexify/wrpc project, establishing its configuration, development tooling, documentation, and core guidelines. It introduces a zero-dependency, WebSocket-based RPC protocol for Node.js and browsers, complete with CI, linting/formatting, and a benchmarking harness. The most important changes are summarized below.

Project configuration and documentation:

  • Added project documentation files: README.md (project overview, installation, usage, API reference), CHANGELOG.md (notable changes), SECURITY.md (security policy), and CLAUDE.md (guidance for Claude Code and repository conventions). [1] [2] [3] [4]

Development tooling and CI:

  • Added .editorconfig for consistent editor settings (2-space indent, single quotes, 120-char lines, etc.), and configuration for oxlint (.oxlintrc.json) and oxfmt (.oxfmtrc.json) to enforce code style and linting rules. [1] [2] [3]
  • Introduced a GitHub Actions CI workflow (.github/workflows/ci.yml) that runs linting, formatting, bundle-size checks, tests (on Node 22 and 24), and documentation builds.

Benchmarking:

  • Added a zero-dependency benchmark harness (bench/bench.js) to measure protocol hot path throughput, spinning up a real server and clients for round-trip performance tests.

These changes provide a strong foundation for the project, ensuring code quality, documentation, and performance measurement from the outset.

Set up the initial project structure for @alexify/wrpc, a WebSocket-based RPC library. Adds package.json with dependencies, pnpm workspace config, editor config, and tooling configuration for oxlint and oxfmt.
Set up the initial project foundation with Node/browser entry points, placeholder src/types exports, smoke and tsd tests, coverage/lint/format/size/bench scripts, and GitHub Actions CI (lint, test matrix, docs build). Added baseline docs and project metadata (README expansion, VitePress site skeleton, changelog, security policy, and Vercel config) while clearly marking the protocol implementation as not yet landed.
Add a full Metacom runtime with client/server RPC over HTTP and WebSocket, stream transport with chunk encoding/decoding, and a Service Worker proxy transport. Introduce a native WebSocket implementation (handshake, frames, parser, connection lifecycle, close/error handling) plus transport helpers and public exports. Include TypeScript declarations, encoder benchmark tooling, and broad test coverage across chunks, streams, client/server integration, proxy behavior, and WebSocket protocol compliance.
Ship the actual wRPC implementation and public surface: client/server, transports, stream/chunk handling, and the in-repo WebSocket stack, then wire it through `src/index.js` with a browser-safe `src/index.browser.js` entry. Rename the old Metacom naming to Wrpc (`Metacom`→`WrpcClient`, stream classes, proxy/events), add full hand-maintained `index.d.ts` types, and update package exports/imports plus docs/changelog to reflect the real API. Remove runtime dependency coupling by inlining required utilities (`Emitter`, JSON parsing, helpers) and splitting UUID runtime for node/browser, with broad test expansion and test file normalization to `*.test.js`.
Add a `bench/run-all.js` runner that executes every benchmark file in `bench/` sequentially and propagates failures. Update the `bench` package script and repository guidance so `pnpm bench` covers the whole benchmark directory instead of only `bench.js`.
Replace the module-load placeholder with real WrpcClient/Server round-trip
benchmarks, mirroring the setup in tests/integration.test.js: WS call
round-trip (small + 10KB payload), HTTP call round-trip, and WS call +
server event round-trip throughput.
Add bench/rpc-comparison.js, comparing wrpc's full client/server RPC
round-trip against an equivalent minimal echo RPC (same {id, method, args}
envelope) built on ws, uWebSockets.js, @fastify/websocket, and fastify-uws,
isolating transport overhead from protocol design. Each stack runs in its
own child process since raw uWebSockets.js and fastify-uws's bundled copy
of it segfault when loaded together. Extract the shared bench() harness and
wrpc echo-server setup out of bench/bench.js into bench/support/ so both
scripts reuse them. Adds ws, fastify, @fastify/websocket, fastify-uws, and
uWebSockets.js as devDependencies (benchmark-only; wrpc's runtime stays
zero-dependency).
@Alex-Dolid
Alex-Dolid merged commit 3b8e54b into main Aug 9, 2026
4 checks passed
@Alex-Dolid
Alex-Dolid deleted the feature/setup-repo branch August 9, 2026 18:14
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.

1 participant