Azure / azure-functions-durable-js

JavaScript library for using the Durable Functions bindings
https://www.npmjs.com/package/durable-functions
MIT License
128 stars 47 forks source link

Improve TypeScript experience in SDK v3 #416

Closed hossam-nasr closed 1 year ago

hossam-nasr commented 1 year ago

Based on discussions here and here, and related to issues #240 and #171.

The SDK has had some gaps in its support for TypeScript and exporting types (see #240, #171, and #352).

SDK v3 and support for the new programming model is a good chance to improve our types story and our TypeScript experience, which includes, but is not limited to:

  1. Ensuring all necessary types (e.g., type for orchestration and entity contexts) are exported from the root of the package (#171)
  2. Enrich and expand existing types (e.g., further define the OrchestrationHandler type)
  3. Ensure no publicly exported types have the I prefix
  4. Create TypeScript-specific samples and templates
  5. Strongly type our TypeScript code samples and docs
hossam-nasr commented 1 year ago

Discussed some offline. As part of this, we should also try to switch from autogeneration of .d.ts files, to manual authoring of them. This should would help us become more intentional about which types we export, and also address #352. To do this, we should:

  1. Move all types/interfaces that we should expose publicly to the types directory (in normal .ts files)
  2. Separate class implementations from declarations, and move declarations to the types directory (also in .ts files)
  3. Switch to manual .d.ts file generation

Work for points 2 and 3 is already being done

hossam-nasr commented 1 year ago

Closed by PRs: #446, #447, #450, #451, #470 Issues: #458, #455, #352

ejizba commented 1 year ago

NOTE: We removed the "breaking-change" label for this particular issue because I wanted to track each breaking change individually instead of in a roll-up issue. See Hossam's links above