protobuf-ts icon indicating copy to clipboard operation
protobuf-ts copied to clipboard

Automatic message registry

Open fenos opened this issue 3 years ago • 5 comments

It will be hugely beneficial if we can create a registry of all proto messages automatically so that we don't need to pass typeRegistry for the Any type which is kind of annoying and hard to maintain.

The protobuf golang implementation does exactly this, whenever a proto generated file is imported it has line at the top of the file, something like:

registry.Register("ProtoMessage", ProtoMessage);

in fact the Any types are always automatically handled as far as the file is imported (and registered).

Definately a great development experience.

We can of course keep the typeRegistry option if we ever need to pass those manually in, otherwise it passes the registry by default

fenos avatar Jul 17 '21 12:07 fenos