@fluidframework/tree 2.71.0 → 2.72.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 +26 -40
- package/api-report/tree.alpha.api.md +27 -18
- package/api-report/tree.beta.api.md +42 -0
- package/api-report/tree.legacy.beta.api.md +42 -0
- package/dist/alpha.d.ts +9 -7
- package/dist/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/beta.d.ts +7 -0
- package/dist/codec/codec.d.ts +16 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +16 -3
- package/dist/codec/codec.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/index.d.ts +1 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +2 -2
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +6 -6
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +6 -7
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +29 -8
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +8 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
- package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.js +3 -3
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/external-utilities/typeboxValidator.js +1 -1
- package/dist/external-utilities/typeboxValidator.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +12 -8
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +9 -4
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +1 -2
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
- 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 +1 -2
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -9
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +3 -21
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +4 -5
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +15 -4
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +8 -1
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +8 -3
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -1
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +2 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +5 -4
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +10 -10
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +22 -18
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -2
- package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +7 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +22 -15
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +12 -16
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +87 -127
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +12 -11
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +4 -2
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +1 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +19 -6
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +35 -17
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +43 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -4
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.js +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +11 -3
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts +2 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +19 -6
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +38 -21
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +50 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/messageFormat.js +51 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -8
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +3 -3
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +2 -2
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +4 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -52
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +61 -7
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +6 -3
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleSchemaCodec.js +292 -0
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -0
- package/dist/simple-tree/api/storedSchema.d.ts +2 -2
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +8 -6
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +2 -2
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +6 -6
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +78 -35
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +3 -3
- package/dist/simple-tree/core/allowedTypes.js +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -1
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -0
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +11 -3
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
- package/dist/simple-tree/simpleSchemaFormatV1.js +115 -0
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -0
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +1 -1
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +3 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +26 -2
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/brand.d.ts +31 -2
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +28 -2
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.d.ts +3 -1
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +3 -2
- package/dist/util/index.js.map +1 -1
- package/lib/alpha.d.ts +9 -7
- package/lib/api.js +2 -2
- package/lib/api.js.map +1 -1
- package/lib/beta.d.ts +7 -0
- package/lib/codec/codec.d.ts +16 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +16 -3
- package/lib/codec/codec.js.map +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/schema-stored/index.d.ts +1 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +1 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +6 -6
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +6 -7
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -2
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +29 -8
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +7 -0
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV1.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/external-utilities/typeboxValidator.js +1 -1
- package/lib/external-utilities/typeboxValidator.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +13 -8
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +8 -3
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -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 +1 -9
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +2 -20
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +4 -5
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +16 -5
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +8 -1
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +7 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +1 -0
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -2
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -5
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +10 -10
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +24 -20
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.js +2 -2
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -2
- package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js +2 -2
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +7 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +11 -4
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +12 -16
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +90 -130
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +7 -6
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +5 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +1 -3
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +19 -6
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +32 -16
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +42 -0
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +5 -5
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV5.js +2 -2
- package/lib/shared-tree-core/editManagerFormatV5.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +4 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts +2 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +19 -6
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +35 -20
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +50 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/messageFormat.js +48 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -8
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +3 -3
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +2 -2
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -2
- 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/schemaFactoryAlpha.d.ts +2 -98
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -52
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +58 -4
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +6 -3
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleSchemaCodec.js +264 -0
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -0
- package/lib/simple-tree/api/storedSchema.d.ts +2 -2
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +5 -3
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +2 -2
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +6 -6
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +75 -34
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +3 -3
- package/lib/simple-tree/core/allowedTypes.js +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -1
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -0
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +2 -2
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +11 -3
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
- package/lib/simple-tree/simpleSchemaFormatV1.js +112 -0
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -0
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +1 -1
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +3 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +23 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/brand.d.ts +31 -2
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +26 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/brandedMap.d.ts +3 -1
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js.map +1 -1
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/index.js.map +1 -1
- package/package.json +24 -24
- package/src/api.ts +2 -2
- package/src/codec/codec.ts +17 -3
- package/src/core/index.ts +1 -2
- package/src/core/schema-stored/index.ts +1 -2
- package/src/core/schema-stored/schema.ts +10 -7
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
- package/src/core/tree/detachedFieldIndexCodecV1.ts +4 -2
- package/src/core/tree/detachedFieldIndexCodecV2.ts +4 -6
- package/src/core/tree/detachedFieldIndexCodecs.ts +33 -11
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +17 -2
- package/src/core/tree/detachedFieldIndexFormatV1.ts +6 -4
- package/src/core/tree/detachedFieldIndexFormatV2.ts +6 -4
- package/src/core/tree/index.ts +2 -4
- package/src/external-utilities/typeboxValidator.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +18 -13
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/format.ts +15 -4
- package/src/feature-libraries/chunked-forest/codec/index.ts +4 -2
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +2 -2
- package/src/feature-libraries/chunked-forest/index.ts +0 -1
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +2 -29
- package/src/feature-libraries/forest-summary/codec.ts +24 -9
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
- package/src/feature-libraries/forest-summary/format.ts +12 -2
- package/src/feature-libraries/forest-summary/index.ts +2 -1
- package/src/feature-libraries/index.ts +1 -2
- package/src/feature-libraries/schema-edits/index.ts +0 -1
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +16 -16
- package/src/feature-libraries/schema-index/codec.ts +34 -22
- package/src/feature-libraries/schema-index/formatV1.ts +2 -2
- package/src/feature-libraries/schema-index/formatV2.ts +2 -2
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -1
- package/src/index.ts +3 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +16 -5
- package/src/shared-tree/sharedTree.ts +112 -172
- package/src/shared-tree/sharedTreeChangeCodecs.ts +15 -9
- package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
- package/src/shared-tree/treeAlpha.ts +6 -5
- package/src/shared-tree/treeCheckout.ts +1 -3
- package/src/shared-tree-core/editManagerCodecs.ts +56 -19
- package/src/shared-tree-core/editManagerFormatCommons.ts +47 -0
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +10 -5
- package/src/shared-tree-core/editManagerFormatV5.ts +3 -3
- package/src/shared-tree-core/index.ts +11 -5
- package/src/shared-tree-core/messageCodecV1ToV4.ts +6 -1
- package/src/shared-tree-core/messageCodecV5.ts +2 -1
- package/src/shared-tree-core/messageCodecs.ts +60 -26
- package/src/shared-tree-core/messageFormat.ts +56 -0
- package/src/shared-tree-core/sharedTreeCore.ts +11 -13
- package/src/simple-tree/api/discrepancies.ts +2 -2
- package/src/simple-tree/api/incrementalAllowedTypes.ts +1 -1
- package/src/simple-tree/api/index.ts +6 -2
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -168
- package/src/simple-tree/api/schemaFactoryBeta.ts +180 -14
- package/src/simple-tree/api/schemaFromSimple.ts +6 -3
- package/src/simple-tree/api/simpleSchemaCodec.ts +360 -0
- package/src/simple-tree/api/storedSchema.ts +8 -5
- package/src/simple-tree/api/tree.ts +2 -2
- package/src/simple-tree/api/typesUnsafe.ts +6 -6
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +80 -47
- package/src/simple-tree/core/allowedTypes.ts +3 -3
- package/src/simple-tree/core/treeNode.ts +2 -2
- package/src/simple-tree/index.ts +5 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +2 -2
- package/src/simple-tree/node-kinds/map/mapNode.ts +2 -2
- package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
- package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
- package/src/simple-tree/simpleSchema.ts +12 -3
- package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
- package/src/tableSchema.ts +5 -2
- package/src/treeFactory.ts +33 -1
- package/src/util/brand.ts +40 -2
- package/src/util/brandedMap.ts +3 -1
- package/src/util/index.ts +1 -0
package/src/index.ts
CHANGED
|
@@ -95,6 +95,7 @@ export {
|
|
|
95
95
|
type TreeViewEvents,
|
|
96
96
|
SchemaFactory,
|
|
97
97
|
SchemaFactoryBeta,
|
|
98
|
+
type SchemaStaticsBeta,
|
|
98
99
|
SchemaFactoryAlpha,
|
|
99
100
|
type ObjectSchemaOptionsAlpha,
|
|
100
101
|
type ObjectSchemaOptions,
|
|
@@ -181,7 +182,6 @@ export {
|
|
|
181
182
|
type AllowedTypeMetadata,
|
|
182
183
|
type AllowedTypesMetadata,
|
|
183
184
|
type UnannotateAllowedTypesList,
|
|
184
|
-
type SchemaStaticsAlpha,
|
|
185
185
|
type AnnotateAllowedTypesList,
|
|
186
186
|
type AllowedTypesFull,
|
|
187
187
|
type AllowedTypesFullFromMixed,
|
|
@@ -283,6 +283,8 @@ export {
|
|
|
283
283
|
type SchemaFactory_base,
|
|
284
284
|
type NumberKeys,
|
|
285
285
|
type SimpleAllowedTypeAttributes,
|
|
286
|
+
encodeSimpleSchema,
|
|
287
|
+
decodeSimpleSchema,
|
|
286
288
|
} from "./simple-tree/index.js";
|
|
287
289
|
export {
|
|
288
290
|
SharedTree,
|
package/src/packageVersion.ts
CHANGED
|
@@ -10,11 +10,15 @@ import {
|
|
|
10
10
|
createIdCompressor,
|
|
11
11
|
} from "@fluidframework/id-compressor/internal";
|
|
12
12
|
|
|
13
|
-
import
|
|
13
|
+
import {
|
|
14
|
+
FluidClientVersion,
|
|
15
|
+
type CodecWriteOptions,
|
|
16
|
+
type ICodecOptions,
|
|
17
|
+
} from "../codec/index.js";
|
|
14
18
|
import {
|
|
15
19
|
type RevisionTag,
|
|
16
20
|
RevisionTagCodec,
|
|
17
|
-
|
|
21
|
+
SchemaFormatVersion,
|
|
18
22
|
TreeStoredSchemaRepository,
|
|
19
23
|
} from "../core/index.js";
|
|
20
24
|
import {
|
|
@@ -26,7 +30,7 @@ import {
|
|
|
26
30
|
TreeCompressionStrategy,
|
|
27
31
|
defaultIncrementalEncodingPolicy,
|
|
28
32
|
} from "../feature-libraries/index.js";
|
|
29
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
33
|
+
// eslint-disable-next-line import-x/no-internal-modules
|
|
30
34
|
import type { Format } from "../feature-libraries/schema-index/formatV1.js";
|
|
31
35
|
import type {
|
|
32
36
|
TreeViewConfiguration,
|
|
@@ -44,6 +48,7 @@ import {
|
|
|
44
48
|
type JsonCompatible,
|
|
45
49
|
Breakable,
|
|
46
50
|
oneFromIterable,
|
|
51
|
+
brand,
|
|
47
52
|
} from "../util/index.js";
|
|
48
53
|
import {
|
|
49
54
|
buildConfiguredForest,
|
|
@@ -195,8 +200,14 @@ export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSc
|
|
|
195
200
|
});
|
|
196
201
|
|
|
197
202
|
if (options?.content !== undefined) {
|
|
198
|
-
|
|
199
|
-
|
|
203
|
+
// Any version can be passed down to `makeSchemaCodec` and `makeFieldBatchCodec` here.
|
|
204
|
+
// We only use the decode part, which always dispatches to the correct codec based on the version in the data, not `minVersionForCollab`.
|
|
205
|
+
const writeOptions: CodecWriteOptions = {
|
|
206
|
+
...options,
|
|
207
|
+
minVersionForCollab: FluidClientVersion.v2_0,
|
|
208
|
+
};
|
|
209
|
+
const schemaCodec = makeSchemaCodec(writeOptions, brand(SchemaFormatVersion.v1));
|
|
210
|
+
const fieldBatchCodec = makeFieldBatchCodec(writeOptions);
|
|
200
211
|
const newSchema = schemaCodec.decode(options.content.schema as Format);
|
|
201
212
|
|
|
202
213
|
const context: FieldBatchEncodingContext = {
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { ErasedType, IFluidLoadable } from "@fluidframework/core-interfaces/internal";
|
|
7
|
-
import { assert, fail
|
|
7
|
+
import { assert, fail } from "@fluidframework/core-utils/internal";
|
|
8
8
|
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
9
9
|
import type { IIdCompressor, StableId } from "@fluidframework/id-compressor";
|
|
10
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
10
11
|
import type {
|
|
11
12
|
IChannelView,
|
|
12
13
|
IFluidSerializer,
|
|
@@ -26,7 +27,6 @@ import {
|
|
|
26
27
|
type ICodecOptions,
|
|
27
28
|
} from "../codec/index.js";
|
|
28
29
|
import {
|
|
29
|
-
type DetachedFieldIndexFormatVersion,
|
|
30
30
|
type FieldKey,
|
|
31
31
|
type GraphCommit,
|
|
32
32
|
type IEditableForest,
|
|
@@ -35,8 +35,6 @@ import {
|
|
|
35
35
|
MapNodeStoredSchema,
|
|
36
36
|
ObjectNodeStoredSchema,
|
|
37
37
|
RevisionTagCodec,
|
|
38
|
-
type SchemaFormatVersion,
|
|
39
|
-
SchemaVersion,
|
|
40
38
|
type TreeFieldStoredSchema,
|
|
41
39
|
type TreeNodeStoredSchema,
|
|
42
40
|
type TreeStoredSchema,
|
|
@@ -66,21 +64,21 @@ import {
|
|
|
66
64
|
makeSchemaCodec,
|
|
67
65
|
makeTreeChunker,
|
|
68
66
|
type IncrementalEncodingPolicy,
|
|
69
|
-
type FieldBatchFormatVersion,
|
|
70
|
-
type ForestFormatVersion,
|
|
71
67
|
type TreeCompressionStrategyPrivate,
|
|
72
68
|
} from "../feature-libraries/index.js";
|
|
73
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
69
|
+
// eslint-disable-next-line import-x/no-internal-modules
|
|
74
70
|
import type { FormatV1 } from "../feature-libraries/schema-index/index.js";
|
|
75
71
|
import {
|
|
76
72
|
type BranchId,
|
|
73
|
+
clientVersionToEditManagerFormatVersion,
|
|
74
|
+
clientVersionToMessageFormatVersion,
|
|
77
75
|
type ClonableSchemaAndPolicy,
|
|
78
|
-
type EditManagerFormatVersion,
|
|
79
|
-
type ExplicitCoreCodecVersions,
|
|
80
76
|
getCodecTreeForEditManagerFormatWithChange,
|
|
81
77
|
getCodecTreeForMessageFormatWithChange,
|
|
82
|
-
type
|
|
78
|
+
type SharedTreCoreOptionsInternal,
|
|
79
|
+
MessageFormatVersion,
|
|
83
80
|
SharedTreeCore,
|
|
81
|
+
EditManagerFormatVersion,
|
|
84
82
|
} from "../shared-tree-core/index.js";
|
|
85
83
|
import {
|
|
86
84
|
type ITree,
|
|
@@ -172,98 +170,6 @@ export interface ITreePrivate extends ITreeInternal {
|
|
|
172
170
|
readonly kernel: SharedTreeKernel;
|
|
173
171
|
}
|
|
174
172
|
|
|
175
|
-
/**
|
|
176
|
-
* Has an entry for each codec which writes an explicit version into its data.
|
|
177
|
-
*
|
|
178
|
-
* This is used to map the single API entrypoint controlling the format {@link SharedTreeOptions.formatVersion}
|
|
179
|
-
* to a list of write versions that for each codec that should be used for that format.
|
|
180
|
-
*
|
|
181
|
-
* Note that all explicitly versioned codecs should be using the format version from the data to read encoded data.
|
|
182
|
-
*
|
|
183
|
-
* TODO: Plumb these write versions into forest, schema, detached field index codec creation.
|
|
184
|
-
*/
|
|
185
|
-
interface ExplicitCodecVersions extends ExplicitCoreCodecVersions {
|
|
186
|
-
forest: ForestFormatVersion;
|
|
187
|
-
schema: SchemaFormatVersion;
|
|
188
|
-
detachedFieldIndex: DetachedFieldIndexFormatVersion;
|
|
189
|
-
fieldBatch: FieldBatchFormatVersion;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const formatVersionToTopLevelCodecVersions = new Map<number, ExplicitCodecVersions>([
|
|
193
|
-
[
|
|
194
|
-
1,
|
|
195
|
-
{
|
|
196
|
-
forest: brand(1),
|
|
197
|
-
schema: brand(1),
|
|
198
|
-
detachedFieldIndex: brand(1),
|
|
199
|
-
editManager: brand(1),
|
|
200
|
-
message: brand(1),
|
|
201
|
-
fieldBatch: brand(1),
|
|
202
|
-
},
|
|
203
|
-
],
|
|
204
|
-
[
|
|
205
|
-
2,
|
|
206
|
-
{
|
|
207
|
-
forest: brand(1),
|
|
208
|
-
schema: brand(1),
|
|
209
|
-
detachedFieldIndex: brand(1),
|
|
210
|
-
editManager: brand(2),
|
|
211
|
-
message: brand(2),
|
|
212
|
-
fieldBatch: brand(1),
|
|
213
|
-
},
|
|
214
|
-
],
|
|
215
|
-
[
|
|
216
|
-
3,
|
|
217
|
-
{
|
|
218
|
-
forest: brand(1),
|
|
219
|
-
schema: brand(1),
|
|
220
|
-
detachedFieldIndex: brand(1),
|
|
221
|
-
editManager: brand(3),
|
|
222
|
-
message: brand(3),
|
|
223
|
-
fieldBatch: brand(1),
|
|
224
|
-
},
|
|
225
|
-
],
|
|
226
|
-
[
|
|
227
|
-
4,
|
|
228
|
-
{
|
|
229
|
-
forest: brand(1),
|
|
230
|
-
schema: brand(1),
|
|
231
|
-
detachedFieldIndex: brand(1),
|
|
232
|
-
editManager: brand(4),
|
|
233
|
-
message: brand(4),
|
|
234
|
-
fieldBatch: brand(1),
|
|
235
|
-
},
|
|
236
|
-
],
|
|
237
|
-
[
|
|
238
|
-
5,
|
|
239
|
-
{
|
|
240
|
-
forest: brand(1),
|
|
241
|
-
schema: brand(2),
|
|
242
|
-
detachedFieldIndex: brand(1),
|
|
243
|
-
editManager: brand(4),
|
|
244
|
-
message: brand(4),
|
|
245
|
-
fieldBatch: brand(1),
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
|
-
[
|
|
249
|
-
100, // SharedTreeFormatVersion.vSharedBranches
|
|
250
|
-
{
|
|
251
|
-
forest: brand(1),
|
|
252
|
-
schema: brand(2),
|
|
253
|
-
detachedFieldIndex: brand(1),
|
|
254
|
-
editManager: brand(5),
|
|
255
|
-
message: brand(5),
|
|
256
|
-
fieldBatch: brand(1),
|
|
257
|
-
},
|
|
258
|
-
],
|
|
259
|
-
]);
|
|
260
|
-
|
|
261
|
-
function getCodecVersions(formatVersion: number): ExplicitCodecVersions {
|
|
262
|
-
const versions = formatVersionToTopLevelCodecVersions.get(formatVersion);
|
|
263
|
-
assert(versions !== undefined, 0x90e /* Unknown format version */);
|
|
264
|
-
return versions;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
173
|
/**
|
|
268
174
|
* The type SharedTree's kernel's view must implement so what when its merged with the underling SharedObject's API it fully implements the required tree API surface ({@link ITreePrivate }).
|
|
269
175
|
*/
|
|
@@ -306,8 +212,13 @@ export class SharedTreeKernel
|
|
|
306
212
|
idCompressor: IIdCompressor,
|
|
307
213
|
optionsParam: SharedTreeOptionsInternal,
|
|
308
214
|
) {
|
|
309
|
-
const options = {
|
|
310
|
-
|
|
215
|
+
const options: Required<SharedTreeOptionsInternal> = {
|
|
216
|
+
...defaultSharedTreeOptions,
|
|
217
|
+
...optionsParam,
|
|
218
|
+
};
|
|
219
|
+
if (options.minVersionForCollab < FluidClientVersion.v2_0) {
|
|
220
|
+
throw new UsageError("SharedTree requires minVersionForCollab of at least 2.0.0");
|
|
221
|
+
}
|
|
311
222
|
const schema = new TreeStoredSchemaRepository();
|
|
312
223
|
const forest = buildConfiguredForest(
|
|
313
224
|
breaker,
|
|
@@ -323,7 +234,7 @@ export class SharedTreeKernel
|
|
|
323
234
|
idCompressor,
|
|
324
235
|
options,
|
|
325
236
|
);
|
|
326
|
-
const schemaCodec = makeSchemaCodec(options
|
|
237
|
+
const schemaCodec = makeSchemaCodec(options);
|
|
327
238
|
const schemaSummarizer = new SchemaSummarizer(
|
|
328
239
|
schema,
|
|
329
240
|
{
|
|
@@ -331,7 +242,7 @@ export class SharedTreeKernel
|
|
|
331
242
|
},
|
|
332
243
|
schemaCodec,
|
|
333
244
|
);
|
|
334
|
-
const fieldBatchCodec = makeFieldBatchCodec(options
|
|
245
|
+
const fieldBatchCodec = makeFieldBatchCodec(options);
|
|
335
246
|
|
|
336
247
|
const encoderContext = {
|
|
337
248
|
schema: {
|
|
@@ -392,7 +303,6 @@ export class SharedTreeKernel
|
|
|
392
303
|
[schemaSummarizer, forestSummarizer, removedRootsSummarizer],
|
|
393
304
|
changeFamily,
|
|
394
305
|
options,
|
|
395
|
-
codecVersions,
|
|
396
306
|
changeFormatVersionForEditManager,
|
|
397
307
|
changeFormatVersionForMessage,
|
|
398
308
|
idCompressor,
|
|
@@ -621,7 +531,12 @@ export function persistedToSimpleSchema(
|
|
|
621
531
|
persisted: JsonCompatible,
|
|
622
532
|
options: ICodecOptions,
|
|
623
533
|
): SimpleTreeSchema {
|
|
624
|
-
|
|
534
|
+
// Any version can be passed down to makeSchemaCodec here.
|
|
535
|
+
// We only use the decode part, which always dispatches to the correct codec based on the version in the data, not the version passed to `makeSchemaCodec`.
|
|
536
|
+
const schemaCodec = makeSchemaCodec({
|
|
537
|
+
...options,
|
|
538
|
+
minVersionForCollab: FluidClientVersion.v2_0,
|
|
539
|
+
});
|
|
625
540
|
const stored = schemaCodec.decode(persisted as FormatV1);
|
|
626
541
|
return exportSimpleSchema(stored);
|
|
627
542
|
}
|
|
@@ -716,11 +631,26 @@ export type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;
|
|
|
716
631
|
* This is because the format for SharedTree changes are not explicitly versioned.
|
|
717
632
|
*/
|
|
718
633
|
export const changeFormatVersionForEditManager = DependentFormatVersion.fromPairs([
|
|
719
|
-
[
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
[
|
|
634
|
+
[
|
|
635
|
+
brand<EditManagerFormatVersion>(EditManagerFormatVersion.v1),
|
|
636
|
+
brand<SharedTreeChangeFormatVersion>(1),
|
|
637
|
+
],
|
|
638
|
+
[
|
|
639
|
+
brand<EditManagerFormatVersion>(EditManagerFormatVersion.v2),
|
|
640
|
+
brand<SharedTreeChangeFormatVersion>(2),
|
|
641
|
+
],
|
|
642
|
+
[
|
|
643
|
+
brand<EditManagerFormatVersion>(EditManagerFormatVersion.v3),
|
|
644
|
+
brand<SharedTreeChangeFormatVersion>(3),
|
|
645
|
+
],
|
|
646
|
+
[
|
|
647
|
+
brand<EditManagerFormatVersion>(EditManagerFormatVersion.v4),
|
|
648
|
+
brand<SharedTreeChangeFormatVersion>(4),
|
|
649
|
+
],
|
|
650
|
+
[
|
|
651
|
+
brand<EditManagerFormatVersion>(EditManagerFormatVersion.v5),
|
|
652
|
+
brand<SharedTreeChangeFormatVersion>(4),
|
|
653
|
+
],
|
|
724
654
|
]);
|
|
725
655
|
|
|
726
656
|
/**
|
|
@@ -730,58 +660,61 @@ export const changeFormatVersionForEditManager = DependentFormatVersion.fromPair
|
|
|
730
660
|
* This is because the format for SharedTree changes are not explicitly versioned.
|
|
731
661
|
*/
|
|
732
662
|
export const changeFormatVersionForMessage = DependentFormatVersion.fromPairs([
|
|
733
|
-
[
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
[
|
|
738
|
-
|
|
663
|
+
[
|
|
664
|
+
brand<MessageFormatVersion>(MessageFormatVersion.undefined),
|
|
665
|
+
brand<SharedTreeChangeFormatVersion>(1),
|
|
666
|
+
],
|
|
667
|
+
[
|
|
668
|
+
brand<MessageFormatVersion>(MessageFormatVersion.v1),
|
|
669
|
+
brand<SharedTreeChangeFormatVersion>(1),
|
|
670
|
+
],
|
|
671
|
+
[
|
|
672
|
+
brand<MessageFormatVersion>(MessageFormatVersion.v2),
|
|
673
|
+
brand<SharedTreeChangeFormatVersion>(2),
|
|
674
|
+
],
|
|
675
|
+
[
|
|
676
|
+
brand<MessageFormatVersion>(MessageFormatVersion.v3),
|
|
677
|
+
brand<SharedTreeChangeFormatVersion>(3),
|
|
678
|
+
],
|
|
679
|
+
[
|
|
680
|
+
brand<MessageFormatVersion>(MessageFormatVersion.v4),
|
|
681
|
+
brand<SharedTreeChangeFormatVersion>(4),
|
|
682
|
+
],
|
|
683
|
+
[
|
|
684
|
+
brand<MessageFormatVersion>(MessageFormatVersion.v5),
|
|
685
|
+
brand<SharedTreeChangeFormatVersion>(4),
|
|
686
|
+
],
|
|
739
687
|
]);
|
|
740
688
|
|
|
741
|
-
function getCodecTreeForEditManagerFormat(
|
|
742
|
-
const change = changeFormatVersionForEditManager.lookup(
|
|
743
|
-
|
|
744
|
-
|
|
689
|
+
function getCodecTreeForEditManagerFormat(clientVersion: MinimumVersionForCollab): CodecTree {
|
|
690
|
+
const change = changeFormatVersionForEditManager.lookup(
|
|
691
|
+
clientVersionToEditManagerFormatVersion(clientVersion),
|
|
692
|
+
);
|
|
693
|
+
const changeCodecTree = getCodecTreeForChangeFormat(change, clientVersion);
|
|
694
|
+
return getCodecTreeForEditManagerFormatWithChange(clientVersion, changeCodecTree);
|
|
745
695
|
}
|
|
746
696
|
|
|
747
|
-
function getCodecTreeForMessageFormat(
|
|
748
|
-
const change = changeFormatVersionForMessage.lookup(
|
|
749
|
-
|
|
750
|
-
|
|
697
|
+
function getCodecTreeForMessageFormat(clientVersion: MinimumVersionForCollab): CodecTree {
|
|
698
|
+
const change = changeFormatVersionForMessage.lookup(
|
|
699
|
+
clientVersionToMessageFormatVersion(clientVersion),
|
|
700
|
+
);
|
|
701
|
+
const changeCodecTree = getCodecTreeForChangeFormat(change, clientVersion);
|
|
702
|
+
return getCodecTreeForMessageFormatWithChange(clientVersion, changeCodecTree);
|
|
751
703
|
}
|
|
752
704
|
|
|
753
705
|
export function getCodecTreeForSharedTreeFormat(
|
|
754
|
-
|
|
706
|
+
clientVersion: MinimumVersionForCollab,
|
|
755
707
|
): CodecTree {
|
|
756
708
|
const children: CodecTree[] = [];
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
case "message":
|
|
764
|
-
children.push(getCodecTreeForMessageFormat(childCodecs.message));
|
|
765
|
-
break;
|
|
766
|
-
case "forest":
|
|
767
|
-
children.push(getCodecTreeForForestFormat(childCodecs.forest));
|
|
768
|
-
break;
|
|
769
|
-
case "schema":
|
|
770
|
-
children.push(getCodecTreeForSchemaFormat(childCodecs.schema));
|
|
771
|
-
break;
|
|
772
|
-
case "detachedFieldIndex":
|
|
773
|
-
children.push(getCodecTreeForDetachedFieldIndexFormat(childCodecs.detachedFieldIndex));
|
|
774
|
-
break;
|
|
775
|
-
case "fieldBatch":
|
|
776
|
-
children.push(getCodecTreeForFieldBatchFormat(childCodecs.fieldBatch));
|
|
777
|
-
break;
|
|
778
|
-
default:
|
|
779
|
-
unreachableCase(name);
|
|
780
|
-
}
|
|
781
|
-
}
|
|
709
|
+
children.push(getCodecTreeForForestFormat(clientVersion));
|
|
710
|
+
children.push(getCodecTreeForSchemaFormat(clientVersion));
|
|
711
|
+
children.push(getCodecTreeForDetachedFieldIndexFormat(clientVersion));
|
|
712
|
+
children.push(getCodecTreeForEditManagerFormat(clientVersion));
|
|
713
|
+
children.push(getCodecTreeForMessageFormat(clientVersion));
|
|
714
|
+
children.push(getCodecTreeForFieldBatchFormat(clientVersion));
|
|
782
715
|
return {
|
|
783
716
|
name: "SharedTree",
|
|
784
|
-
version,
|
|
717
|
+
version: undefined, // SharedTree does not have a version of its own.
|
|
785
718
|
children,
|
|
786
719
|
};
|
|
787
720
|
}
|
|
@@ -796,12 +729,21 @@ export type SharedTreeOptionsBeta = ForestOptions;
|
|
|
796
729
|
* Configuration options for SharedTree.
|
|
797
730
|
* @alpha @input
|
|
798
731
|
*/
|
|
799
|
-
export
|
|
800
|
-
Partial<
|
|
801
|
-
|
|
732
|
+
export interface SharedTreeOptions
|
|
733
|
+
extends Partial<CodecWriteOptions>,
|
|
734
|
+
Partial<SharedTreeFormatOptions>,
|
|
735
|
+
SharedTreeOptionsBeta {
|
|
736
|
+
/**
|
|
737
|
+
* Experimental feature flag to enable shared branches.
|
|
738
|
+
* This feature is not yet complete and should not be used in production.
|
|
739
|
+
* Defaults to false.
|
|
740
|
+
*/
|
|
741
|
+
readonly enableSharedBranches?: boolean;
|
|
742
|
+
}
|
|
802
743
|
|
|
803
744
|
export interface SharedTreeOptionsInternal
|
|
804
|
-
extends
|
|
745
|
+
extends Partial<SharedTreCoreOptionsInternal>,
|
|
746
|
+
Partial<ForestOptions>,
|
|
805
747
|
Partial<SharedTreeFormatOptionsInternal> {
|
|
806
748
|
disposeForksAfterTransaction?: boolean;
|
|
807
749
|
/**
|
|
@@ -811,6 +753,7 @@ export interface SharedTreeOptionsInternal
|
|
|
811
753
|
*/
|
|
812
754
|
shouldEncodeIncrementally?: IncrementalEncodingPolicy;
|
|
813
755
|
}
|
|
756
|
+
|
|
814
757
|
/**
|
|
815
758
|
* Configuration options for SharedTree's internal tree storage.
|
|
816
759
|
* @beta @input
|
|
@@ -832,18 +775,6 @@ export interface SharedTreeFormatOptions {
|
|
|
832
775
|
* default: TreeCompressionStrategy.Compressed
|
|
833
776
|
*/
|
|
834
777
|
treeEncodeType: TreeCompressionStrategy;
|
|
835
|
-
/**
|
|
836
|
-
* The format version SharedTree should use to persist documents.
|
|
837
|
-
*
|
|
838
|
-
* This option has compatibility implications for applications using SharedTree.
|
|
839
|
-
* Each version documents a required minimum version of \@fluidframework/tree.
|
|
840
|
-
* If this minimum version fails to be met, the SharedTree may fail to load.
|
|
841
|
-
* To be safe, application authors should verify that they have saturated this version
|
|
842
|
-
* of \@fluidframework/tree in their ecosystem before changing the format version.
|
|
843
|
-
*
|
|
844
|
-
* This option defaults to SharedTreeFormatVersion.v2.
|
|
845
|
-
*/
|
|
846
|
-
formatVersion: SharedTreeFormatVersion[keyof SharedTreeFormatVersion];
|
|
847
778
|
}
|
|
848
779
|
|
|
849
780
|
export interface SharedTreeFormatOptionsInternal
|
|
@@ -949,9 +880,10 @@ export const defaultSharedTreeOptions: Required<SharedTreeOptionsInternal> = {
|
|
|
949
880
|
minVersionForCollab: FluidClientVersion.v2_0,
|
|
950
881
|
forest: ForestTypeReference,
|
|
951
882
|
treeEncodeType: TreeCompressionStrategy.Compressed,
|
|
952
|
-
formatVersion: SharedTreeFormatVersion.v3,
|
|
953
883
|
disposeForksAfterTransaction: true,
|
|
954
884
|
shouldEncodeIncrementally: defaultIncrementalEncodingPolicy,
|
|
885
|
+
editManagerFormatSelector: clientVersionToEditManagerFormatVersion,
|
|
886
|
+
messageFormatSelector: clientVersionToMessageFormatVersion,
|
|
955
887
|
};
|
|
956
888
|
|
|
957
889
|
/**
|
|
@@ -1003,6 +935,8 @@ function exportSimpleFieldSchemaStored(schema: TreeFieldStoredSchema): SimpleFie
|
|
|
1003
935
|
* Export a {@link SimpleNodeSchema} from a {@link TreeNodeStoredSchema}.
|
|
1004
936
|
* @privateRemarks
|
|
1005
937
|
* TODO: Persist node metadata once schema FormatV2 is supported.
|
|
938
|
+
* Note on SimpleNodeSchema construction: In the persisted format `persistedMetadata` is just called `metadata` whereas the `metadata`
|
|
939
|
+
* field on SimpleNodeSchema is not persisted.
|
|
1006
940
|
*/
|
|
1007
941
|
function exportSimpleNodeSchemaStored(schema: TreeNodeStoredSchema): SimpleNodeSchema {
|
|
1008
942
|
const arrayTypes = tryStoredSchemaAsArray(schema);
|
|
@@ -1019,7 +953,13 @@ function exportSimpleNodeSchemaStored(schema: TreeNodeStoredSchema): SimpleNodeS
|
|
|
1019
953
|
for (const [storedKey, field] of schema.objectNodeFields) {
|
|
1020
954
|
fields.set(storedKey, { ...exportSimpleFieldSchemaStored(field), storedKey });
|
|
1021
955
|
}
|
|
1022
|
-
return {
|
|
956
|
+
return {
|
|
957
|
+
kind: NodeKind.Object,
|
|
958
|
+
fields,
|
|
959
|
+
allowUnknownOptionalFields: undefined,
|
|
960
|
+
metadata: {},
|
|
961
|
+
persistedMetadata: schema.metadata,
|
|
962
|
+
};
|
|
1023
963
|
}
|
|
1024
964
|
if (schema instanceof MapNodeStoredSchema) {
|
|
1025
965
|
assert(
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { fail } from "@fluidframework/core-utils/internal";
|
|
7
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
7
8
|
import {
|
|
8
9
|
type CodecTree,
|
|
10
|
+
type CodecWriteOptions,
|
|
9
11
|
DiscriminatedUnionDispatcher,
|
|
10
12
|
type FormatVersion,
|
|
11
13
|
type ICodecFamily,
|
|
@@ -14,12 +16,15 @@ import {
|
|
|
14
16
|
makeCodecFamily,
|
|
15
17
|
withSchemaValidation,
|
|
16
18
|
} from "../codec/index.js";
|
|
17
|
-
import
|
|
19
|
+
import {
|
|
20
|
+
type ChangeEncodingContext,
|
|
21
|
+
SchemaFormatVersion,
|
|
22
|
+
type TreeStoredSchema,
|
|
23
|
+
} from "../core/index.js";
|
|
18
24
|
import {
|
|
19
25
|
type ModularChangeFormatVersion,
|
|
20
26
|
type ModularChangeset,
|
|
21
27
|
type SchemaChange,
|
|
22
|
-
type SchemaChangeFormatVersion,
|
|
23
28
|
defaultSchemaPolicy,
|
|
24
29
|
getCodecTreeForModularChangeFormat,
|
|
25
30
|
getCodecTreeForSchemaChangeFormat,
|
|
@@ -40,7 +45,7 @@ import type { SharedTreeChange, SharedTreeInnerChange } from "./sharedTreeChange
|
|
|
40
45
|
|
|
41
46
|
export function makeSharedTreeChangeCodecFamily(
|
|
42
47
|
modularChangeCodecFamily: ICodecFamily<ModularChangeset, ChangeEncodingContext>,
|
|
43
|
-
options:
|
|
48
|
+
options: CodecWriteOptions,
|
|
44
49
|
): ICodecFamily<SharedTreeChange, ChangeEncodingContext> {
|
|
45
50
|
const schemaChangeCodecs = makeSchemaChangeCodecs(options);
|
|
46
51
|
const versions: [
|
|
@@ -66,7 +71,7 @@ export function makeSharedTreeChangeCodecFamily(
|
|
|
66
71
|
|
|
67
72
|
interface ChangeFormatDependencies {
|
|
68
73
|
readonly modularChange: ModularChangeFormatVersion;
|
|
69
|
-
readonly schemaChange:
|
|
74
|
+
readonly schemaChange: SchemaFormatVersion;
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
export type SharedTreeChangeFormatVersion = Brand<
|
|
@@ -84,14 +89,15 @@ export const dependenciesForChangeFormat: Map<
|
|
|
84
89
|
SharedTreeChangeFormatVersion,
|
|
85
90
|
ChangeFormatDependencies
|
|
86
91
|
> = new Map([
|
|
87
|
-
[brand(1), { modularChange: brand(1), schemaChange: brand(
|
|
88
|
-
[brand(2), { modularChange: brand(2), schemaChange: brand(
|
|
89
|
-
[brand(3), { modularChange: brand(3), schemaChange: brand(
|
|
90
|
-
[brand(4), { modularChange: brand(4), schemaChange: brand(
|
|
92
|
+
[brand(1), { modularChange: brand(1), schemaChange: brand(SchemaFormatVersion.v1) }],
|
|
93
|
+
[brand(2), { modularChange: brand(2), schemaChange: brand(SchemaFormatVersion.v1) }],
|
|
94
|
+
[brand(3), { modularChange: brand(3), schemaChange: brand(SchemaFormatVersion.v1) }],
|
|
95
|
+
[brand(4), { modularChange: brand(4), schemaChange: brand(SchemaFormatVersion.v1) }],
|
|
91
96
|
]);
|
|
92
97
|
|
|
93
98
|
export function getCodecTreeForChangeFormat(
|
|
94
99
|
version: SharedTreeChangeFormatVersion,
|
|
100
|
+
clientVersion: MinimumVersionForCollab,
|
|
95
101
|
): CodecTree {
|
|
96
102
|
const { modularChange, schemaChange } =
|
|
97
103
|
dependenciesForChangeFormat.get(version) ?? fail(0xc78 /* Unknown change format */);
|
|
@@ -100,7 +106,7 @@ export function getCodecTreeForChangeFormat(
|
|
|
100
106
|
version,
|
|
101
107
|
children: [
|
|
102
108
|
getCodecTreeForModularChangeFormat(modularChange),
|
|
103
|
-
getCodecTreeForSchemaChangeFormat(schemaChange),
|
|
109
|
+
getCodecTreeForSchemaChangeFormat(schemaChange, clientVersion),
|
|
104
110
|
],
|
|
105
111
|
};
|
|
106
112
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { assert, fail } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type { CodecWriteOptions, ICodecFamily } from "../codec/index.js";
|
|
10
10
|
import {
|
|
11
11
|
type ChangeEncodingContext,
|
|
12
12
|
type ChangeFamily,
|
|
@@ -60,7 +60,7 @@ export class SharedTreeChangeFamily
|
|
|
60
60
|
public constructor(
|
|
61
61
|
revisionTagCodec: RevisionTagCodec,
|
|
62
62
|
fieldBatchCodec: FieldBatchCodec,
|
|
63
|
-
codecOptions:
|
|
63
|
+
codecOptions: CodecWriteOptions,
|
|
64
64
|
chunkCompressionStrategy?: TreeCompressionStrategyPrivate,
|
|
65
65
|
private readonly idCompressor?: IIdCompressor,
|
|
66
66
|
) {
|
|
@@ -78,7 +78,6 @@ import {
|
|
|
78
78
|
TreeCompressionStrategy,
|
|
79
79
|
type FieldBatch,
|
|
80
80
|
type FieldBatchEncodingContext,
|
|
81
|
-
fluidVersionToFieldBatchCodecWriteVersion,
|
|
82
81
|
type LocalNodeIdentifier,
|
|
83
82
|
type FlexTreeSequenceField,
|
|
84
83
|
type FlexTreeNode,
|
|
@@ -291,7 +290,7 @@ export interface TreeAlpha {
|
|
|
291
290
|
* @remarks
|
|
292
291
|
* This currently does not support input containing
|
|
293
292
|
* {@link ObjectSchemaOptions.allowUnknownOptionalFields| unknown optional fields} but does support
|
|
294
|
-
* {@link
|
|
293
|
+
* {@link SchemaStaticsBeta.staged | staged} allowed types.
|
|
295
294
|
* Non-empty default values for fields are currently not supported (must be provided in the input).
|
|
296
295
|
* The content will be validated against the schema and an error will be thrown if out of schema.
|
|
297
296
|
*/
|
|
@@ -845,8 +844,10 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
845
844
|
options: { idCompressor?: IIdCompressor } & Pick<CodecWriteOptions, "minVersionForCollab">,
|
|
846
845
|
): JsonCompatible<IFluidHandle> {
|
|
847
846
|
const schema = tryGetSchema(node) ?? fail(0xacf /* invalid input */);
|
|
848
|
-
const
|
|
849
|
-
|
|
847
|
+
const codec = makeFieldBatchCodec({
|
|
848
|
+
jsonValidator: FormatValidatorNoOp,
|
|
849
|
+
minVersionForCollab: options.minVersionForCollab,
|
|
850
|
+
});
|
|
850
851
|
const cursor = borrowFieldCursorFromTreeNodeOrValue(node);
|
|
851
852
|
const batch: FieldBatch = [cursor];
|
|
852
853
|
// If none provided, create a compressor which will not compress anything.
|
|
@@ -873,7 +874,7 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
873
874
|
compressedData: JsonCompatible<IFluidHandle>,
|
|
874
875
|
options: {
|
|
875
876
|
idCompressor?: IIdCompressor;
|
|
876
|
-
} &
|
|
877
|
+
} & CodecWriteOptions,
|
|
877
878
|
): Unhydrated<TreeFieldFromImplicitField<TSchema>> {
|
|
878
879
|
const config = new TreeViewConfigurationAlpha({ schema });
|
|
879
880
|
const content: ViewContent = {
|
|
@@ -300,13 +300,11 @@ export function createTreeCheckout(
|
|
|
300
300
|
jsonValidator: FormatValidatorNoOp,
|
|
301
301
|
minVersionForCollab: FluidClientVersion.v2_0,
|
|
302
302
|
};
|
|
303
|
-
const defaultFieldBatchVersion = 1;
|
|
304
303
|
const changeFamily =
|
|
305
304
|
args?.changeFamily ??
|
|
306
305
|
new SharedTreeChangeFamily(
|
|
307
306
|
revisionTagCodec,
|
|
308
|
-
args?.fieldBatchCodec ??
|
|
309
|
-
makeFieldBatchCodec(defaultCodecOptions, defaultFieldBatchVersion),
|
|
307
|
+
args?.fieldBatchCodec ?? makeFieldBatchCodec(defaultCodecOptions),
|
|
310
308
|
defaultCodecOptions,
|
|
311
309
|
args?.chunkCompressionStrategy,
|
|
312
310
|
idCompressor,
|