Skip to content

[2] Add default serializers and serializer type hints#19

Closed
mjameswh wants to merge 1 commit intomainfrom
serializer-cp2
Closed

[2] Add default serializers and serializer type hints#19
mjameswh wants to merge 1 commit intomainfrom
serializer-cp2

Conversation

@mjameswh
Copy link
Copy Markdown
Contributor

@mjameswh mjameswh commented Aug 6, 2025

What changed

  • Added default serializers: CompositeSerializer, NullSerializer, BinarySerializer and JsonSerializer.
  • ServiceRegistry now owns the serializer, receiving it as part of the ServiceRegistry initialization, rather than the serializer being somehow attached to each LazyValue.
  • Operation response value are now serialized appropriately.
  • Added "type hints" for an Operation's input and output; these type hints are passed to serializers. The Nexus SDK itself do not use those type hints, nor mandate the specific nature of those type hints.

@mjameswh mjameswh changed the title Add default serializers and serializer type hints [2] Add default serializers and serializer type hints Aug 6, 2025
@mjameswh mjameswh requested review from bergundy and dandavison August 6, 2025 15:08
Base automatically changed from handler-cp5 to main August 7, 2025 12:32
@bergundy bergundy removed their request for review November 17, 2025 23:45
@bergundy
Copy link
Copy Markdown
Contributor

Removed myself as a reviewer, please ask for another review if and when this becomes ready or close the PR if it is no longer needed.

import { it, describe } from "node:test";
import * as assert from "node:assert/strict";
import * as nexus from "../index";
import { defaultSerializers } from "../serialization/serializers";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not believe Nexus SDKs need to offer default serializers at this time. I think only Go does, and I think it did so prematurely as part of expected non-Temporal use. I think we should hold off on this until we're willing to commit to doing this across SDKs.

@VegetarianOrc
Copy link
Copy Markdown
Contributor

Given the direction of leaving serialization up to the protocol, I'm closing this out. Will use this as reference if we decide to revisit this.

@mjameswh mjameswh deleted the serializer-cp2 branch April 2, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants