Skip to content

Create an RPC extension registry for WebSocket handlers #68

Open

Description

@harrryyd

What to build

apps/server/src/ws.ts (1661 lines, already with merge conflicts) inlines every RPC handler in a single switch block. Extract a registry pattern where new features register handlers without modifying ws.ts. Migrate todosLoad / todosMutate as the first consumer to prove the pattern.

Pattern

// Extension modules register themselves:
registerRpcMethod("todos.load", handleTodosLoad);
registerRpcMethod("todos.mutate", handleTodosMutate);

// ws.ts iterates registered handlers instead of a switch block

After migration, ws.ts should have no todo-specific imports or logic.

Acceptance criteria

  • RpcExtensionRegistry module exists in apps/server/src/rpc/ with registerRpcMethod(name, handler) API
  • ws.ts routes unknown methods to the registry instead of using a monolithic switch
  • Todo RPC handlers (todosLoad, todosMutate) migrated out of ws.ts into a standalone module
  • vp check passes
  • vp test passes
  • No behavior change to existing todo panel

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions