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

Let serializers get a type traits struct instead of the raw type. #1542

Merged
merged 5 commits into from Aug 17, 2016

Conversation

Projects
None yet
2 participants
@s-ludwig
Member

s-ludwig commented Aug 4, 2016

This is a breaking change for any serializer implementations. The expectation though is that the only existing seriailzer implementations are currently the ones in vibe.d itself.

The traits struct in particular carries UDA information, which allows serializers to support serializer specific UDAs. The code has also been refactored a bit to reduce line length/visual noise.

s-ludwig added some commits Aug 5, 2016

Let serializers get a type traits struct instead of the raw type.
The traits struct in particular carries UDA information, which allows serializers to support serializer specific UDAs. ***This is a breaking change for any serializer implementations**. The expectation though is that the only existing seriailzer implementations are currently the ones in vibe.d itself.
Add (begin/end)Write(Dictionary/Array)Entry serializer methods.
This enables the deserializer to access field attributes and other useful information.
@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Aug 5, 2016

Member

Cleaned up the diff and added beginWriteDocument/endWriteDocument, beginReadArrayEntry/endReadArrayEntry and beginReadDictionaryEntry/endReadDictionaryEntry.

Member

s-ludwig commented Aug 5, 2016

Cleaned up the diff and added beginWriteDocument/endWriteDocument, beginReadArrayEntry/endReadArrayEntry and beginReadDictionaryEntry/endReadDictionaryEntry.

s-ludwig added some commits Aug 5, 2016

@skoppe

This comment has been minimized.

Show comment
Hide comment
@skoppe

skoppe Aug 16, 2016

Contributor

The changes look pretty straightforward. I see no issues. (btw good idea to separate T => Traits rename)

Contributor

skoppe commented Aug 16, 2016

The changes look pretty straightforward. I see no issues. (btw good idea to separate T => Traits rename)

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Aug 17, 2016

Member

Thanks for reviewing! I still often do not manage to focus on doing a single thing at a time, so I had to rework the commit history quite heavily to get it to a reviewable state ;-)

BTW, I'll get to #1547 shortly (still in vacation, but maybe tomorrow when we are on the ferry), but it looks like what I had in mind for such an implementation.

Member

s-ludwig commented Aug 17, 2016

Thanks for reviewing! I still often do not manage to focus on doing a single thing at a time, so I had to rework the commit history quite heavily to get it to a reviewable state ;-)

BTW, I'll get to #1547 shortly (still in vacation, but maybe tomorrow when we are on the ferry), but it looks like what I had in mind for such an implementation.

@s-ludwig s-ludwig merged commit 50cbbbb into master Aug 17, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@skoppe

This comment has been minimized.

Show comment
Hide comment
@skoppe

skoppe Aug 17, 2016

Contributor

Hehe, I thought the best way to get your attention would be to review something :)

Contributor

skoppe commented Aug 17, 2016

Hehe, I thought the best way to get your attention would be to review something :)

@s-ludwig s-ludwig deleted the traits_based_serializers branch Oct 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment