Skip to content

Additive schedule registration for TypeScript for file-splitting#5435

Draft
JasonAtClockwork wants to merge 4 commits into
masterfrom
jlarabie/ts-scheduled-table-cycle
Draft

Additive schedule registration for TypeScript for file-splitting#5435
JasonAtClockwork wants to merge 4 commits into
masterfrom
jlarabie/ts-scheduled-table-cycle

Conversation

@JasonAtClockwork

@JasonAtClockwork JasonAtClockwork commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Closes: #4571 - The secondary issue specifically

Description of Changes

  • New spacetime.schedule(table, reducerOrProcedure) API avoids forcing tables to import reducers
    • Fixes split table/reducer files creating circular TypeScript references with table({ scheduled })
  • Kept the existing table({ scheduled }) path working
  • Moved ScheduleAt column tracking onto table metadata
    • Lets the new schedule API resolve schedule-at columns without relying on legacy table options
    • Reuses the same schedule resolution path for legacy and new schedules

Other Options Considered

  • Rust-inspired schedule token/name handle
    • Closest conceptual match to Rust: table stores a schedule descriptor/name and the reducer binds the implementation separately
    • Avoids importing reducers from table definitions and could preserve type checking if the token carries the row type
    • Adds more API surface and abstraction, and needs careful design to avoid users managing fragile names manually
  • scheduled: 'reducerName' string/name in table(...)
    • Very simple and closest to the raw module-def storage model
    • Fully breaks the runtime import cycle
    • Loses compile-time signature checking unless paired with another checker/registration API, and typos become runtime/module validation errors
    • This basically is what we had before 2.0

API and ABI breaking changes

  • Adds new TypeScript API: spacetime.schedule(table, reducerOrProcedure)
  • No intended breaking changes to existing table({ scheduled }) behavior

Expected complexity level and risk

3 - Preserving legacy scheduled table behavior while changing how schedule metadata is assembled

Testing

  • Added new tests to cover the legacy schedule and new registration
  • Ran a local throwaway test project to test before and after for both legacy + new api

@JasonAtClockwork JasonAtClockwork self-assigned this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typescript scheduled tables fail to generate correctly

1 participant