Closed vany0114 closed 1 year ago
Yes, Marshal is deprecated and entirely replaced with @deepkit/type. The latter should support everything Marshal did support plus a lot more. TS4.9 is not supported, as we wait for Angular to support it first. I've not tested whether TS v4.9 actually works or has major issues with Deepkit's transformer, but I'd go with the safe route and go with TS v4.8. You could try 4.9 though and report your issues. We should probably be able to sort them out in a short period of time.
So, yes, I'd recommend to move to Deepkit, as it is much more stable, more feature-rich, and is much more ergonomic compared to Marshal.
Feel free to report your issues in the issue tracker or ask questions about missing docs in our Discord server.
Thanks for the advice and the quick reply! we're gonna evaluate moving to TS 4.8 then since that's supported by @deepkit/type
, is there any documentation or examples available? we basically use the @f
annotation and the classToPlain
and plainToClass
apis from the @marcj/marshal
package.
The idea is that you don't need decorators anymore for basic type definition, only for validation and fancy stuff like embedding. For these you use "Type Decorators" (see docs). classToPlain(T, data) is now serialize<T>(data)
while plainToClass(T, data) is deserialize<T>(data)
.
I'm going to close this since it was answered
Hi @marcj quick question re @marcj/marshal
, does @marcj/marshal
support Node 18? I don't think so, right?
I don't think anything should break, but honestly I don't know
I'm asking because we're migrating to Node 18 and we're having some issues with serialization/deserialization 🤔
too bad. you should update to deepkit, since marshal is dead
It seems that the
@marcj/marshal
is now evolving to deepkit, however, we still use@marcj/marshal
for serialization/deserialization and we're in the process to migrate our code base to TS 4.9, however, we noticed some issues and it seems it's not working properly with that TS version, and I also noticed that the serialization indeepkit
seems to be in development, so what would you recommend, should we also migrate our project to usedeepkit
? the documentation around decorators seems to be incomplete.