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

MemoryPack support #696

Open
SteveDunn opened this issue Nov 2, 2024 · 5 comments
Open

MemoryPack support #696

SteveDunn opened this issue Nov 2, 2024 · 5 comments

Comments

@SteveDunn
Copy link
Owner

SteveDunn commented Nov 2, 2024

          I'd love MemoryPack support to be added to Vogen.

Originally posted by @aradalvand in #305 (comment)

@SteveDunn SteveDunn changed the title MemoryPack support MemoryPack and MessagePack support Nov 13, 2024
@SteveDunn SteveDunn changed the title MemoryPack and MessagePack support MemoryPack support Nov 14, 2024
@SteveDunn
Copy link
Owner Author

@aradalvand - I started working on this, but hit a brick wall: MemoryPack uses source generators, but so does Vogen. There is no way to order which source generator runs first, so MP was emitting errors because value objects were empty (i.e. they hadn't been augmented with fields/constructors etc.)

This won't be a problem if the value objects are in a separate assembly.

@aradalvand
Copy link

aradalvand commented Nov 14, 2024

@SteveDunn You're right; I realized the same thing quickly after I suggested this :)
However, it would still have been possible for Vogen to support MemoryPack via generating custom formatters, if MemoryPack had support for this kind of thing. I've created an issue on their repo, but no response yet. MemoryPack effectively lacks proper extensibility points at the moment, until it adds the feature I described in that issue.

@aradalvand
Copy link

aradalvand commented Nov 14, 2024

This won't be a problem if the value objects are in a separate assembly.

Then we'd still be back to square one because the value objects would be considered "foreign" types that the user would have to manually write formatters for — see this other issue I created in MemoryPack's repo.

@aradalvand
Copy link

aradalvand commented Nov 14, 2024

The MessagePack is a big step forward & good enough for now; thanks for adding it.

@SteveDunn
Copy link
Owner Author

👍👍 I'll add the formatters as it'll still be useful for value objects in other assemblies.

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

No branches or pull requests

2 participants