ICodecOptions Interface
Options relating to handling of persisted data.
To use, import via fluid-framework/alpha
.
For more information about our API support guarantees, see here.
Signature
export interface ICodecOptions
Properties
Property | Alerts | Modifiers | Type | Description |
---|---|---|---|---|
jsonValidator | Alpha |
readonly |
JsonValidator |
JsonValidator which SharedTree uses to validate persisted data it reads & writes matches the expected encoded format (i.e. the wire format for ops and summaries). See noopValidator and typeboxValidator for out-of-the-box implementations. This option is not "on-by-default" because JSON schema validation comes with a small but noticeable runtime performance cost, and popular schema validation libraries have relatively large bundle size. SharedTree users are still encouraged to use a non-trivial validator (i.e. not |
Property Details
jsonValidator
JsonValidator which SharedTree uses to validate persisted data it reads & writes matches the expected encoded format (i.e. the wire format for ops and summaries).
See noopValidator and typeboxValidator for out-of-the-box implementations.
This option is not "on-by-default" because JSON schema validation comes with a small but noticeable runtime performance cost, and popular schema validation libraries have relatively large bundle size.
SharedTree users are still encouraged to use a non-trivial validator (i.e. not noopValidator
) whenever reasonable: it gives better fail-fast behavior when unexpected encoded data is found, which reduces the risk of unrecoverable data corruption.
To use, import via fluid-framework/alpha
.
For more information about our API support guarantees, see here.
Signature
readonly jsonValidator: JsonValidator;
Type: JsonValidator