Skip to content

Conversation

@jsdt
Copy link
Contributor

@jsdt jsdt commented Jan 26, 2026

Description of Changes

This changes generated types in ts client bindings. We currently generate a few different types of types: reducer args, procedure args, rows, and user defined types. To avoid potential conflicts between these types (for example, if a user defined a type called FooRow, and also had a tabled named foo, we would end up with two types named FooRow), this puts each set of types in a different file and namespace. The main index file reexports each of those as its own namespace, so users can either import those namespaces or import specific types from the files. For example, if you had a message table and wanted the type of the rows, you could do either:

import { Rows } from './module_bindings';

var currentMessages: Rows.Message[] = [];

or

import {  Message } from './module_bindings/rows';
var currentMessages: Message[] = [];

This has a couple other changes:

  • For procedure and reducer types, this adds a suffix of Args, since we may want types for the return values in the future.
  • For all of the types, instead of exposing the schema object, we are now giving the typescript type (e.g. export type Message = __Infer<typeof MessageRow>;). I couldn't think of a reason for users to want the schema object, so this should save users from needing to do all of the Infer boilerplate.

API and ABI breaking changes

This is a breaking change for v2.

Expected complexity level and risk

  1. This only changes typescript, and it should generally make thing easier to use.

Testing

@jsdt jsdt changed the base branch from master to 2.0-breaking-changes January 26, 2026 19:55
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.

2 participants