Stephen Haberman
Stephen Haberman
Hm, are you using the latest version of ts-proto? In our test output, I see only a single `message.thing !== undeifned)` check, and not too: https://github.com/stephenh/ts-proto/blob/main/integration/simple/simple.ts#L328 Granted, per your core...
Fwiw @samelie I pushed a "re-codegen" commit to this PR that undoes a lot of `*.bin` file changes you'd had in here that come from having different versions of `protoc`....
Hey @aikoven ; sorry for not replying sooner, I got behind on ts-proto email/issue notifications and am finally working my way through them. I was thinking exact types would solve...
I also wonder if maybe this could be either a separate method, i.e. `Message.from`? And maybe a flag like `useFrom=simple,partial` that defaults to `partial` (current behavior, adds a `Message.fromPartial)` but...
@aikoven cool, sounds good. Just talking out loud, but maybe we could detect "already a full message" and skip the deep traversal, i.e. like add a hidden `message.__is_message__` marker attribute...
:tada: This issue has been resolved in version 1.92.0 :tada: The release is available on: - [npm package (@latest dist-tag)](https://www.npmjs.com/package/ts-proto/v/1.92.0) - [GitHub release](https://github.com/stephenh/ts-proto/releases/tag/v1.92.0) Your **[semantic-release](https://github.com/semantic-release/semantic-release)** bot :package::rocket:
> I don't ever create them using object literals Yeah, maybe I'll think about doing a breaking change that renames `fromPartial` to `create` and adds an option to keep`fromPartial` if...
I had another thought, what about using `class`es for message types? Granted, "just data instead of classes" is/was one of the main goals of ts-proto, so at first that seems...
> We use Jasmine and this is really picky about the prototype Ah shoot, I was just going to say, we could use prototype assignment w/o going all the way...
> really something that needs to be implemented here Yeah, good to sanity check that, but personally I'm pretty okay with trying to solve this in a general way /...