Skip to content

Submodules (TS) - #5823

Open
bradleyshep wants to merge 41 commits into
masterfrom
bradley/submodules
Open

Submodules (TS)#5823
bradleyshep wants to merge 41 commits into
masterfrom
bradley/submodules

Conversation

@bradleyshep

@bradleyshep bradleyshep commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

Adds reusable TypeScript submodules for SpacetimeDB, including:

  • Agents
  • API keys
  • Authentication
  • Cron
  • Crypto
  • Files
  • Grid
  • Lobby
  • PostHog
  • Presence
  • Rate limiting
  • Resend
  • Retry
  • Stripe

Each submodule includes package metadata, documentation, tests, and an example where applicable. The change also adds shared example UI code and connects the packages to the existing pnpm workspace, lint configuration, and CI workflow.

Example screenshots

Agents

Agents example

API Keys

API Keys example

Auth

Auth example

Cron

Cron example

Files

Files example

Grid

Grid example

Lobby

Lobby example

PostHog

PostHog example

Presence

Presence example

Rate Limit

Rate Limit example

Resend

Resend example

Stripe

Stripe example

API and ABI breaking changes

No existing API or ABI is changed. This PR adds new TypeScript package APIs.

Expected complexity level and risk

3/5

The change is large, but most code is isolated in new top-level submodule folders. The main risk is in scheduled work, native HTTP routes, and external provider integrations such as Stripe, Resend, and PostHog.

Testing

  • Build all submodule packages and examples
  • Run submodule unit and integration tests
  • Generate and verify TypeScript client bindings
  • Run lint and formatting checks
  • Test applicable examples against a local SpacetimeDB instance
  • Review the public package APIs and documentation
  • Run credentialed provider smoke tests in the reviewer environment

Rollback safety impact

n/a

Comment thread spacetime-agents-ts/example/server.ts Fixed
Comment thread spacetime-api-keys-ts/example/src/app.ts Fixed
Comment thread spacetime-auth-ts/example/server.ts Fixed
Comment thread spacetime-grid-ts/example/server.ts Fixed
Comment thread spacetime-presence-ts/example/public/ui.js Fixed
Comment thread spacetime-presence-ts/example/server.ts Fixed
Comment thread spacetime-resend-ts/scripts/test-resend-smoke.ts Fixed
Comment thread spacetime-stripe-ts/example/public/ui.js Fixed
Comment thread spacetime-presence-ts/example/public/ui.js Fixed
Comment thread spacetime-presence-ts/example/public/ui.js Fixed
@bradleyshep
bradleyshep marked this pull request as ready for review August 26, 2026 17:53

@cloutiertyler cloutiertyler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to break this into multiple PRs:

  1. A PR with just the high priority submodules that do not depend on fetch/async procs, and whose API we've carefully designed (e.g. cron, resend, agents ?)
  2. High priority ones that depend on fetch/async procs
  3. Low priority/nice to have ones ones (e.g. grid, lobby, api-keys)

Ale and I would like to make sure the APIs for all of these submodules are carefully designed because we're going to have to maintain them indefinitely. And with 1035 files in this PR it's a little too overwhelming to review.

@aasoni

aasoni commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

We also want to make sure we use the correct conventions for typescript variable naming. I saw at least in one README an example code that used snake case for variable names. We should make sure both the code and the README examples have variable names consistent with the typescript conventions. Usually:

Style Category
UpperCamelCase class / interface / type / enum / decorator / type parameters / component functions in TSX / JSXElement type parameter
lowerCamelCase variable / parameter / function / method / property / module alias

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.

5 participants