-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support type aliases #19
Comments
There is actually a built in way that might solve this with little changes to Wire. By pre-filling the typename/index lookup, we could acheive the same effect with better compression. But it would absolutely be possible to prefill the custom user type lookup. |
I was hoping that you would say something like that.... and yes, I also got the feeling from the code that the design had all the necessary building blocks already. I'll take a look at it when I need a break 😁 |
Here is the lookup that handles types to index lookup Those lists needs to be prefilled, the index is sequential so the user should really only supply an IEnumerable of types in the serializer options IMO. I think that would solve it, there could be more to it, but at the top of my head, that is it. |
I'm also having some difficulties converting my serialization from Newtonsoft without this. In my case, I actually need to do some additional logic to get a |
I am running into a similar issue as @mellinoe. My assemblies are being loaded manually from byte arrays by a framework (https://duality.adamslair.net/) and |
When I use Newtonsoft JSON.NET, I usually end up with a custom binder that allows me to configure short type names for the types I know will be serialized frequently.
This results in reduced overhead, as e.g. a simple
Date
value type otherwise serialized ascan become something like this:
If I understand correctly, Wire would serialize my
Date
type like this:which - if I could configure a type alias called
*Date
would be much more compact:How do you like this idea?
The text was updated successfully, but these errors were encountered: