ts-proto
ts-proto copied to clipboard
feat: support deprecatedOnly option to make deprecated fields optional
Add deprecatedOnly
option for useOptionals
option to make only deprecated fields optional. This PR aims to address the issue https://github.com/stephenh/ts-proto/issues/993
@stephenh thoughts on this PR appreciated. I figured deprecatedOnly
in useOptionals
config is practical solution but we could also have this as separate option.
Right now in our codebase, we don't use useOptional
config which forces developers to set the fields if it is marked as "required" (without optional). Even though we rarely depreciate required fields in our schemas, it is very annoying that we must still set deprecated required fields!
Hi @tufandevrim this seems pretty reasonable, see the one question about repeateds, but otherwise this lgtm!
Hi @tufandevrim this seems pretty reasonable, see the one question about repeateds, but otherwise this lgtm!
@stephenh yeah that was great feedback and made sense. Just updated the code to make deprecated repeated fields optional. Thanks again
@tufandevrim looks like a minor prettier error in main.ts
; can you fix it up? Thanks!
@tufandevrim looks like a minor prettier error in main.ts; can you fix it up? Thanks!
Oops! fixed now!
Sweet, thanks @tufandevrim !
:tada: This PR is included in version 1.170.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: