Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Custom data converters #130

Closed
bergundy opened this issue Jun 18, 2021 · 2 comments · Fixed by #477
Closed

[Feature Request] Custom data converters #130

bergundy opened this issue Jun 18, 2021 · 2 comments · Fixed by #477
Assignees
Labels
enhancement New feature or request

Comments

@bergundy
Copy link
Member

At the moment there is no way of customizing the Workflow data converter.
This is a complex problem because of Workflows run in isolation and do not have access to node libraries.

While we're tacking this problem we might want to make the data converter interface asynchronous to facilitate network requests and non-blocking compression.

Solution requires a proper proposal in the proposals repo.

@bergundy bergundy added the enhancement New feature or request label Jun 18, 2021
@bergundy
Copy link
Member Author

#158 changes the data converter interface to be async.
Only thing left in this issue is to figure out how to pass a custom data converter to the Workflow isolate, all other places (worker / client) support custom data converters.

@bergundy bergundy added this to the beta milestone Jul 26, 2021
@bergundy bergundy self-assigned this Aug 29, 2021
@bergundy bergundy removed this from the beta milestone Sep 23, 2021
@bergundy
Copy link
Member Author

Removed from beta, we'll handle this soon after the release

@bergundy bergundy assigned lorensr and unassigned bergundy Mar 2, 2022
lorensr added a commit that referenced this issue Mar 2, 2022
- Adds custom data converter feature and changes the DataConverter API. Design doc: https://github.com/temporalio/sdk-typescript/tree/main/docs/data-converter.md
  ```ts
  interface DataConverter {
    payloadConverterPath?: string;
    payloadCodec?: PayloadCodec;
  }

  interface PayloadConverter {
    toPayload<T>(value: T): Payload | undefined;
    fromPayload<T>(payload: Payload): T;
  }

  interface PayloadCodec {
    encode(payloads: Payload[]): Promise<Payload[]>;
    decode(payloads: Payload[]): Promise<Payload[]>;
  }
  ```
  Note: Codec is not yet run on Payloads in interceptor headers.
- Unreverts #430 and modified the Protobuf data converter API: https://github.com/temporalio/sdk-typescript/tree/main/docs/protobuf-libraries.md#current-solution
- Separated `common` package into:
  ```
  common
  internal-workflow-common
  internal-non-workflow-common
  ```
  The new `common` only exports things you might want to use in your own common code (shared between client/worker/workflow) like data converters, failures, and errors. The default exports of `common` and `internal-workflow-common` are included in the Workflow bundle.
- Always include `assert` in the Workflow bundle.
- Closes #130
- Closes #237
- Closes #434
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants