Skip to content

Add global type registry #371

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

Closed
wants to merge 3 commits into from

Conversation

sessfeld
Copy link
Contributor

@sessfeld sessfeld commented Sep 7, 2022

When messages are imported, add them to a global type registry as a side-effect. That allows users to omit typeRegistry when interacting with Any.

I'm adding this a draft right now, because this definitely requires changes to the docs, and probably another test case. I'm also not sure about the typecast I'm using in jsonReadOptions and jsonWriteOptions. I originally did this implementation as a patch to the compiled package, so there were no types.

Closes #131

@sessfeld sessfeld marked this pull request as ready for review November 4, 2022 11:34
@timruffles
Copy link

Are you still working on this, and is there anything I can do to help? Would be very useful.

@sessfeld
Copy link
Contributor Author

Full disclosure: I haven't touched this PR since I opened it, but we've been using this implementation internally since then.

Where I was unsure is with the typecast that I had to do after the mergeJsonOptions, I have no idea if this is correct like this.

@timostamm
Copy link
Owner

Apologies for the late reply. I have to focus efforts on moving away from the TS compiler API for code gen, so that we can update to a more recent version of TS. It's a big effort, and side-effects in imports are controversial enough that I prefer to punt on them for now.

@timostamm timostamm closed this Apr 19, 2025
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 this pull request may close these issues.

Automatic message registry
3 participants