mobxjs / serializr

Serialize and deserialize complex object graphs to and from JSON and Javascript classes
MIT License
766 stars 52 forks source link

Add support for embedded types #140

Open danfma opened 4 years ago

danfma commented 4 years ago

These changes will allow support for embedded types or maybe more powerful custom serializers. It allows the user to change the outputted object during the serialization/deserialization.

danfma commented 4 years ago

@NaridaL @mweststrate Should I update the README manually or did I miss any step? Locally, it looks to be working (build and tests). :)

pyrogenic commented 3 years ago

This is an interesting idea. I think inline might suggest its purpose more readily? As a decorator it would then read @serialize(inline(ClassName)).

I do see a lot of potential for property collisions or otherwise acting on a JSON element more than once, which gives me pause.

Interestingly, in my own work, I could use the opposite: I have to deal with wiretypes full of totally unnecessary object nesting.