Skip to content

Commit 904cffe

Browse files
committed
chore: Update readme to clarify initializeFieldsAsUndefined=false.
1 parent 1ce5921 commit 904cffe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ Generated code will be placed in the Gradle build directory.
530530

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

533-
- With `--ts_proto_opt=initializeFieldsAsUndefined=false`, all optional field initializers will be omitted from the generated base instances.
533+
- 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.
534534

535535
- 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.
536536

0 commit comments

Comments
 (0)