Skip to content

Commit

Permalink
chore: Update readme to clarify initializeFieldsAsUndefined=false.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenh committed Jan 19, 2025
1 parent 1ce5921 commit 904cffe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ Generated code will be placed in the Gradle build directory.

- With `--ts_proto_opt=useNumericEnumForJson=true`, the JSON converter (`toJSON`) will encode enum values as int, rather than a string literal.

- With `--ts_proto_opt=initializeFieldsAsUndefined=false`, all optional field initializers will be omitted from the generated base instances.
- With `--ts_proto_opt=initializeFieldsAsUndefined=false`, all optional field initializers will be omitted from the generated base instances. This can be useful if you're using Next.js and `getServerSideProps`, see [#492](https://github.com/stephenh/ts-proto/issues/492). The default is `true` to ideally get the best v8 performance by avoiding "changing shapes" as fields are incrementally set.

- With `--ts_proto_opt=disableProto2Optionals=true`, all optional fields on proto2 files will not be set to be optional. Please note that this flag is primarily for preserving ts-proto's legacy handling of proto2 files, to avoid breaking changes, and as a result, it is not intended to be used moving forward.

Expand Down

0 comments on commit 904cffe

Please sign in to comment.