Expose `add` method on registry object
Is it possible to expose the add method on the registry object so that we can add new message/enum/service types after the registry is created? Looking at the source code, it should really just be a typing update. The method already exists on the object. I’m happy to submit a PR to do it. But, I wanted to make sure there wasn’t a reason not to before doing that.
I’m working on a CEL implementation and it would be beneficial to allow users to supply their own registry and then add standard message types to that.
Hey @jafaircl, today, registries are very simple interfaces that do not allow mutation. And it wouldn't be trivial to add an add method to the interface because of cases like createRegistryFromDescriptors().
In the long term, we'd love to extend the capabilities (also see https://github.com/bufbuild/protobuf-es/issues/708). For now, the best approach is to implement the interface yourself, and provide an add method.
@jafaircl, https://github.com/bufbuild/protobuf-es/pull/899 adds the function createMutableRegistry(), which creates a registry with a method add().
https://github.com/bufbuild/protobuf-es/pull/898 adds a similar function to the upcoming version 2.