@fluidframework/tree 2.72.0 → 2.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +99 -0
- package/api-report/tree.alpha.api.md +17 -30
- package/dist/alpha.d.ts +3 -1
- package/dist/api.d.ts +6 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +2 -11
- package/dist/api.js.map +1 -1
- package/dist/codec/codec.d.ts +9 -2
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +9 -2
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +7 -2
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +24 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/index.d.ts +1 -1
- package/dist/codec/versioned/index.d.ts.map +1 -1
- package/dist/codec/versioned/index.js +2 -1
- package/dist/codec/versioned/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +12 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +5 -3
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +1 -0
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +31 -17
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +7 -3
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +23 -6
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +20 -4
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +53 -55
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -3
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -8
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +4 -2
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +4 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +8 -7
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +1 -2
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +29 -11
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +0 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +1 -3
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +3 -2
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/index.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +5 -3
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -0
- package/dist/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
- package/dist/feature-libraries/schemaChecker.js.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +0 -44
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +1 -52
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +0 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +12 -6
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +5 -8
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +2 -2
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -2
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +20 -9
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +4 -6
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +9 -7
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +2 -0
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +10 -0
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -0
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +5 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +7 -1
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +4 -6
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +128 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
- package/dist/simple-tree/api/tree.d.ts +1 -1
- package/dist/simple-tree/api/tree.js +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +3 -3
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +3 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +12 -5
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +26 -10
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -6
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +1 -2
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +1 -8
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +9 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +0 -1
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +13 -49
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +1 -5
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +2 -10
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +1 -5
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +15 -3
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +20 -8
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +27 -22
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +18 -15
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/tableSchema.d.ts +22 -52
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +141 -277
- package/dist/tableSchema.js.map +1 -1
- package/dist/util/arrayUtilities.d.ts +45 -0
- package/dist/util/arrayUtilities.d.ts.map +1 -0
- package/dist/util/arrayUtilities.js +76 -0
- package/dist/util/arrayUtilities.js.map +1 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +7 -2
- package/dist/util/index.js.map +1 -1
- package/lib/alpha.d.ts +3 -1
- package/lib/api.d.ts +6 -2
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +2 -13
- package/lib/api.js.map +1 -1
- package/lib/codec/codec.d.ts +9 -2
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +9 -2
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +7 -2
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +22 -0
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/index.d.ts +1 -1
- package/lib/codec/versioned/index.d.ts.map +1 -1
- package/lib/codec/versioned/index.js +1 -1
- package/lib/codec/versioned/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +12 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +5 -3
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +2 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +34 -20
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +6 -2
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -6
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +17 -2
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +55 -57
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -3
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -3
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +4 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +4 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +4 -3
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +1 -2
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +29 -11
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +0 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +0 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +2 -1
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/index.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +5 -3
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -0
- package/lib/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
- package/lib/feature-libraries/schemaChecker.js.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +0 -44
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +0 -51
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +0 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +13 -7
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +4 -7
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +2 -2
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +21 -10
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +4 -6
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +8 -6
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +2 -0
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +10 -0
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -0
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +8 -2
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +5 -7
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +122 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
- package/lib/simple-tree/api/tree.d.ts +1 -1
- package/lib/simple-tree/api/tree.js +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +3 -3
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +12 -5
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +25 -9
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -6
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +1 -2
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +2 -9
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +1 -2
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +15 -51
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +3 -7
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +3 -11
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +3 -7
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +15 -3
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +20 -8
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +28 -24
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +20 -17
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/tableSchema.d.ts +22 -52
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +143 -279
- package/lib/tableSchema.js.map +1 -1
- package/lib/util/arrayUtilities.d.ts +45 -0
- package/lib/util/arrayUtilities.d.ts.map +1 -0
- package/lib/util/arrayUtilities.js +69 -0
- package/lib/util/arrayUtilities.js.map +1 -0
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/package.json +21 -21
- package/src/api.ts +22 -11
- package/src/codec/codec.ts +10 -2
- package/src/codec/index.ts +1 -0
- package/src/codec/versioned/codec.ts +40 -2
- package/src/codec/versioned/index.ts +1 -0
- package/src/core/schema-stored/schema.ts +12 -1
- package/src/core/tree/detachedFieldIndexCodecs.ts +10 -3
- package/src/feature-libraries/README.md +1 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -0
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +52 -19
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +8 -3
- package/src/feature-libraries/chunked-forest/codec/format.ts +14 -4
- package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +7 -2
- package/src/feature-libraries/chunked-forest/codec/index.ts +1 -4
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +62 -9
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +24 -2
- package/src/feature-libraries/chunked-forest/index.ts +1 -1
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +86 -74
- package/src/feature-libraries/default-schema/index.ts +1 -9
- package/src/feature-libraries/forest-summary/format.ts +15 -9
- package/src/feature-libraries/index.ts +7 -5
- package/src/feature-libraries/modular-schema/comparison.ts +2 -3
- package/src/feature-libraries/modular-schema/fieldKind.ts +90 -13
- package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -3
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +6 -6
- package/src/feature-libraries/modular-schema/index.ts +0 -1
- package/src/feature-libraries/modular-schema/isNeverTree.ts +7 -8
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -13
- package/src/feature-libraries/object-forest/objectForest.ts +2 -6
- package/src/feature-libraries/optional-field/index.ts +1 -0
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
- package/src/feature-libraries/schema-index/codec.ts +10 -3
- package/src/feature-libraries/{default-schema/schemaChecker.ts → schemaChecker.ts} +4 -4
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +0 -2
- package/src/index.ts +3 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +0 -1
- package/src/shared-tree/sharedTree.ts +0 -70
- package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -6
- package/src/shared-tree-core/editManagerCodecs.ts +19 -7
- package/src/shared-tree-core/editManagerFormatCommons.ts +11 -12
- package/src/shared-tree-core/index.ts +6 -2
- package/src/shared-tree-core/messageCodecs.ts +32 -17
- package/src/shared-tree-core/messageFormat.ts +8 -6
- package/src/simple-tree/api/configuration.ts +17 -4
- package/src/simple-tree/api/index.ts +5 -0
- package/src/simple-tree/api/schemaFromSimple.ts +14 -6
- package/src/simple-tree/api/simpleSchemaCodec.ts +10 -9
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +135 -0
- package/src/simple-tree/api/tree.ts +1 -1
- package/src/simple-tree/core/allowedTypes.ts +1 -1
- package/src/simple-tree/core/index.ts +3 -1
- package/src/simple-tree/core/toStored.ts +42 -18
- package/src/simple-tree/core/treeNodeSchema.ts +1 -7
- package/src/simple-tree/core/treeNodeValid.ts +0 -2
- package/src/simple-tree/fieldSchema.ts +2 -11
- package/src/simple-tree/index.ts +6 -1
- package/src/simple-tree/leafNodeSchema.ts +1 -2
- package/src/simple-tree/node-kinds/array/arrayNode.ts +26 -75
- package/src/simple-tree/node-kinds/map/mapNode.ts +1 -15
- package/src/simple-tree/node-kinds/object/objectNode.ts +2 -17
- package/src/simple-tree/node-kinds/record/recordNode.ts +1 -15
- package/src/simple-tree/simpleSchema.ts +16 -3
- package/src/simple-tree/toStoredSchema.ts +54 -38
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +22 -17
- package/src/tableSchema.ts +110 -334
- package/src/util/arrayUtilities.ts +88 -0
- package/src/util/index.ts +6 -0
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +0 -15
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +0 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +0 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -76
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -158
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -245
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +0 -12
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +0 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +0 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -71
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -154
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -241
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
- package/src/feature-libraries/default-schema/defaultSchema.ts +0 -15
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +0 -108
- package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +0 -208
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +0 -344
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/tree",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.73.0",
|
|
4
4
|
"description": "Distributed tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -101,17 +101,17 @@
|
|
|
101
101
|
"temp-directory": "nyc/.nyc_output"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@fluid-internal/client-utils": "~2.
|
|
105
|
-
"@fluidframework/container-runtime": "~2.
|
|
106
|
-
"@fluidframework/core-interfaces": "~2.
|
|
107
|
-
"@fluidframework/core-utils": "~2.
|
|
108
|
-
"@fluidframework/datastore-definitions": "~2.
|
|
109
|
-
"@fluidframework/driver-definitions": "~2.
|
|
110
|
-
"@fluidframework/id-compressor": "~2.
|
|
111
|
-
"@fluidframework/runtime-definitions": "~2.
|
|
112
|
-
"@fluidframework/runtime-utils": "~2.
|
|
113
|
-
"@fluidframework/shared-object-base": "~2.
|
|
114
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
104
|
+
"@fluid-internal/client-utils": "~2.73.0",
|
|
105
|
+
"@fluidframework/container-runtime": "~2.73.0",
|
|
106
|
+
"@fluidframework/core-interfaces": "~2.73.0",
|
|
107
|
+
"@fluidframework/core-utils": "~2.73.0",
|
|
108
|
+
"@fluidframework/datastore-definitions": "~2.73.0",
|
|
109
|
+
"@fluidframework/driver-definitions": "~2.73.0",
|
|
110
|
+
"@fluidframework/id-compressor": "~2.73.0",
|
|
111
|
+
"@fluidframework/runtime-definitions": "~2.73.0",
|
|
112
|
+
"@fluidframework/runtime-utils": "~2.73.0",
|
|
113
|
+
"@fluidframework/shared-object-base": "~2.73.0",
|
|
114
|
+
"@fluidframework/telemetry-utils": "~2.73.0",
|
|
115
115
|
"@sinclair/typebox": "^0.34.13",
|
|
116
116
|
"@tylerbu/sorted-btree-es6": "^1.8.0",
|
|
117
117
|
"@types/ungap__structured-clone": "^1.2.0",
|
|
@@ -122,19 +122,19 @@
|
|
|
122
122
|
"devDependencies": {
|
|
123
123
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
124
124
|
"@biomejs/biome": "~1.9.3",
|
|
125
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
126
|
-
"@fluid-private/stochastic-test-utils": "~2.
|
|
127
|
-
"@fluid-private/test-dds-utils": "~2.
|
|
128
|
-
"@fluid-private/test-drivers": "~2.
|
|
125
|
+
"@fluid-internal/mocha-test-setup": "~2.73.0",
|
|
126
|
+
"@fluid-private/stochastic-test-utils": "~2.73.0",
|
|
127
|
+
"@fluid-private/test-dds-utils": "~2.73.0",
|
|
128
|
+
"@fluid-private/test-drivers": "~2.73.0",
|
|
129
129
|
"@fluid-tools/benchmark": "^0.51.0",
|
|
130
130
|
"@fluid-tools/build-cli": "^0.60.0",
|
|
131
131
|
"@fluidframework/build-common": "^2.0.3",
|
|
132
132
|
"@fluidframework/build-tools": "^0.60.0",
|
|
133
|
-
"@fluidframework/container-definitions": "~2.
|
|
134
|
-
"@fluidframework/container-loader": "~2.
|
|
135
|
-
"@fluidframework/eslint-config-fluid": "~2.
|
|
136
|
-
"@fluidframework/test-runtime-utils": "~2.
|
|
137
|
-
"@fluidframework/test-utils": "~2.
|
|
133
|
+
"@fluidframework/container-definitions": "~2.73.0",
|
|
134
|
+
"@fluidframework/container-loader": "~2.73.0",
|
|
135
|
+
"@fluidframework/eslint-config-fluid": "~2.73.0",
|
|
136
|
+
"@fluidframework/test-runtime-utils": "~2.73.0",
|
|
137
|
+
"@fluidframework/test-utils": "~2.73.0",
|
|
138
138
|
"@fluidframework/tree-previous": "npm:@fluidframework/tree@2.71.0",
|
|
139
139
|
"@microsoft/api-extractor": "7.52.11",
|
|
140
140
|
"@types/diff": "^3.5.1",
|
package/src/api.ts
CHANGED
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import type {
|
|
7
|
+
TreeView,
|
|
8
|
+
TreeViewAlpha,
|
|
9
|
+
TreeViewBeta,
|
|
10
|
+
ImplicitFieldSchema,
|
|
11
|
+
TreeViewConfiguration,
|
|
12
|
+
TreeViewConfigurationAlpha,
|
|
13
13
|
} from "./simple-tree/index.js";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Module entry points for retrieving alternate (alpha/beta) versions of tree APIs.
|
|
17
17
|
* For each API (usually a class) that has an alpha/beta version, add overloads to the function(s) below.
|
|
18
|
-
* In the future, `asBeta` may be added here too.
|
|
19
18
|
* These functions should only be used by external consumers, not referenced internally within the tree package, to avoid circular import dependencies.
|
|
20
19
|
*/
|
|
21
20
|
|
|
@@ -25,9 +24,21 @@ import {
|
|
|
25
24
|
*/
|
|
26
25
|
export function asAlpha<TSchema extends ImplicitFieldSchema>(
|
|
27
26
|
view: TreeView<TSchema>,
|
|
28
|
-
): TreeViewAlpha<TSchema
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
): TreeViewAlpha<TSchema>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve the {@link TreeViewConfigurationAlpha | alpha API} for a {@link TreeViewConfiguration}.
|
|
31
|
+
* @alpha
|
|
32
|
+
*/
|
|
33
|
+
export function asAlpha<TSchema extends ImplicitFieldSchema>(
|
|
34
|
+
view: TreeViewConfiguration<TSchema>,
|
|
35
|
+
): TreeViewConfigurationAlpha<TSchema>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Implementation of overloads for {@link asAlpha}.
|
|
39
|
+
*/
|
|
40
|
+
export function asAlpha(view: unknown): unknown {
|
|
41
|
+
return view;
|
|
31
42
|
}
|
|
32
43
|
|
|
33
44
|
/**
|
package/src/codec/codec.ts
CHANGED
|
@@ -501,7 +501,7 @@ export const FluidClientVersion = {
|
|
|
501
501
|
|
|
502
502
|
/**
|
|
503
503
|
* Fluid Framework Client 2.43 and newer.
|
|
504
|
-
*
|
|
504
|
+
* @remarks
|
|
505
505
|
* New formats introduced in 2.43:
|
|
506
506
|
* - SchemaFormatVersion.v2
|
|
507
507
|
* - MessageFormatVersion.v4
|
|
@@ -512,11 +512,19 @@ export const FluidClientVersion = {
|
|
|
512
512
|
|
|
513
513
|
/**
|
|
514
514
|
* Fluid Framework Client 2.52 and newer.
|
|
515
|
-
*
|
|
515
|
+
* @remarks
|
|
516
516
|
* New formats introduced in 2.52:
|
|
517
517
|
* - DetachedFieldIndexFormatVersion.v2
|
|
518
518
|
*/
|
|
519
519
|
v2_52: "2.52.0",
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Fluid Framework Client 2.73 and newer.
|
|
523
|
+
* @remarks
|
|
524
|
+
* New formats introduced in 2.73:
|
|
525
|
+
* - FieldBatchFormatVersion v2
|
|
526
|
+
*/
|
|
527
|
+
v2_73: "2.73.0",
|
|
520
528
|
} as const satisfies Record<string, MinimumVersionForCollab>;
|
|
521
529
|
|
|
522
530
|
/**
|
package/src/codec/index.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
|
-
import type {
|
|
8
|
+
import type { SemanticVersion } from "@fluidframework/runtime-utils/internal";
|
|
9
|
+
import { Type, type TSchema } from "@sinclair/typebox";
|
|
9
10
|
|
|
10
11
|
import type { JsonCompatibleReadOnly } from "../../util/index.js";
|
|
11
12
|
import {
|
|
@@ -66,7 +67,7 @@ export function makeVersionedValidatedCodec<
|
|
|
66
67
|
TContext = void,
|
|
67
68
|
>(
|
|
68
69
|
options: ICodecOptions,
|
|
69
|
-
supportedVersions: Set<
|
|
70
|
+
supportedVersions: Set<FormatVersion>,
|
|
70
71
|
schema: EncodedSchema,
|
|
71
72
|
codec: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,
|
|
72
73
|
): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> {
|
|
@@ -77,6 +78,43 @@ export function makeVersionedValidatedCodec<
|
|
|
77
78
|
);
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Creates a codec which always throws a UsageError when encoding or decoding, indicating that the format version is discontinued.
|
|
83
|
+
*/
|
|
84
|
+
export function makeDiscontinuedCodecVersion<
|
|
85
|
+
TDecoded,
|
|
86
|
+
TEncoded extends Versioned = JsonCompatibleReadOnly & Versioned,
|
|
87
|
+
TContext = unknown,
|
|
88
|
+
>(
|
|
89
|
+
options: ICodecOptions,
|
|
90
|
+
discontinuedVersion: FormatVersion,
|
|
91
|
+
discontinuedSince: SemanticVersion,
|
|
92
|
+
): IJsonCodec<TDecoded, TEncoded, TEncoded, TContext> {
|
|
93
|
+
const schema = Type.Object(
|
|
94
|
+
{
|
|
95
|
+
version:
|
|
96
|
+
discontinuedVersion === undefined
|
|
97
|
+
? Type.Undefined()
|
|
98
|
+
: Type.Literal(discontinuedVersion),
|
|
99
|
+
},
|
|
100
|
+
// Using `additionalProperties: true` allows this schema to be used when loading data encoded by older versions even though they contain additional properties.
|
|
101
|
+
{ additionalProperties: true },
|
|
102
|
+
);
|
|
103
|
+
const codec: IJsonCodec<TDecoded, TEncoded, TEncoded, TContext> = {
|
|
104
|
+
encode: (_: TDecoded): TEncoded => {
|
|
105
|
+
throw new UsageError(
|
|
106
|
+
`Cannot encode data to format ${discontinuedVersion}. The codec was discontinued in FF version ${discontinuedSince}.`,
|
|
107
|
+
);
|
|
108
|
+
},
|
|
109
|
+
decode: (data: TEncoded): TDecoded => {
|
|
110
|
+
throw new UsageError(
|
|
111
|
+
`Cannot decode data to format ${data.version}. The codec was discontinued in FF version ${discontinuedSince}.`,
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
return makeVersionedValidatedCodec(options, new Set([discontinuedVersion]), schema, codec);
|
|
116
|
+
}
|
|
117
|
+
|
|
80
118
|
/**
|
|
81
119
|
* Creates a codec which dispatches to the appropriate member of a codec family based on the version of
|
|
82
120
|
* data it encounters.
|
|
@@ -91,13 +91,24 @@ export enum ValueSchema {
|
|
|
91
91
|
export type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
* Declarative portion of a
|
|
94
|
+
* Declarative portion of a {@link FlexFieldKind}.
|
|
95
95
|
*
|
|
96
96
|
* @remarks
|
|
97
97
|
* Enough info about a field kind to know if a given tree is is schema.
|
|
98
|
+
*
|
|
99
|
+
* Note that compatibility between trees and schema is not sufficient to evaluate if a schema upgrade should be allowed.
|
|
100
|
+
* Currently schema upgrades are restricted to field kind changes which can not be cyclic (like version upgrades but not down grades).
|
|
101
|
+
* See {@link FlexFieldKind.allowsFieldSuperset} for more details.
|
|
98
102
|
*/
|
|
99
103
|
export interface FieldKindData {
|
|
104
|
+
/**
|
|
105
|
+
* Globally scoped identifier.
|
|
106
|
+
*/
|
|
100
107
|
readonly identifier: FieldKindIdentifier;
|
|
108
|
+
/**
|
|
109
|
+
* Bound on the number of children that fields of this kind may have.
|
|
110
|
+
* TODO: consider replacing this with numeric upper and lower bounds.
|
|
111
|
+
*/
|
|
101
112
|
readonly multiplicity: Multiplicity;
|
|
102
113
|
}
|
|
103
114
|
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
7
|
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
8
|
+
import {
|
|
9
|
+
getConfigForMinVersionForCollab,
|
|
10
|
+
lowestMinVersionForCollab,
|
|
11
|
+
} from "@fluidframework/runtime-utils/internal";
|
|
8
12
|
|
|
9
13
|
import {
|
|
10
14
|
type CodecTree,
|
|
@@ -31,9 +35,12 @@ import { brand } from "../../util/index.js";
|
|
|
31
35
|
function clientVersionToDetachedFieldVersion(
|
|
32
36
|
clientVersion: MinimumVersionForCollab,
|
|
33
37
|
): DetachedFieldIndexFormatVersion {
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
return brand(
|
|
39
|
+
getConfigForMinVersionForCollab(clientVersion, {
|
|
40
|
+
[lowestMinVersionForCollab]: DetachedFieldIndexFormatVersion.v1,
|
|
41
|
+
[FluidClientVersion.v2_52]: DetachedFieldIndexFormatVersion.v2,
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
export function makeDetachedFieldIndexCodec(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Libraries which plug into the [Core Libraries](../core/README.md) to provide specializations, either for performance, or compatibility with specific tools or use-cases.
|
|
4
4
|
|
|
5
|
-
This includes concrete implementations of abstractions used to parameterize `SharedTreeCore` (Like `Index` and `ChangeFamily`), or any other entry points to the `core` libraries
|
|
5
|
+
This includes concrete implementations of abstractions used to parameterize `SharedTreeCore` (Like `Index` and `ChangeFamily`), or any other entry points to the `core` libraries package (like `Forest`).
|
|
6
6
|
|
|
7
7
|
`SharedTreeCore` should be usable with alternative versions of anything within this library.
|
|
8
8
|
|
|
@@ -23,9 +23,9 @@ import {
|
|
|
23
23
|
type TreeChunk,
|
|
24
24
|
tryGetChunk,
|
|
25
25
|
type SchemaAndPolicy,
|
|
26
|
+
type SchemaPolicy,
|
|
26
27
|
} from "../../core/index.js";
|
|
27
28
|
import { getOrCreate } from "../../util/index.js";
|
|
28
|
-
import type { FullSchemaPolicy } from "../modular-schema/index.js";
|
|
29
29
|
import { isStableNodeIdentifier } from "../node-identifier/index.js";
|
|
30
30
|
|
|
31
31
|
import { BasicChunk } from "./basicChunk.js";
|
|
@@ -44,7 +44,7 @@ export interface Disposable {
|
|
|
44
44
|
*/
|
|
45
45
|
export function makeTreeChunker(
|
|
46
46
|
schema: TreeStoredSchemaSubscription,
|
|
47
|
-
policy:
|
|
47
|
+
policy: SchemaPolicy,
|
|
48
48
|
shouldEncodeIncrementally: IncrementalEncodingPolicy,
|
|
49
49
|
): IChunker {
|
|
50
50
|
return new Chunker(
|
|
@@ -113,7 +113,7 @@ export class Chunker implements IChunker {
|
|
|
113
113
|
|
|
114
114
|
public constructor(
|
|
115
115
|
public readonly schema: TreeStoredSchemaSubscription,
|
|
116
|
-
public readonly policy:
|
|
116
|
+
public readonly policy: SchemaPolicy,
|
|
117
117
|
public readonly sequenceChunkSplitThreshold: number,
|
|
118
118
|
public readonly sequenceChunkInlineThreshold: number,
|
|
119
119
|
public readonly uniformChunkNodeCount: number,
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
type EncodedNestedArrayShape,
|
|
47
47
|
type EncodedNodeShape,
|
|
48
48
|
type EncodedValueShape,
|
|
49
|
+
FieldBatchFormatVersion,
|
|
49
50
|
SpecialField,
|
|
50
51
|
} from "./format.js";
|
|
51
52
|
import type { IncrementalDecoder } from "./codecs.js";
|
|
@@ -246,6 +247,10 @@ export class IncrementalChunkDecoder implements ChunkDecoder {
|
|
|
246
247
|
);
|
|
247
248
|
|
|
248
249
|
const chunkDecoder = (batch: EncodedFieldBatch): TreeChunk => {
|
|
250
|
+
assert(
|
|
251
|
+
batch.version >= FieldBatchFormatVersion.v2,
|
|
252
|
+
0xc9f /* Unsupported FieldBatchFormatVersion for incremental chunks; must be v2 or higher */,
|
|
253
|
+
);
|
|
249
254
|
const context = new DecoderContext(
|
|
250
255
|
batch.identifiers,
|
|
251
256
|
batch.shapes,
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
jsonMinimizingFilter,
|
|
16
16
|
} from "./chunkCodecUtilities.js";
|
|
17
17
|
import type { EncodedFieldBatchGeneric } from "./formatGeneric.js";
|
|
18
|
+
import type { FieldBatchFormatVersion } from "./format.js";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* An identifier which can be compressed using {@link Counter}.
|
|
@@ -51,7 +52,7 @@ export type BufferFormat<TEncodedShape> = (
|
|
|
51
52
|
* Note that this modifies `buffer` to avoid having to copy it.
|
|
52
53
|
*/
|
|
53
54
|
export function updateShapesAndIdentifiersEncoding<TEncodedShape>(
|
|
54
|
-
version:
|
|
55
|
+
version: FieldBatchFormatVersion,
|
|
55
56
|
buffer: BufferFormat<TEncodedShape>[],
|
|
56
57
|
identifierFilter: CounterFilter<string> = jsonMinimizingFilter,
|
|
57
58
|
): EncodedFieldBatchGeneric<TEncodedShape> {
|
|
@@ -5,10 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
|
|
8
|
+
import {
|
|
9
|
+
getConfigForMinVersionForCollab,
|
|
10
|
+
lowestMinVersionForCollab,
|
|
11
|
+
} from "@fluidframework/runtime-utils/internal";
|
|
8
12
|
|
|
9
13
|
import {
|
|
10
14
|
type CodecTree,
|
|
11
15
|
type CodecWriteOptions,
|
|
16
|
+
FluidClientVersion,
|
|
12
17
|
type IJsonCodec,
|
|
13
18
|
makeVersionedValidatedCodec,
|
|
14
19
|
} from "../../../codec/index.js";
|
|
@@ -32,11 +37,17 @@ import {
|
|
|
32
37
|
|
|
33
38
|
import { decode } from "./chunkDecoding.js";
|
|
34
39
|
import type { FieldBatch } from "./fieldBatch.js";
|
|
35
|
-
import {
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
import {
|
|
41
|
+
type EncodedFieldBatch,
|
|
42
|
+
validVersions,
|
|
43
|
+
FieldBatchFormatVersion,
|
|
44
|
+
EncodedFieldBatchV1,
|
|
45
|
+
EncodedFieldBatchV2,
|
|
46
|
+
} from "./format.js";
|
|
38
47
|
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
39
48
|
import type { IncrementalEncodingPolicy } from "./incrementalEncodingPolicy.js";
|
|
49
|
+
import { uncompressedEncodeV1, uncompressedEncodeV2 } from "./uncompressedEncode.js";
|
|
50
|
+
import { schemaCompressedEncodeV1, schemaCompressedEncodeV2 } from "./schemaBasedEncode.js";
|
|
40
51
|
|
|
41
52
|
/**
|
|
42
53
|
* Reference ID for a chunk that is incrementally encoded.
|
|
@@ -119,11 +130,6 @@ export type FieldBatchCodec = IJsonCodec<
|
|
|
119
130
|
FieldBatchEncodingContext
|
|
120
131
|
>;
|
|
121
132
|
|
|
122
|
-
/**
|
|
123
|
-
* Get the write version for {@link makeFieldBatchCodec} based on the `minVersionForCollab` version.
|
|
124
|
-
* @privateRemarks
|
|
125
|
-
* TODO: makeFieldBatchCodec (and makeVersionDispatchingCodec transitively) should bake in this versionToFormat logic and the resulting codec can then support use with FluidClientVersion directly.
|
|
126
|
-
*/
|
|
127
133
|
/**
|
|
128
134
|
* Convert a MinimumVersionForCollab to write version for {@link FieldBatchCodec}.
|
|
129
135
|
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
@@ -131,8 +137,12 @@ export type FieldBatchCodec = IJsonCodec<
|
|
|
131
137
|
function clientVersionToFieldBatchVersion(
|
|
132
138
|
clientVersion: MinimumVersionForCollab,
|
|
133
139
|
): FieldBatchFormatVersion {
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
return brand(
|
|
141
|
+
getConfigForMinVersionForCollab(clientVersion, {
|
|
142
|
+
[lowestMinVersionForCollab]: FieldBatchFormatVersion.v1,
|
|
143
|
+
[FluidClientVersion.v2_73]: FieldBatchFormatVersion.v2,
|
|
144
|
+
}),
|
|
145
|
+
);
|
|
136
146
|
}
|
|
137
147
|
|
|
138
148
|
export function makeFieldBatchCodec(options: CodecWriteOptions): FieldBatchCodec {
|
|
@@ -146,8 +156,27 @@ export function makeFieldBatchCodec(options: CodecWriteOptions): FieldBatchCodec
|
|
|
146
156
|
0x935 /* Invalid write version for FieldBatch codec */,
|
|
147
157
|
);
|
|
148
158
|
|
|
149
|
-
|
|
150
|
-
|
|
159
|
+
let uncompressedEncodeFn: typeof uncompressedEncodeV1 | typeof uncompressedEncodeV2;
|
|
160
|
+
let schemaCompressedEncodeFn:
|
|
161
|
+
| typeof schemaCompressedEncodeV1
|
|
162
|
+
| typeof schemaCompressedEncodeV2;
|
|
163
|
+
let encodedFieldBatchType: typeof EncodedFieldBatchV1 | typeof EncodedFieldBatchV2;
|
|
164
|
+
switch (writeVersion) {
|
|
165
|
+
case FieldBatchFormatVersion.v1:
|
|
166
|
+
uncompressedEncodeFn = uncompressedEncodeV1;
|
|
167
|
+
schemaCompressedEncodeFn = schemaCompressedEncodeV1;
|
|
168
|
+
encodedFieldBatchType = EncodedFieldBatchV1;
|
|
169
|
+
break;
|
|
170
|
+
case FieldBatchFormatVersion.v2:
|
|
171
|
+
uncompressedEncodeFn = uncompressedEncodeV2;
|
|
172
|
+
schemaCompressedEncodeFn = schemaCompressedEncodeV2;
|
|
173
|
+
encodedFieldBatchType = EncodedFieldBatchV2;
|
|
174
|
+
break;
|
|
175
|
+
default:
|
|
176
|
+
unreachableCase(writeVersion);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return makeVersionedValidatedCodec(options, validVersions, encodedFieldBatchType, {
|
|
151
180
|
encode: (data: FieldBatch, context: FieldBatchEncodingContext): EncodedFieldBatch => {
|
|
152
181
|
for (const cursor of data) {
|
|
153
182
|
assert(
|
|
@@ -156,27 +185,31 @@ export function makeFieldBatchCodec(options: CodecWriteOptions): FieldBatchCodec
|
|
|
156
185
|
);
|
|
157
186
|
}
|
|
158
187
|
let encoded: EncodedFieldBatch;
|
|
188
|
+
let incrementalEncoder: IncrementalEncoder | undefined;
|
|
159
189
|
switch (context.encodeType) {
|
|
160
190
|
case TreeCompressionStrategy.Uncompressed:
|
|
161
|
-
encoded =
|
|
191
|
+
encoded = uncompressedEncodeFn(data);
|
|
162
192
|
break;
|
|
163
193
|
case TreeCompressionStrategyExtended.CompressedIncremental:
|
|
194
|
+
assert(
|
|
195
|
+
writeVersion >= FieldBatchFormatVersion.v2,
|
|
196
|
+
0xca0 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */,
|
|
197
|
+
);
|
|
198
|
+
// Incremental encoding is only supported for CompressedIncremental.
|
|
199
|
+
incrementalEncoder = context.incrementalEncoderDecoder;
|
|
164
200
|
case TreeCompressionStrategy.Compressed:
|
|
165
201
|
// eslint-disable-next-line unicorn/prefer-ternary
|
|
166
202
|
if (context.schema !== undefined) {
|
|
167
|
-
encoded =
|
|
203
|
+
encoded = schemaCompressedEncodeFn(
|
|
168
204
|
context.schema.schema,
|
|
169
205
|
context.schema.policy,
|
|
170
206
|
data,
|
|
171
207
|
context.idCompressor,
|
|
172
|
-
|
|
173
|
-
context.encodeType === TreeCompressionStrategyExtended.CompressedIncremental
|
|
174
|
-
? context.incrementalEncoderDecoder
|
|
175
|
-
: undefined,
|
|
208
|
+
incrementalEncoder,
|
|
176
209
|
);
|
|
177
210
|
} else {
|
|
178
211
|
// TODO: consider enabling a somewhat compressed but not schema accelerated encode.
|
|
179
|
-
encoded =
|
|
212
|
+
encoded = uncompressedEncodeFn(data);
|
|
180
213
|
}
|
|
181
214
|
|
|
182
215
|
break;
|
|
@@ -9,6 +9,7 @@ import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
|
9
9
|
import {
|
|
10
10
|
CursorLocationType,
|
|
11
11
|
type FieldKey,
|
|
12
|
+
type FieldKindData,
|
|
12
13
|
type FieldKindIdentifier,
|
|
13
14
|
type ITreeCursorSynchronous,
|
|
14
15
|
type TreeChunk,
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
forEachNode,
|
|
19
20
|
} from "../../../core/index.js";
|
|
20
21
|
import { getOrCreate } from "../../../util/index.js";
|
|
21
|
-
import type { FlexFieldKind } from "../../modular-schema/index.js";
|
|
22
22
|
|
|
23
23
|
import type { Counter, DeduplicationTable } from "./chunkCodecUtilities.js";
|
|
24
24
|
import {
|
|
@@ -57,7 +57,7 @@ export function compressedEncode(
|
|
|
57
57
|
anyFieldEncoder.encodeField(cursor, context, buffer);
|
|
58
58
|
batchBuffer.push(buffer);
|
|
59
59
|
}
|
|
60
|
-
return updateShapesAndIdentifiersEncoding(
|
|
60
|
+
return updateShapesAndIdentifiersEncoding(context.version, batchBuffer);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export type BufferFormat = BufferFormatGeneric<EncodedChunkShape>;
|
|
@@ -458,6 +458,10 @@ export const incrementalFieldEncoder: FieldEncoder = {
|
|
|
458
458
|
context.incrementalEncoder !== undefined,
|
|
459
459
|
0xc88 /* incremental encoder must be defined to use incrementalFieldEncoder */,
|
|
460
460
|
);
|
|
461
|
+
assert(
|
|
462
|
+
context.version >= FieldBatchFormatVersion.v2,
|
|
463
|
+
0xca1 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */,
|
|
464
|
+
);
|
|
461
465
|
|
|
462
466
|
const chunkReferenceIds = context.incrementalEncoder.encodeIncrementalField(
|
|
463
467
|
cursor,
|
|
@@ -519,7 +523,7 @@ export class EncoderContext implements NodeEncodeBuilder, FieldEncodeBuilder {
|
|
|
519
523
|
public constructor(
|
|
520
524
|
private readonly nodeEncoderFromPolicy: NodeEncoderPolicy,
|
|
521
525
|
private readonly fieldEncoderFromPolicy: FieldEncoderPolicy,
|
|
522
|
-
public readonly fieldShapes: ReadonlyMap<FieldKindIdentifier,
|
|
526
|
+
public readonly fieldShapes: ReadonlyMap<FieldKindIdentifier, FieldKindData>,
|
|
523
527
|
public readonly idCompressor: IIdCompressor,
|
|
524
528
|
/**
|
|
525
529
|
* To be used to encode incremental chunks, if any.
|
|
@@ -527,6 +531,7 @@ export class EncoderContext implements NodeEncodeBuilder, FieldEncodeBuilder {
|
|
|
527
531
|
* See {@link IncrementalEncoder} for more information.
|
|
528
532
|
*/
|
|
529
533
|
public readonly incrementalEncoder: IncrementalEncoder | undefined,
|
|
534
|
+
public readonly version: FieldBatchFormatVersion,
|
|
530
535
|
) {}
|
|
531
536
|
|
|
532
537
|
public nodeEncoderFromSchema(schemaName: TreeNodeSchemaIdentifier): NodeEncoder {
|
|
@@ -13,13 +13,14 @@ import {
|
|
|
13
13
|
IdentifierOrIndex,
|
|
14
14
|
ShapeIndex,
|
|
15
15
|
} from "./formatGeneric.js";
|
|
16
|
-
import type
|
|
16
|
+
import { brand, type Brand } from "../../../util/index.js";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The format version for the field batch.
|
|
20
20
|
*/
|
|
21
21
|
export const FieldBatchFormatVersion = {
|
|
22
22
|
v1: 1,
|
|
23
|
+
v2: 2,
|
|
23
24
|
} as const;
|
|
24
25
|
export type FieldBatchFormatVersion = Brand<
|
|
25
26
|
(typeof FieldBatchFormatVersion)[keyof typeof FieldBatchFormatVersion],
|
|
@@ -28,7 +29,7 @@ export type FieldBatchFormatVersion = Brand<
|
|
|
28
29
|
|
|
29
30
|
// Compatible versions used for format/version validation.
|
|
30
31
|
// TODO: A proper version update policy will need to be documented.
|
|
31
|
-
export const validVersions = new Set([FieldBatchFormatVersion
|
|
32
|
+
export const validVersions = new Set([...Object.values(FieldBatchFormatVersion)]);
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Top level length is implied from length of data array.
|
|
@@ -217,8 +218,17 @@ export type EncodedNodeShape = Static<typeof EncodedNodeShape>;
|
|
|
217
218
|
export type EncodedAnyShape = Static<typeof EncodedAnyShape>;
|
|
218
219
|
export type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;
|
|
219
220
|
|
|
220
|
-
export const
|
|
221
|
-
FieldBatchFormatVersion.v1,
|
|
221
|
+
export const EncodedFieldBatchV1 = EncodedFieldBatchGeneric(
|
|
222
|
+
brand<FieldBatchFormatVersion>(FieldBatchFormatVersion.v1),
|
|
222
223
|
EncodedChunkShape,
|
|
223
224
|
);
|
|
225
|
+
export type EncodedFieldBatchV1 = Static<typeof EncodedFieldBatchV1>;
|
|
226
|
+
|
|
227
|
+
export const EncodedFieldBatchV2 = EncodedFieldBatchGeneric(
|
|
228
|
+
brand<FieldBatchFormatVersion>(FieldBatchFormatVersion.v2),
|
|
229
|
+
EncodedChunkShape,
|
|
230
|
+
);
|
|
231
|
+
export type EncodedFieldBatchV2 = Static<typeof EncodedFieldBatchV2>;
|
|
232
|
+
|
|
233
|
+
export const EncodedFieldBatch = Type.Union([EncodedFieldBatchV1, EncodedFieldBatchV2]);
|
|
224
234
|
export type EncodedFieldBatch = Static<typeof EncodedFieldBatch>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { type Static, type TSchema, Type } from "@sinclair/typebox";
|
|
7
|
+
import type { FieldBatchFormatVersion } from "./format.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Identifier OR Index of an identifier in the identifier list.
|
|
@@ -39,11 +40,14 @@ const EncodedFieldBatchBase = Type.Object(
|
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
42
|
* Format for encoding a tree chunk.
|
|
42
|
-
* @param version - format version.
|
|
43
|
+
* @param version - format version.
|
|
44
|
+
* Must be changed if the previously existing decode logic will not correctly handle the new encoding.
|
|
45
|
+
* If adding a new encoding version which does not use this format,
|
|
46
|
+
* this parameter should be retyped to be a union of the subset of FieldBatchFormatVersion values which this supports.
|
|
43
47
|
* @param shape - schema for union of shape format, see {@link DiscriminatedUnionDispatcher}.
|
|
44
48
|
*/
|
|
45
49
|
export const EncodedFieldBatchGeneric = <TShapeSchema extends TSchema>(
|
|
46
|
-
version:
|
|
50
|
+
version: FieldBatchFormatVersion,
|
|
47
51
|
shape: TShapeSchema,
|
|
48
52
|
// Return type is intentionally derived.
|
|
49
53
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -62,4 +66,5 @@ export const EncodedFieldBatchGeneric = <TShapeSchema extends TSchema>(
|
|
|
62
66
|
export interface EncodedFieldBatchGeneric<TEncodedShape>
|
|
63
67
|
extends Static<typeof EncodedFieldBatchBase> {
|
|
64
68
|
shapes: TEncodedShape[];
|
|
69
|
+
version: FieldBatchFormatVersion;
|
|
65
70
|
}
|
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export {
|
|
7
|
-
EncodedFieldBatch,
|
|
8
|
-
type FieldBatchFormatVersion,
|
|
9
|
-
} from "./format.js";
|
|
6
|
+
export { EncodedFieldBatch, FieldBatchFormatVersion } from "./format.js";
|
|
10
7
|
export type { FieldBatch } from "./fieldBatch.js";
|
|
11
8
|
export {
|
|
12
9
|
type FieldBatchCodec,
|