refactor: rename context to step in job handler API#7
Conversation
BREAKING CHANGE: Job handler's first parameter renamed from `context` to `step`
This change aligns with Inngest's API design where `step.run()` reads more
naturally as "run a step" compared to the previous `context.run()`.
Changes:
- Rename `JobContext` type to `StepContext`
- Rename `createJobContext` to `createStepContext`
- Update all job handlers: `(context, payload)` → `(step, payload)`
- Update all step calls: `context.run()` → `step.run()`
- Update logging: `context.log` → `step.log`
- Update progress: `context.progress()` → `step.progress()`
- Rename website docs: api/context.md → api/step.md
Migration:
```ts
// Before
durably.defineJob("myJob", async (context, payload) => {
await context.run("step1", () => fetchData())
})
// After
durably.defineJob("myJob", async (step, payload) => {
await step.run("step1", () => fetchData())
})
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Breaking change: Job handler API renamed from `context` to `step` - JobContext → StepContext - createJobContext → createStepContext - Handler signature: (context, payload) → (step, payload) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughA large API rename: the job handler context and related APIs were renamed from "context"/JobContext to "step"/StepContext across code, tests, docs (English & Japanese), examples, and package metadata; streaming spec additions include StepContext stream APIs and JobHandle.subscribe in docs. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (45)
CHANGELOG.mdCLAUDE.mdREADME.mddocs/spec-streaming.mddocs/spec.mdexamples/browser/src/main.tsexamples/node/basic.tsexamples/react/src/App.tsxpackages/durably/README.mdpackages/durably/package.jsonpackages/durably/src/context.tspackages/durably/src/index.tspackages/durably/src/job.tspackages/durably/src/worker.tspackages/durably/tests/shared/concurrency.shared.tspackages/durably/tests/shared/job.shared.tspackages/durably/tests/shared/log.shared.tspackages/durably/tests/shared/plugin.shared.tspackages/durably/tests/shared/recovery.shared.tspackages/durably/tests/shared/run-api.shared.tspackages/durably/tests/shared/step.shared.tspackages/durably/tests/shared/worker.shared.tswebsite/.vitepress/config.tswebsite/api/context.mdwebsite/api/define-job.mdwebsite/api/events.mdwebsite/api/index.mdwebsite/api/step.mdwebsite/guide/events.mdwebsite/guide/getting-started.mdwebsite/guide/index.mdwebsite/guide/jobs-and-steps.mdwebsite/guide/react.mdwebsite/guide/resumability.mdwebsite/ja/api/context.mdwebsite/ja/api/define-job.mdwebsite/ja/api/events.mdwebsite/ja/api/index.mdwebsite/ja/api/step.mdwebsite/ja/guide/events.mdwebsite/ja/guide/getting-started.mdwebsite/ja/guide/index.mdwebsite/ja/guide/jobs-and-steps.mdwebsite/ja/guide/react.mdwebsite/ja/guide/resumability.md
💤 Files with no reviewable changes (2)
- website/api/context.md
- website/ja/api/context.md
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{js,ts,jsx,tsx}: Usedurably.defineJob()to define jobs with a context object and payload
Create steps viacontext.run()where each step's success state and return value is persisted
Use theretry()API for manual retry of failed runs; do not rely on automatic retry
Use dialect injection pattern - pass Kysely dialect tocreateDurably()to abstract SQLite implementations
Use event system for extensibility with events:run:start,run:complete,run:fail,step:*,log:write
In browser implementations, use SQLite WASM with OPFS backend for persistence
ConfigurepollingIntervaldefault to 1000ms,heartbeatIntervalto 5000ms, andstaleThresholdto 30000ms
Files:
examples/browser/src/main.tspackages/durably/src/job.tspackages/durably/src/worker.tsexamples/react/src/App.tsxpackages/durably/src/context.tsexamples/node/basic.tspackages/durably/tests/shared/concurrency.shared.tspackages/durably/tests/shared/worker.shared.tspackages/durably/tests/shared/log.shared.tspackages/durably/src/index.tspackages/durably/tests/shared/job.shared.tspackages/durably/tests/shared/step.shared.tspackages/durably/tests/shared/run-api.shared.tspackages/durably/tests/shared/plugin.shared.tspackages/durably/tests/shared/recovery.shared.ts
**/*.{js,ts}
📄 CodeRabbit inference engine (CLAUDE.md)
In Node.js implementations, use better-sqlite3 or libsql for database persistence
Files:
examples/browser/src/main.tspackages/durably/src/job.tspackages/durably/src/worker.tspackages/durably/src/context.tsexamples/node/basic.tspackages/durably/tests/shared/concurrency.shared.tspackages/durably/tests/shared/worker.shared.tspackages/durably/tests/shared/log.shared.tspackages/durably/src/index.tspackages/durably/tests/shared/job.shared.tspackages/durably/tests/shared/step.shared.tspackages/durably/tests/shared/run-api.shared.tspackages/durably/tests/shared/plugin.shared.tspackages/durably/tests/shared/recovery.shared.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: coji/durably PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T13:14:30.311Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Create steps via `context.run()` where each step's success state and return value is persisted
Learnt from: CR
Repo: coji/durably PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T13:14:30.311Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Use `durably.defineJob()` to define jobs with a context object and payload
📚 Learning: 2025-12-21T13:14:30.311Z
Learnt from: CR
Repo: coji/durably PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T13:14:30.311Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Create steps via `context.run()` where each step's success state and return value is persisted
Applied to files:
examples/browser/src/main.tswebsite/ja/api/define-job.mdpackages/durably/src/job.tspackages/durably/src/worker.tswebsite/ja/guide/resumability.mdwebsite/guide/events.mdwebsite/api/step.mdexamples/react/src/App.tsxpackages/durably/src/context.tswebsite/ja/api/step.mdexamples/node/basic.tswebsite/api/define-job.mdpackages/durably/tests/shared/concurrency.shared.tsCHANGELOG.mdpackages/durably/tests/shared/worker.shared.tswebsite/guide/resumability.mdwebsite/ja/guide/getting-started.mdREADME.mdpackages/durably/tests/shared/log.shared.tswebsite/guide/getting-started.mdwebsite/guide/jobs-and-steps.mdpackages/durably/src/index.tswebsite/ja/guide/jobs-and-steps.mdpackages/durably/tests/shared/job.shared.tswebsite/ja/api/index.mdpackages/durably/tests/shared/step.shared.tswebsite/api/index.mdpackages/durably/README.mdwebsite/ja/guide/events.mdCLAUDE.mdwebsite/guide/index.mdwebsite/ja/guide/index.mdpackages/durably/tests/shared/run-api.shared.tspackages/durably/tests/shared/plugin.shared.tswebsite/guide/react.mdpackages/durably/tests/shared/recovery.shared.tsdocs/spec.mddocs/spec-streaming.mdwebsite/ja/guide/react.md
📚 Learning: 2025-12-21T13:14:30.311Z
Learnt from: CR
Repo: coji/durably PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T13:14:30.311Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Use `durably.defineJob()` to define jobs with a context object and payload
Applied to files:
website/ja/api/define-job.mdpackages/durably/src/job.tspackages/durably/src/worker.tswebsite/guide/events.mdwebsite/api/step.mdexamples/react/src/App.tsxpackages/durably/src/context.tswebsite/ja/api/step.mdexamples/node/basic.tswebsite/api/define-job.mdpackages/durably/tests/shared/concurrency.shared.tsCHANGELOG.mdpackages/durably/tests/shared/worker.shared.tswebsite/ja/guide/getting-started.mdpackages/durably/tests/shared/log.shared.tswebsite/guide/jobs-and-steps.mdpackages/durably/src/index.tswebsite/ja/guide/jobs-and-steps.mdpackages/durably/tests/shared/job.shared.tswebsite/ja/api/index.mdpackages/durably/tests/shared/step.shared.tswebsite/api/index.mdpackages/durably/README.mdwebsite/ja/guide/events.mdCLAUDE.mdwebsite/guide/index.mdwebsite/ja/guide/index.mdpackages/durably/tests/shared/run-api.shared.tspackages/durably/tests/shared/plugin.shared.tswebsite/guide/react.mddocs/spec.mddocs/spec-streaming.mdwebsite/ja/guide/react.md
📚 Learning: 2025-12-21T13:14:30.311Z
Learnt from: CR
Repo: coji/durably PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T13:14:30.311Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Use event system for extensibility with events: `run:start`, `run:complete`, `run:fail`, `step:*`, `log:write`
Applied to files:
website/api/events.mdwebsite/ja/api/events.mdwebsite/guide/events.mdpackages/durably/tests/shared/log.shared.tswebsite/guide/jobs-and-steps.mdpackages/durably/src/index.tspackages/durably/tests/shared/step.shared.tswebsite/ja/guide/events.mdpackages/durably/tests/shared/plugin.shared.tsdocs/spec.mddocs/spec-streaming.mdwebsite/ja/guide/react.md
📚 Learning: 2025-12-21T13:14:30.311Z
Learnt from: CR
Repo: coji/durably PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T13:14:30.311Z
Learning: Ensure the same job definition code runs in both Node.js and browser environments
Applied to files:
examples/node/basic.ts
📚 Learning: 2025-12-21T13:14:30.311Z
Learnt from: CR
Repo: coji/durably PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T13:14:30.311Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Use the `retry()` API for manual retry of failed runs; do not rely on automatic retry
Applied to files:
website/guide/resumability.mdwebsite/guide/jobs-and-steps.mdwebsite/ja/guide/jobs-and-steps.mdpackages/durably/tests/shared/recovery.shared.ts
📚 Learning: 2025-12-21T13:14:30.311Z
Learnt from: CR
Repo: coji/durably PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T13:14:30.311Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Use dialect injection pattern - pass Kysely dialect to `createDurably()` to abstract SQLite implementations
Applied to files:
packages/durably/tests/shared/log.shared.tspackages/durably/tests/shared/step.shared.ts
📚 Learning: 2025-12-21T13:14:30.311Z
Learnt from: CR
Repo: coji/durably PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T13:14:30.311Z
Learning: In browser implementations, assume single tab usage (OPFS exclusivity) and handle background tab interruptions via heartbeat recovery
Applied to files:
docs/spec-streaming.md
🧬 Code graph analysis (3)
packages/durably/src/worker.ts (1)
packages/durably/src/context.ts (2)
createStepContext(9-156)run(23-112)
packages/durably/src/context.ts (3)
packages/durably/src/index.ts (2)
Run(40-40)StepContext(28-28)packages/durably/src/storage.ts (2)
Run(18-32)Storage(113-131)packages/durably/src/job.ts (1)
StepContext(8-32)
packages/durably/tests/shared/recovery.shared.ts (1)
packages/durably/src/context.ts (1)
run(23-112)
🔇 Additional comments (62)
CHANGELOG.md (1)
1-26: LGTM! Clear documentation of the breaking change.The CHANGELOG properly documents the API surface migration from
contexttostepwith a helpful migration example. The version bump to 0.2.0 is appropriate for this breaking change.packages/durably/src/worker.ts (2)
1-1: LGTM! Import updated correctly.The import change from
createJobContexttocreateStepContextaligns with the broader API refactoring.
192-194: LGTM! Step context creation and usage updated correctly.The refactoring consistently updates the variable name and method call from
contexttostep, maintaining the same functionality while aligning with the new Inngest-style API.packages/durably/package.json (1)
3-3: LGTM! Appropriate version bump for breaking change.The version bump from 0.1.1 to 0.2.0 correctly reflects the breaking API changes per semantic versioning.
website/.vitepress/config.ts (1)
58-58: LGTM! Navigation updated consistently across languages.The navigation links have been updated from Context to Step in both English and Japanese versions, aligning with the API documentation refactoring.
Also applies to: 115-115
website/ja/guide/resumability.md (2)
9-47: LGTM! Documentation examples updated consistently.All code examples have been correctly updated to use
step.run()instead ofcontext.run(), maintaining consistency with the new API while preserving the educational content about resumability and checkpointing.
82-133: LGTM! Idempotency and batch processing examples updated correctly.The examples demonstrating idempotent operations, non-idempotent operations with idempotency keys, and batch processing have all been correctly updated to use
step.run().examples/browser/src/main.ts (1)
31-52: LGTM! Browser example updated to use step-based API.The job handler has been correctly updated to use the
stepparameter and all internal calls have been changed fromcontext.run()tostep.run(), maintaining the same image processing workflow while aligning with the new API.packages/durably/tests/shared/job.shared.ts (1)
26-28: LGTM! Test handlers updated consistently.The test job handlers have been correctly updated to use the
_stepparameter (unused, hence the underscore prefix) instead of_context, maintaining test coverage while aligning with the new API surface.Also applies to: 108-114, 131-133
website/ja/api/events.md (1)
131-131: LGTM! Event documentation updated to reference step.log.The documentation correctly updates the reference from
context.logtostep.logto align with the refactored API, while maintaining accurate Japanese translation.website/api/events.md (1)
131-131: LGTM - Documentation correctly updated.The log:write event description now accurately reflects that logs are fired when
step.logmethods are called, consistent with the API rename.packages/durably/tests/shared/worker.shared.ts (2)
54-59: LGTM - Test correctly updated to step-based API.The job handler now uses the
stepparameter andstep.run()method, consistent with the API refactor.
150-152: LGTM - Unused parameters correctly prefixed.Good use of
_stepand_payloadprefixes for unused parameters in test callbacks.Also applies to: 197-200
packages/durably/tests/shared/step.shared.ts (2)
7-7: LGTM - Test suite title updated.The describe block now correctly references
step.run()instead ofcontext.run().
30-33: LGTM - All test handlers correctly updated.All job handler callbacks now use the
stepparameter andstep.run()method calls, maintaining test coverage while adopting the new API surface.Also applies to: 55-58, 85-89, 120-133, 178-195, 243-245, 268-274, 296-301
website/guide/jobs-and-steps.md (1)
14-18: LGTM - User guide correctly updated.The documentation now consistently shows the new API surface with
stepparameter andstep.run()method throughout all examples.Also applies to: 31-38, 52-58, 108-113
packages/durably/tests/shared/concurrency.shared.ts (1)
31-37: LGTM - Concurrency tests correctly updated.All job handlers now use the
stepparameter andstep.run()method. Test logic and concurrency behavior verification remain intact.Also applies to: 67-72, 103-108, 139-146
website/ja/api/define-job.md (1)
10-10: LGTM - Japanese documentation correctly updated.The Japanese API documentation now properly reflects the new
StepContexttype andstep.run()usage throughout all examples and signatures.Also applies to: 34-35, 83-103, 127-130
packages/durably/tests/shared/plugin.shared.ts (1)
40-42: LGTM - Plugin tests correctly updated.All job handlers now use the
stepparameter withstep.run()andstep.logmethods. Plugin event assertions remain properly covered.Also applies to: 78-80, 103-106, 131-134
CLAUDE.md (2)
16-17: LGTM - Core concepts documentation updated.The framework overview now correctly describes the step-based API with
step.run()for step creation.
1-53: Note: System learnings and coding guidelines are now outdated.The retrieved learnings and coding guidelines in this review still reference the old
context.run()API. While the code changes in this PR are correct, the system's knowledge base will need updating to reflect the newstep.run()API surface.This is informational only - not a code issue.
website/ja/guide/react.md (1)
269-283: LGTM! API rename applied correctly.The job handler parameter and all internal calls have been consistently updated from
contexttostep, maintaining the same functionality while aligning with the new Step-centric API.website/ja/guide/getting-started.md (2)
69-87: LGTM! Getting started examples updated correctly.The Node.js example correctly demonstrates the new
stepparameter andstep.run()usage pattern.
121-130: LGTM! Browser example updated consistently.The browser example follows the same pattern with the renamed API surface.
README.md (1)
49-60: LGTM! Primary README example updated correctly.The main usage example in the README now correctly demonstrates the new Step-centric API with
stepparameter andstep.run()calls.examples/react/src/App.tsx (1)
33-54: LGTM! React example updated correctly.The job handler demonstrates proper usage of the new
stepparameter with all three step executions (download, resize, upload) updated to usestep.run().website/guide/index.md (2)
27-40: LGTM! Guide documentation updated correctly.The introductory example correctly demonstrates the new API with
stepparameter andstep.run()calls for all three steps.
45-45: Good catch updating the feature description.The documentation text correctly references
step.run()in the feature list, maintaining consistency between code examples and prose.packages/durably/tests/shared/log.shared.ts (3)
7-7: LGTM! Test suite description updated.The test suite description correctly reflects the new
step.logAPI.
23-46: LGTM! Logging tests updated correctly.All test cases correctly use the new
stepparameter withstep.log.info()andstep.run()calls. Test assertions remain valid.
146-176: LGTM! Step scoping test updated correctly.The test correctly validates that logs inside
step.run()include the step name, while logs outside have null stepName. The test expectations remain accurate with the renamed API.website/api/step.md (1)
1-173: Excellent comprehensive Step API documentation.This new documentation thoroughly covers the Step object API with:
- Clear method signatures for
run(),log, andprogress()- Property documentation for
runIdandstepIndex- Practical examples demonstrating usage
- Best practices section covering naming conventions and common pitfalls
The documentation accurately reflects the new Step-centric API and provides valuable guidance for users migrating from the context-based API.
website/guide/resumability.md (2)
9-47: LGTM! Resumability examples updated correctly.The core resumability examples correctly demonstrate
step.run()behavior for both initial execution and resume scenarios. The documentation accurately explains how step persistence works with the new API.
78-133: LGTM! Idempotency and batching examples updated correctly.All examples demonstrating idempotent operations and batch processing patterns have been consistently updated to use
step.run(). The best practices guidance remains accurate and valuable.packages/durably/src/index.ts (1)
28-28: LGTM! Clean public API update.The export change from
JobContexttoStepContextis consistent with the broader API refactor and aligns well with the step-centric terminology introduced throughout the codebase.packages/durably/src/job.ts (2)
6-32: LGTM! Interface rename is consistent and clear.The rename from
JobContexttoStepContextbetter reflects the interface's purpose as the step execution context. The interface members and documentation remain intact.
37-40: LGTM! Function signature update aligns with the step-centric API.The parameter rename from
contexttostepmakes the API more intuitive and consistent with the step.run() pattern used throughout the codebase.website/api/define-job.md (1)
10-10: LGTM! Documentation is thorough and consistent.All references to the handler signature, parameter names, and method calls have been updated correctly to reflect the step-centric API. The cross-reference to
/api/step(line 34) is appropriate.Also applies to: 34-34, 83-104, 127-129
website/guide/react.md (1)
269-283: LGTM! React example updated correctly.The job definition example properly demonstrates the new step-centric API with
step.run()andstep.progress()calls. The code is clear and consistent with the broader API changes.website/api/index.md (1)
11-11: LGTM! API reference index is comprehensive and accurate.All references have been updated consistently:
- Navigation table points to the Step documentation
- Code examples use the step parameter and step.* methods
- Type exports list includes StepContext
Also applies to: 54-66, 76-76
website/ja/guide/index.md (1)
27-40: LGTM! Japanese documentation updated consistently.The Japanese guide reflects the step-centric API changes with proper usage of
stepparameter andstep.run()calls. The documentation text (line 45) correctly describes step-level persistence.Also applies to: 45-45
website/ja/guide/events.md (1)
72-86: LGTM! Events documentation updated correctly.The logging examples properly demonstrate the new
step.log.*API for emitting log events. All parameter names and method calls are consistent with the step-centric refactor.examples/node/basic.ts (1)
33-54: LGTM! Node.js example demonstrates the new API clearly.The image processing job correctly uses the
stepparameter andstep.run()calls for all three steps (download, resize, upload). The example serves as a good reference for users migrating to the new API.packages/durably/README.md (1)
49-60: LGTM! Clean API surface update.The example correctly demonstrates the new step-based API with the handler signature updated to
(step, payload)and all step operations usingstep.run(). The underlying job logic remains unchanged.website/guide/events.md (1)
72-93: LGTM! Event documentation accurately reflects the step-based API.The logging examples correctly show
step.log.info()usage and align with the updated event system wherelog:writefires when step.log methods are invoked.website/ja/api/step.md (1)
1-173: LGTM! Comprehensive Japanese API documentation for Step.This new documentation file provides thorough coverage of the Step API including methods (
run(),log,progress()), properties (runId,stepIndex), usage examples, and best practices. The content aligns well with the step-centric API design.packages/durably/src/context.ts (1)
3-14: LGTM! Type and export names correctly updated.The function has been properly renamed from
createJobContexttocreateStepContext, with matching updates to the import (StepContextfrom./job) and return type. The JSDoc comment accurately reflects the rename. The implementation remains unchanged, ensuring no behavior modification.website/guide/getting-started.md (2)
69-87: LGTM! Node.js quick start example correctly updated.The handler signature and all step operations properly use the step-based API. The example clearly demonstrates the resumable step pattern with
step.run().
121-130: LGTM! Browser quick start example correctly updated.The browser example consistently uses the step parameter and
step.run()for both fetch and save operations, maintaining alignment with the Node.js examples.packages/durably/tests/shared/run-api.shared.ts (4)
304-310: LGTM! Test correctly updated to step-based API.The triggerAndWait success test properly uses the
stepparameter andstep.run()method, maintaining test coverage while aligning with the new API surface.
331-344: LGTM! Failure test case correctly updated.The test demonstrates proper error handling with the step-based API, using
step.run('fail-step', ...)to verify job failure behavior.
378-393: LGTM! Timeout test correctly updated.The slow-step test case properly uses
step.run()to verify timeout behavior with the updated API.
396-484: LGTM! Progress tracking tests comprehensively updated.All progress-related tests correctly use
step.progress()with various parameter combinations. The test suite description on line 396 is properly updated tostep.progress(), and all test implementations consistently use the step parameter.website/ja/guide/jobs-and-steps.md (3)
14-17: LGTM! Job definition example correctly updated.The Japanese documentation properly shows the updated handler signature with the
stepparameter.
31-58: LGTM! Step creation examples consistently updated.All code examples correctly demonstrate
step.run()usage with proper Japanese explanations. The good/bad examples for step naming are clear and instructive.
108-114: LGTM! Error handling example correctly updated.The error handling section properly demonstrates error throwing within
step.run()using the updated API.website/ja/api/index.md (3)
11-11: LGTM! API reference table correctly updated.The core API table now properly references
Stepand links to the new/ja/api/stepdocumentation page.
57-66: LGTM! Quick reference examples correctly updated.The code snippets properly demonstrate the step-based API with
async (step, payload)signature andstep.run()/step.log.info()usage.
76-76: LGTM! Type exports correctly updated.The type exports section now properly lists
StepContextinstead of the oldJobContexttype, maintaining consistency with the renamed API surface.docs/spec.md (1)
50-50: LGTM! Documentation correctly updated to reflect step-centric API.The specification document has been systematically updated to use the new
stepparameter and method names (step.run(),step.log(),step.progress()) throughout all code examples, API descriptions, and narrative sections. The changes are consistent and accurately reflect the breaking API change introduced in v0.2.0.Also applies to: 72-79, 118-132, 333-336, 509-526, 549-564, 728-728, 748-748, 817-832
docs/spec-streaming.md (1)
36-53: LGTM! Future specification updated for consistency with current API.The streaming specification document (planned for v0.2+) has been updated to align with the step-centric API, including:
- Handler signatures using
(step, payload)pattern- Method calls using
step.run(),step.stream(),step.log()- Interface rename from
JobContexttoStepContext- Method signature
progress(current, total, message?)updatedThis ensures the future streaming features will be consistent with the current v0.2.0 API surface.
Also applies to: 209-224, 307-325, 333-486
packages/durably/tests/shared/recovery.shared.ts (1)
32-33: LGTM! Test code correctly updated to use step-centric API.All test cases have been systematically updated to use the new API:
- Handler parameter renamed:
context→step(or_stepwhen unused)- Method calls updated:
context.run()→step.run(),context.log→step.log(),context.runId→step.runId- Test assertions remain unchanged, confirming this is purely an API surface rename with no behavioral changes
Good practice observed on Line 207 using
_stepprefix for the unused parameter.Also applies to: 81-89, 153-161, 207-211, 281-285, 331-336, 443-458, 496-501, 535-538, 637-641
Summary
contexttostep(Inngest-style API)JobContext→StepContextcreateJobContext→createStepContextMigration
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Breaking Changes
New Features
Documentation
Chore
✏️ Tip: You can customize this high-level summary in your review settings.