From caa214e3576d91c3d5b8dce4272d4af7eb4a8745 Mon Sep 17 00:00:00 2001 From: Alireza Haghshenas Date: Thu, 4 Jul 2024 11:46:21 -0700 Subject: [PATCH] docs: fix typo, add example to a hard-to-understand sentence --- docs/michelson_encoder.md | 5 +++-- website/versioned_docs/version-20.0.0/michelson_encoder.md | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/michelson_encoder.md b/docs/michelson_encoder.md index 9e9f69c391..d48294ae63 100644 --- a/docs/michelson_encoder.md +++ b/docs/michelson_encoder.md @@ -584,7 +584,8 @@ Token.fieldNumberingStrategy = 'Latest'; //To restore the default (new) behavior Please run the code above and check the output. -Please note how nested field numbers are not predictable. The field numbers are assigned in the order their parent were encountered during the traversal of the tree. +Please note how nested field numbers are not predictable. The field numbers are assigned in the order their parent were encountered during the traversal of the tree. For instance, in the above example, `approve` would get a field number of `1`. Because it has annotations, the field number is not used. But its nested fields would be numbered starting from `1` and not `2`. + While this behavior is not an error, it is prone to unexpected changes when the schema is modified. Also, predicting the field number of a specific field is not straightforward. With the release of Taquito version 20.0.0, we have made a breaking change in the Michelson Encoder package. The field numbering is now predictable and consistent. @@ -642,5 +643,5 @@ Below you can see a diff of the new versus old behavior: } } ``` -You can enable the old behavior by setting the `Token.fieldNumberingStrategy = 'Legacy'`. Please not that this value should stay the same for the whole application. +You can enable the old behavior by setting the `Token.fieldNumberingStrategy = 'Legacy'`. Please note that this value should stay the same for the whole application. The possible values are: `type FieldNumberingStrategy = 'Legacy' | 'ResetFieldNumbersInNestedObjects' | 'Latest';` For new applications, we recommend using the default value `Latest`. diff --git a/website/versioned_docs/version-20.0.0/michelson_encoder.md b/website/versioned_docs/version-20.0.0/michelson_encoder.md index 9e9f69c391..d48294ae63 100644 --- a/website/versioned_docs/version-20.0.0/michelson_encoder.md +++ b/website/versioned_docs/version-20.0.0/michelson_encoder.md @@ -584,7 +584,8 @@ Token.fieldNumberingStrategy = 'Latest'; //To restore the default (new) behavior Please run the code above and check the output. -Please note how nested field numbers are not predictable. The field numbers are assigned in the order their parent were encountered during the traversal of the tree. +Please note how nested field numbers are not predictable. The field numbers are assigned in the order their parent were encountered during the traversal of the tree. For instance, in the above example, `approve` would get a field number of `1`. Because it has annotations, the field number is not used. But its nested fields would be numbered starting from `1` and not `2`. + While this behavior is not an error, it is prone to unexpected changes when the schema is modified. Also, predicting the field number of a specific field is not straightforward. With the release of Taquito version 20.0.0, we have made a breaking change in the Michelson Encoder package. The field numbering is now predictable and consistent. @@ -642,5 +643,5 @@ Below you can see a diff of the new versus old behavior: } } ``` -You can enable the old behavior by setting the `Token.fieldNumberingStrategy = 'Legacy'`. Please not that this value should stay the same for the whole application. +You can enable the old behavior by setting the `Token.fieldNumberingStrategy = 'Legacy'`. Please note that this value should stay the same for the whole application. The possible values are: `type FieldNumberingStrategy = 'Legacy' | 'ResetFieldNumbersInNestedObjects' | 'Latest';` For new applications, we recommend using the default value `Latest`.