Hi Vitali,

In general, the way we "remove" fields is by renaming them to add the
prefix "obsolete". As Ian points out, you can also change any pointer type
to AnyPointer, and enum types to UInt16, to allow you to delete the
referenced type definition.

This does leave unused space in your messages on the wire. That space will
be zero'd, so it compresses well, at least. You can also potentially reuse
the space for a new field *if* you are confident that all users of the old
field are gone. This of course tends to be easy to guarantee for internal
protocols and impossible for public ones.

-Kenton

On Wed, Nov 20, 2019 at 11:47 AM Vitali Lovich <vlov...@gmail.com> wrote:

> Hi,
>
> What's the equivalent process to removing a protobuf field in capnproto?
> In protobuf you could just delete it but for capnproto it looks like not
> only does it have to stick around so do it's type definition?
>
> So something like:
>
> Struct Foo {
>    deprecatedField @0 :Bar
> }
>
> Means I have to keep the definition for Bar around. Is there a process
> through which I can eventually get rid of Bar? Any recommendations on how
> to demarcate the deprecated field as "deleted"?
>
> The best I've come up with is to just delete the contents of Bar and
> change its name to indicate it's no longer used but wondering if there's a
> safer way (I'm guessing changing the field to Void won't work)
>
> Thanks,
> Vitali
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capnproto+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/capnproto/CAF8PYMhhqv6groL50Kbn_%3DRPrg4OJuKrxyxpO2qTiYz7onJi4w%40mail.gmail.com
> <https://groups.google.com/d/msgid/capnproto/CAF8PYMhhqv6groL50Kbn_%3DRPrg4OJuKrxyxpO2qTiYz7onJi4w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/CAJouXQ%3DzOGgpG8QdN%2BWB_KKJd_FQhGodVK_cbAC2pcHapRF-vQ%40mail.gmail.com.

Reply via email to