Automatic message registry
See original GitHub issueIt 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
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Automatic Replies (Out of Office) Not Working
Keep getting error message when trying to set Automatic Replies (Out of Office) see ... Locate and then click the following registry subkey:....
Read more >Send An Automated SMS Message When Registering A New ...
In this article, we show how easy it is to send an SMS message upon a new user registration using our Zapier integration....
Read more >Using the Message Registry - Oracle Help Center
The Message Registry works only for Dynamo Messages—that is, messages that adhere to the ... The Message Registry does this automatically, by default....
Read more >Setting Up an Autoresponder or Auto-reply
Instructions on how to set up an email autoresponder or out-of-office reply. Domain Registration Services' email auto-reply feature is very powerful and ...
Read more >How do I add a warning Logon message? - ITPro Today
Start the registry editor (regedit) · Move to HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Winlogon · Double Click the "LegalNoticeCaption", ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve seen this from a different perspective so far: Users have to import to register anyway - so it can just as well be completely explicit. This works out best in C#, where users can easily scan an assembly for messages and register. No funny import side effects, no need to maintain.
I see your point though, and think this is beneficial. It would just need
globalTypeRegistry
, exported from @protobuf-ts/runtime,globalTypeRegistry.push
for eachexport const MyMessage
in generated codetypeRegistry
to the global one.It would also need proper testing, and a documentation update. I’m super constrained at the moment, but if you could PR this I can take care of the docs.
@timostamm I’ll try to PR this weekend