Skip to content
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

Expose add method on registry object #679

Closed
jafaircl opened this issue Jan 28, 2024 · 4 comments · Fixed by #899
Closed

Expose add method on registry object #679

jafaircl opened this issue Jan 28, 2024 · 4 comments · Fixed by #899

Comments

@jafaircl
Copy link

jafaircl commented Jan 28, 2024

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.

@timostamm
Copy link
Member

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 #708). For now, the best approach is to implement the interface yourself, and provide an add method.

This was referenced Jun 21, 2024
@timostamm
Copy link
Member

@jafaircl, #899 adds the function createMutableRegistry(), which creates a registry with a method add().

#898 adds a similar function to the upcoming version 2.

@vovaspace
Copy link

Hi!
Are there any updates on when it might be released to the v1?

@timostamm
Copy link
Member

@vovaspace, isn't it available in the latest v1? If not, can you open an issue? We'll take a look and cut a release, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants