docs: document TypeScript onSchedule reducer/procedure registration - #5728
docs: document TypeScript onSchedule reducer/procedure registration#5728cloutiertyler wants to merge 3 commits into
onSchedule reducer/procedure registration#5728Conversation
…5435) Document the additive schedule registration API from #5435: - Schedule Tables: lead the TypeScript example with onSchedule, note the one-scheduled-function-per-table constraint and file-splitting benefit, and demote the scheduled table-option thunk to a legacy callout - Scheduling Procedures: switch the example to procedure({ onSchedule }, ...) and note the t.unit() return requirement - Cheat sheet and reducer-context examples updated to the new syntax migrating-to-2.0 intentionally keeps the legacy syntax.
|
Docs review: no blocking findings. The new examples match the TypeScript implementation: I also verified locally on the PR head that One non-blocking docs nit: the lead TypeScript example in |
Add imports and schema setup so the recommended schedule-tables example is copy/pasteable, per review.
|
Addressed the docs nit in ef42cfc: the lead |
Description of Changes
#5435 added the
onScheduleoption toreducer()andprocedure()in the TypeScript bindings, but it was never documented. This PR documents it in the current (next) docs:00500-schedule-tables.md): the TypeScript tab now leads withonScheduleas the recommended registration form, explains that it removes the table→reducer forward reference (so the table and its scheduled function can live in separate files without an import cycle), notes the at-most-one-scheduled-function-per-table constraint, and demotes the legacyscheduled: (): any => reducerNametable option to a legacy callout.00300-reducers.md): example switched toprocedure({ onSchedule }, params, t.unit(), fn), with a note that a scheduled procedure must returnt.unit().migrating-to-2.0.mdintentionally keeps the legacy syntax since it documents the historical migration path.Testing
pnpm buildindocs/succeedsCloses nothing; follow-up documentation for #5435.