-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
6.7.0 appears to introduce breaking changes to TypeScript tooling #741
Comments
Relevant issue: #717 Any instance of |
We have the concept of a
You can hopefully see that the nested entities are returned as This upsets the TypeScript compiler which is expecting a |
Ah, yes, that is intentional. When creating a message, submessages can be plain objects and hence are not necessarily an instance of the message class. The README now covers this in more detail (see also: Valid Message). |
OK. So can we rely upon the |
…age instances instead of $Properties, see #741
This now gives you an option $Properties is still there for the constructor and .create, but it now also enforces the provided plain object to exclusively contain actual instances instead of $Properties, which is a requirement to be able to document field types as actual message types instead of $Properties (the constructor and .create just copy those over). Hence, with |
Thanks @dcodeIO - I'll give it a try! |
Looks good - thanks for your help one again @dcodeIO! 👍 |
Actually - I there's a problem; it looks like the Long definition is no longer referenced as I get this:
|
Yeah, either install See: https://github.com/dcodeIO/protobuf.js#usage-with-typescript |
Thanks! |
protobuf.js version: 6.7.0
Hello!
We started experiencing failing builds this morning following the release of v6.7. With 6.7 in play we start to receive errors of this nature:
It looks as though the generated classes which previously contained payloads of a given type, eg
Something
, now contain payloads of a type likeSomething$Properties
. This may be more correct if the payloads received only contain the properties (I don't know if this is the case). Either way, this change has broken our code as it depends upon the entities beingSomething
rather thanSomething$Properties
.We're going to pin to 6.6.5 for now since that should resolve our immediate issue. But I wanted to raise it as it seems to be "breaking changes" if only from the TypeScript angle.
Also I wanted to clarify whether: the new tooling is more correct now or if this is a bug? I'm sorry that I can't share any code beyond my example code above; I'm happy to answer questions though.
Thanks for all your work!
The text was updated successfully, but these errors were encountered: