Commit c1d5c55
feat(sdk): add comprehensive JSDoc documentation for DurableContext API (#84)
- Add detailed JSDoc comments for all DurableContext methods
- Include comprehensive parameter descriptions and examples
- Document return types and error conditions
- Revert RetryDecision from discriminated union to interface for
compatibility
- Fix TypeScript compilation errors in examples package
*Description of changes:*
This commit significantly improves the developer experience in IDEs by
providing comprehensive JSDoc documentation for the DurableContext API.
Here's how it helps developers:
## IDE IntelliSense & Autocomplete Benefits
1. Rich Method Documentation
• Hover over any context.step(), context.parallel(), etc. to see
detailed descriptions
• Clear explanations of what each method does and when to use it
• Parameter descriptions with expected types and constraints
2. Interactive Code Examples
• Real TypeScript code examples appear in IDE tooltips
• Copy-paste ready snippets for common patterns
• Shows proper usage patterns and best practices
3. Parameter Guidance
• Detailed descriptions for each parameter (name, functions, configs)
• Type information with constraints (e.g., "must be unique within
execution")
• Optional vs required parameter clarity
4. Return Type Documentation
• Clear descriptions of what each method returns
• Promise resolution types and error conditions
• Helps with proper error handling and result processing
## Example IDE Experience
When typing context.step(, developers now see:
```
step(fn: StepFunc<T>, config?: StepConfig<T>): Promise<T>
Executes a step function with automatic retry and checkpointing capabilities.
Steps are the fundamental unit of work in durable functions...
Parameters:
• fn - The function to execute as a step
• config - Optional configuration for retry strategy and semantics
Example:
const result = await context.step(async () => {
return await apiCall();
}, { retryStrategy: ... });
```
This transforms the development experience from "figure it out yourself"
to "guided development with rich context."
Co-authored-by: Pooya Paridel <parpooya@amazon.com>1 parent 38a927c commit c1d5c55
File tree
9 files changed
+815
-93
lines changed- packages
- aws-durable-execution-sdk-js-examples/src/examples
- aws-durable-execution-sdk-js
- src
- context/durable-context
- handlers
- concurrent-execution-handler
- parallel-handler
- types
9 files changed
+815
-93
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
246 | 251 | | |
247 | 252 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
Lines changed: 37 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
282 | 289 | | |
283 | 290 | | |
284 | 291 | | |
| |||
295 | 302 | | |
296 | 303 | | |
297 | 304 | | |
298 | | - | |
299 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
300 | 314 | | |
301 | | - | |
| 315 | + | |
302 | 316 | | |
303 | 317 | | |
304 | 318 | | |
305 | 319 | | |
306 | | - | |
| 320 | + | |
307 | 321 | | |
308 | 322 | | |
309 | 323 | | |
| |||
322 | 336 | | |
323 | 337 | | |
324 | 338 | | |
325 | | - | |
326 | | - | |
327 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
328 | 349 | | |
329 | 350 | | |
330 | 351 | | |
331 | 352 | | |
332 | | - | |
| 353 | + | |
333 | 354 | | |
334 | 355 | | |
335 | 356 | | |
| |||
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
185 | 195 | | |
186 | 196 | | |
187 | 197 | | |
| |||
0 commit comments