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

Generic types and Serializable #320

Closed
pvlugter opened this issue May 9, 2022 · 3 comments · Fixed by #333
Closed

Generic types and Serializable #320

pvlugter opened this issue May 9, 2022 · 3 comments · Fixed by #333
Assignees
Labels
kalix-runtime Runtime and SDKs sub-team

Comments

@pvlugter
Copy link
Member

pvlugter commented May 9, 2022

The Serializable type is currently a union that includes any, making the whole type any so it's untyped. The any should probably be object instead, as indicated by the original jsdoc type (which converts Object to any).

Generics could be used for classes, especially those that have state that can extend Serializable: entities and replicated data types. Type parameters can have defaults, so the previous behaviour can also be supported in the same way.

@johanandren
Copy link
Contributor

Is this completed with the three PRs merged @pvlugter or is there something more missing?

@pvlugter
Copy link
Member Author

Still more to do: entities, handlers, contexts.

@pvlugter
Copy link
Member Author

This will also affect codegen, which should use the typed versions instead of the generated workaround that it has currently. Probably worthwhile updating some codegen things at the same time, such as using Reply. Could also affect the generated testkit.js, which should really be part of the SDK directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kalix-runtime Runtime and SDKs sub-team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants