@fluidframework/tree 2.111.0 → 2.112.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 +145 -0
- package/api-report/tree.alpha.api.md +48 -5
- package/api-report/tree.beta.api.md +1 -1
- package/api-report/tree.legacy.beta.api.md +1 -1
- package/api-report/tree.legacy.public.api.md +1 -1
- package/api-report/tree.public.api.md +1 -1
- package/dist/componentApi.d.ts +198 -0
- package/dist/componentApi.d.ts.map +1 -0
- package/dist/componentApi.js +138 -0
- package/dist/componentApi.js.map +1 -0
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js +4 -2
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -25
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +6 -18
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +9 -16
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +2 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +3 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -0
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +3 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +25 -0
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js +29 -0
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -0
- package/dist/feature-libraries/schemaChecker.d.ts +22 -3
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +48 -5
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- 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/independentView.d.ts +17 -4
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +11 -5
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +2 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +3 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +1 -0
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +6 -3
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/serializedChange.d.ts +41 -0
- package/dist/shared-tree/serializedChange.d.ts.map +1 -0
- package/dist/shared-tree/serializedChange.js +87 -0
- package/dist/shared-tree/serializedChange.js.map +1 -0
- package/dist/shared-tree/sharedTree.d.ts +13 -0
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -0
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +7 -0
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +8 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/transactionMinimize.d.ts +35 -0
- package/dist/shared-tree/transactionMinimize.d.ts.map +1 -0
- package/dist/shared-tree/transactionMinimize.js +65 -0
- package/dist/shared-tree/transactionMinimize.js.map +1 -0
- package/dist/shared-tree/treeCheckout.d.ts +3 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +36 -62
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +6 -3
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +35 -14
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +1 -1
- package/dist/shared-tree-core/messageFormat.js +1 -1
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +10 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +1 -0
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageTypes.d.ts +1 -0
- package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
- package/dist/shared-tree-core/messageTypes.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +9 -3
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +24 -11
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +16 -2
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +9 -24
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +31 -44
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +56 -15
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +0 -3
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +1 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +1 -2
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +22 -2
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +2 -2
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +2 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +83 -4
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +39 -0
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/treeFactory.js +1 -1
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/breakable.d.ts +16 -1
- package/dist/util/breakable.d.ts.map +1 -1
- package/dist/util/breakable.js +9 -1
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/compressedIds.d.ts +69 -2
- package/dist/util/compressedIds.d.ts.map +1 -1
- package/dist/util/compressedIds.js +32 -1
- package/dist/util/compressedIds.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +2 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +16 -3
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/nestedSet.d.ts +1 -1
- package/dist/util/nestedSet.d.ts.map +1 -1
- package/dist/util/nestedSet.js.map +1 -1
- package/dist/util/utils.d.ts +0 -6
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +1 -15
- package/dist/util/utils.js.map +1 -1
- package/lib/componentApi.d.ts +198 -0
- package/lib/componentApi.d.ts.map +1 -0
- package/lib/componentApi.js +135 -0
- package/lib/componentApi.js.map +1 -0
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -25
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +6 -18
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +10 -17
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +2 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -0
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -0
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +25 -0
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js +25 -0
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -0
- package/lib/feature-libraries/schemaChecker.d.ts +22 -3
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +48 -5
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- 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/independentView.d.ts +17 -4
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +9 -3
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +2 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -0
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +1 -0
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +7 -4
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/serializedChange.d.ts +41 -0
- package/lib/shared-tree/serializedChange.d.ts.map +1 -0
- package/lib/shared-tree/serializedChange.js +84 -0
- package/lib/shared-tree/serializedChange.js.map +1 -0
- package/lib/shared-tree/sharedTree.d.ts +13 -0
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -0
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +7 -0
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +7 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/transactionMinimize.d.ts +35 -0
- package/lib/shared-tree/transactionMinimize.d.ts.map +1 -0
- package/lib/shared-tree/transactionMinimize.js +62 -0
- package/lib/shared-tree/transactionMinimize.js.map +1 -0
- package/lib/shared-tree/treeCheckout.d.ts +3 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +18 -44
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +6 -3
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +36 -15
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +1 -1
- package/lib/shared-tree-core/messageFormat.js +1 -1
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +10 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js +1 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageTypes.d.ts +1 -0
- package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
- package/lib/shared-tree-core/messageTypes.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +9 -3
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +25 -12
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +16 -2
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +9 -24
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +29 -42
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +56 -15
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +0 -3
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -3
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +2 -3
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +22 -2
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +2 -2
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +83 -4
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +39 -0
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/lib/treeFactory.js +1 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/breakable.d.ts +16 -1
- package/lib/util/breakable.d.ts.map +1 -1
- package/lib/util/breakable.js +9 -1
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/compressedIds.d.ts +69 -2
- package/lib/util/compressedIds.d.ts.map +1 -1
- package/lib/util/compressedIds.js +30 -0
- package/lib/util/compressedIds.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +17 -4
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/nestedSet.d.ts +1 -1
- package/lib/util/nestedSet.d.ts.map +1 -1
- package/lib/util/nestedSet.js.map +1 -1
- package/lib/util/utils.d.ts +0 -6
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +0 -13
- package/lib/util/utils.js.map +1 -1
- package/package.json +22 -22
- package/src/componentApi.ts +354 -0
- package/src/entrypoints/alpha.ts +3 -0
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +6 -27
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -2
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +17 -44
- package/src/feature-libraries/index.ts +2 -0
- package/src/feature-libraries/modular-schema/index.ts +1 -0
- package/src/feature-libraries/modular-schema/minimizeModularChange.ts +33 -0
- package/src/feature-libraries/schemaChecker.ts +86 -9
- package/src/index.ts +3 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +35 -5
- package/src/shared-tree/index.ts +3 -0
- package/src/shared-tree/schematizingTreeView.ts +15 -5
- package/src/shared-tree/serializedChange.ts +127 -0
- package/src/shared-tree/sharedTree.ts +16 -0
- package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
- package/src/shared-tree/transactionMinimize.ts +74 -0
- package/src/shared-tree/treeCheckout.ts +42 -57
- package/src/shared-tree-core/editManager.ts +42 -6
- package/src/shared-tree-core/editManagerFormatCommons.ts +1 -1
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +8 -1
- package/src/shared-tree-core/messageFormat.ts +1 -1
- package/src/shared-tree-core/messageFormatVSharedBranches.ts +10 -0
- package/src/shared-tree-core/messageTypes.ts +1 -0
- package/src/shared-tree-core/sharedTreeCore.ts +33 -10
- package/src/shared-tree-core/transaction.ts +19 -2
- package/src/simple-tree/api/index.ts +1 -1
- package/src/simple-tree/api/schemaCompatibilityTester.ts +36 -48
- package/src/simple-tree/api/schemaFactoryAlpha.ts +56 -15
- package/src/simple-tree/api/schemaFactoryBeta.ts +0 -3
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +2 -3
- package/src/simple-tree/api/storedSchema.ts +2 -3
- package/src/simple-tree/api/tree.ts +24 -2
- package/src/simple-tree/api/typesUnsafe.ts +2 -1
- package/src/simple-tree/index.ts +1 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +168 -4
- package/src/simple-tree/simpleSchemaFormatV1.ts +1 -1
- package/src/treeFactory.ts +1 -1
- package/src/util/breakable.ts +8 -1
- package/src/util/compressedIds.ts +90 -2
- package/src/util/index.ts +3 -1
- package/src/util/nestedMap.ts +21 -4
- package/src/util/nestedSet.ts +1 -1
- package/src/util/utils.ts +0 -18
package/src/entrypoints/alpha.ts
CHANGED
|
@@ -178,6 +178,7 @@ export {
|
|
|
178
178
|
ChangeMetadata,
|
|
179
179
|
CodecName,
|
|
180
180
|
CodecWriteOptions,
|
|
181
|
+
Component,
|
|
181
182
|
CreateIndependentTreeAlphaOptions,
|
|
182
183
|
DirtyTreeMap,
|
|
183
184
|
DirtyTreeStatus,
|
|
@@ -201,6 +202,7 @@ export {
|
|
|
201
202
|
ITreeAlpha,
|
|
202
203
|
IncrementalEncodingPolicy,
|
|
203
204
|
IndependentViewOptions,
|
|
205
|
+
IndependentViewTelemetryOptions,
|
|
204
206
|
Insertable,
|
|
205
207
|
InsertableContent,
|
|
206
208
|
InsertableField,
|
|
@@ -316,6 +318,7 @@ export {
|
|
|
316
318
|
incrementalSummaryHint,
|
|
317
319
|
independentInitializedView,
|
|
318
320
|
independentView,
|
|
321
|
+
minimize,
|
|
319
322
|
normalizeAllowedTypes,
|
|
320
323
|
persistedToSimpleSchema,
|
|
321
324
|
replaceConciseTreeHandles,
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert, unreachableCase, oob } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import type {
|
|
8
|
-
IIdCompressor,
|
|
9
8
|
OpSpaceCompressedId,
|
|
10
9
|
SessionSpaceCompressedId,
|
|
11
10
|
} from "@fluidframework/id-compressor";
|
|
@@ -17,7 +16,12 @@ import type {
|
|
|
17
16
|
Value,
|
|
18
17
|
TreeChunk,
|
|
19
18
|
} from "../../../core/index.js";
|
|
20
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
assertValidIndex,
|
|
21
|
+
brand,
|
|
22
|
+
decompressIdentifierIfNeeded,
|
|
23
|
+
type IdDecodingContext,
|
|
24
|
+
} from "../../../util/index.js";
|
|
21
25
|
import { BasicChunk } from "../basicChunk.js";
|
|
22
26
|
import { emptyChunk } from "../emptyChunk.js";
|
|
23
27
|
import { SequenceChunk } from "../sequenceChunk.js";
|
|
@@ -55,31 +59,6 @@ import {
|
|
|
55
59
|
supportsIncrementalEncoding,
|
|
56
60
|
} from "./format/index.js";
|
|
57
61
|
|
|
58
|
-
/**
|
|
59
|
-
* Context for decoding identifiers.
|
|
60
|
-
* @remarks
|
|
61
|
-
* See {@link FieldBatchDecodingContext} for the production implementation of this.
|
|
62
|
-
*
|
|
63
|
-
* This intentionally avoids exposing anything which depends on the underlying id-compressor's session ID to avoid confusion with the session ID of the compressor which encoded the data.
|
|
64
|
-
* If the session ID of the encoder which encoded the data is known, that information is baked into `resolveEncodedId`.
|
|
65
|
-
*/
|
|
66
|
-
export interface IdDecodingContext {
|
|
67
|
-
/**
|
|
68
|
-
* Compressor which can decompress session-space identifiers from {@link resolveEncodedId} as needed.
|
|
69
|
-
*/
|
|
70
|
-
readonly idCompressor: Pick<IIdCompressor, "decompress">;
|
|
71
|
-
/**
|
|
72
|
-
* Resolves an encoded op-space identifier to either a session-space ID
|
|
73
|
-
* (which {@link idCompressor} can decompress if needed)
|
|
74
|
-
* or a string (which passes through unchanged).
|
|
75
|
-
* @remarks
|
|
76
|
-
* In contexts where non-final identifiers can't be supported (where no originator session is available),
|
|
77
|
-
* if a non-final identifier is encountered, this may throw or perform a data healing workaround.
|
|
78
|
-
* See {@link FieldBatchDecodingContext.forOp} and {@link FieldBatchDecodingContext.forSummary} for details.
|
|
79
|
-
*/
|
|
80
|
-
readonly resolveEncodedId: (id: OpSpaceCompressedId) => SessionSpaceCompressedId | string;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
62
|
/**
|
|
84
63
|
* Decode `chunk` into a TreeChunk.
|
|
85
64
|
*/
|
|
@@ -7,7 +7,7 @@ import { assert } from "@fluidframework/core-utils/internal";
|
|
|
7
7
|
|
|
8
8
|
import type { DiscriminatedUnionDispatcher } from "../../../codec/index.js";
|
|
9
9
|
import type { TreeChunk } from "../../../core/index.js";
|
|
10
|
-
import type { BrandedType } from "../../../util/index.js";
|
|
10
|
+
import type { BrandedType, IdDecodingContext } from "../../../util/index.js";
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
type ChunkDecoder,
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
getChecked,
|
|
16
16
|
readStream,
|
|
17
17
|
} from "./chunkCodecUtilities.js";
|
|
18
|
-
import type { IdDecodingContext } from "./chunkDecoding.js";
|
|
19
18
|
import type { IncrementalDecoder } from "./codecs.js";
|
|
20
19
|
import type { EncodedFieldBatchGeneric, IdentifierOrIndex } from "./format/index.js";
|
|
21
20
|
|
|
@@ -4,12 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import type {
|
|
8
|
-
IIdCompressor,
|
|
9
|
-
OpSpaceCompressedId,
|
|
10
|
-
SessionId,
|
|
11
|
-
SessionSpaceCompressedId,
|
|
12
|
-
} from "@fluidframework/id-compressor";
|
|
7
|
+
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
13
8
|
import { lowestMinVersionForCollab } from "@fluidframework/runtime-utils/internal";
|
|
14
9
|
import type { TSchema } from "@sinclair/typebox";
|
|
15
10
|
|
|
@@ -29,13 +24,14 @@ import {
|
|
|
29
24
|
} from "../../../core/index.js";
|
|
30
25
|
import {
|
|
31
26
|
brandedNumberType,
|
|
32
|
-
|
|
27
|
+
IdDecodingContext,
|
|
33
28
|
type Brand,
|
|
34
|
-
type
|
|
29
|
+
type IdDecoderOptionsOriginatorless,
|
|
30
|
+
type IdDecoderOptionsWithOriginator,
|
|
35
31
|
} from "../../../util/index.js";
|
|
36
32
|
import { TreeCompressionStrategy } from "../../treeCompressionUtils.js";
|
|
37
33
|
|
|
38
|
-
import { decode
|
|
34
|
+
import { decode } from "./chunkDecoding.js";
|
|
39
35
|
import type { FieldBatch } from "./fieldBatch.js";
|
|
40
36
|
import {
|
|
41
37
|
EncodedFieldBatchV1,
|
|
@@ -148,26 +144,18 @@ export interface FieldBatchEncodingContext {
|
|
|
148
144
|
* op-style and summary-style decoding is load-bearing (different invariants
|
|
149
145
|
* apply, and bugs in this area are typically the result of conflating them).
|
|
150
146
|
*/
|
|
151
|
-
export class FieldBatchDecodingContext
|
|
147
|
+
export class FieldBatchDecodingContext extends IdDecodingContext {
|
|
152
148
|
private constructor(
|
|
153
|
-
|
|
154
|
-
* Used internally to prevent the use of this decoder in incremental chunks if it has a session id (which would be wrong in those chunks).
|
|
155
|
-
*/
|
|
156
|
-
private readonly hasOriginatorSessionId: boolean,
|
|
157
|
-
|
|
158
|
-
public readonly idCompressor: Pick<IIdCompressor, "decompress">,
|
|
159
|
-
|
|
160
|
-
public readonly resolveEncodedId: (
|
|
161
|
-
id: OpSpaceCompressedId,
|
|
162
|
-
) => SessionSpaceCompressedId | string,
|
|
163
|
-
|
|
149
|
+
private readonly options: IdDecoderOptionsOriginatorless | IdDecoderOptionsWithOriginator,
|
|
164
150
|
/**
|
|
165
151
|
* Decoder for incremental fields. Defined when the encoded batch contains
|
|
166
152
|
* incremental chunks. Only populated on summary-style contexts; op-style
|
|
167
153
|
* contexts always have this undefined.
|
|
168
154
|
*/
|
|
169
155
|
public readonly incrementalDecoder?: IncrementalDecoder,
|
|
170
|
-
) {
|
|
156
|
+
) {
|
|
157
|
+
super(options);
|
|
158
|
+
}
|
|
171
159
|
|
|
172
160
|
/**
|
|
173
161
|
* Construct a decode context for an op.
|
|
@@ -178,14 +166,8 @@ export class FieldBatchDecodingContext implements IdDecodingContext {
|
|
|
178
166
|
* not a recoverable state, so the resolver throws rather than synthesizing
|
|
179
167
|
* a UUID. Incremental decoding is not used for ops.
|
|
180
168
|
*/
|
|
181
|
-
public static forOp(
|
|
182
|
-
|
|
183
|
-
readonly originatorId: SessionId;
|
|
184
|
-
}): FieldBatchDecodingContext {
|
|
185
|
-
const { idCompressor, originatorId } = opts;
|
|
186
|
-
return new FieldBatchDecodingContext(true, idCompressor, (id) =>
|
|
187
|
-
idCompressor.normalizeToSessionSpace(id, originatorId),
|
|
188
|
-
);
|
|
169
|
+
public static forOp(options: IdDecoderOptionsWithOriginator): FieldBatchDecodingContext {
|
|
170
|
+
return new FieldBatchDecodingContext(options);
|
|
189
171
|
}
|
|
190
172
|
|
|
191
173
|
/**
|
|
@@ -204,14 +186,10 @@ export class FieldBatchDecodingContext implements IdDecodingContext {
|
|
|
204
186
|
* `withIncrementalDecoder` has logic to guard against cases which expect session-relative identifiers in incremental chunks,
|
|
205
187
|
* as does the encoding-side assert in the {@link EncoderContext}.
|
|
206
188
|
*/
|
|
207
|
-
public static forSummary(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const { idCompressor, healing } = opts;
|
|
212
|
-
return new FieldBatchDecodingContext(false, idCompressor, (id) =>
|
|
213
|
-
forceDecodeEncodedIdWithoutSession(id, idCompressor, healing),
|
|
214
|
-
);
|
|
189
|
+
public static forSummary(
|
|
190
|
+
options: IdDecoderOptionsOriginatorless | IdDecoderOptionsWithOriginator,
|
|
191
|
+
): FieldBatchDecodingContext {
|
|
192
|
+
return new FieldBatchDecodingContext(options);
|
|
215
193
|
}
|
|
216
194
|
|
|
217
195
|
/**
|
|
@@ -231,12 +209,7 @@ export class FieldBatchDecodingContext implements IdDecodingContext {
|
|
|
231
209
|
!this.hasOriginatorSessionId,
|
|
232
210
|
0xd0c /* withIncrementalDecoder can only be called on contexts without an originator session ID */,
|
|
233
211
|
);
|
|
234
|
-
return new FieldBatchDecodingContext(
|
|
235
|
-
false,
|
|
236
|
-
this.idCompressor,
|
|
237
|
-
this.resolveEncodedId,
|
|
238
|
-
incrementalDecoder,
|
|
239
|
-
);
|
|
212
|
+
return new FieldBatchDecodingContext(this.options, incrementalDecoder);
|
|
240
213
|
}
|
|
241
214
|
}
|
|
242
215
|
|
|
@@ -93,6 +93,7 @@ export {
|
|
|
93
93
|
isNeverTree,
|
|
94
94
|
DefaultRevisionReplacer,
|
|
95
95
|
ModularChangeFormatVersion,
|
|
96
|
+
minimizeModularChangeset,
|
|
96
97
|
} from "./modular-schema/index.js";
|
|
97
98
|
|
|
98
99
|
export { mapRootChanges } from "./deltaUtils.js";
|
|
@@ -149,6 +150,7 @@ export {
|
|
|
149
150
|
|
|
150
151
|
export {
|
|
151
152
|
SchemaValidationError,
|
|
153
|
+
type SchemaValidationErrorContext,
|
|
152
154
|
isNodeInSchema,
|
|
153
155
|
isFieldInSchema,
|
|
154
156
|
throwOutOfSchema,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { FieldKindIdentifier } from "../../core/index.js";
|
|
7
|
+
|
|
8
|
+
import type { FlexFieldKind } from "./fieldKind.js";
|
|
9
|
+
import type { ModularChangeset } from "./modularChangeTypes.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* "Minimizes" a {@link ModularChangeset} so that it contains no extraneous
|
|
13
|
+
* information, i.e. no new content that isn't observable from document tree
|
|
14
|
+
* and no edits without net observed effect on the document tree.
|
|
15
|
+
* @remarks
|
|
16
|
+
* "Extraneous information" includes, for example, data for nodes that were both created and removed within the same
|
|
17
|
+
* transaction, or changes whose effects cancel out to nothing. Minimizing reduces the size of an edit without altering
|
|
18
|
+
* its observable effect.
|
|
19
|
+
*
|
|
20
|
+
* This is the eventual home of the minimization algorithm, colocated with {@link ModularChangeFamily} so it can use its
|
|
21
|
+
* internals. It is currently a no-op that returns the change unchanged; a real implementation will be provided in a
|
|
22
|
+
* future change.
|
|
23
|
+
*
|
|
24
|
+
* @param change - The change to minimize.
|
|
25
|
+
* @param fieldKinds - The field kinds to delegate to when computing the change's delta.
|
|
26
|
+
*/
|
|
27
|
+
export function minimizeModularChangeset(
|
|
28
|
+
change: ModularChangeset,
|
|
29
|
+
fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>,
|
|
30
|
+
): ModularChangeset {
|
|
31
|
+
// TODO: Actually minimize the change. For now this is a no-op that returns the change unchanged.
|
|
32
|
+
return change;
|
|
33
|
+
}
|
|
@@ -32,13 +32,82 @@ export enum SchemaValidationError {
|
|
|
32
32
|
Node_MissingSchema,
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Additional context about a schema validation error.
|
|
37
|
+
* @remarks
|
|
38
|
+
* Not all fields are populated for every error type — only those relevant to the specific error.
|
|
39
|
+
*/
|
|
40
|
+
export interface SchemaValidationErrorContext {
|
|
41
|
+
/**
|
|
42
|
+
* The type identifier of the node that failed validation.
|
|
43
|
+
*/
|
|
44
|
+
readonly nodeType?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The set of type identifiers allowed in the field, if applicable.
|
|
47
|
+
*/
|
|
48
|
+
readonly allowedTypes?: ReadonlySet<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Field keys on the node that were not recognized by its schema.
|
|
51
|
+
*/
|
|
52
|
+
readonly unexpectedFields?: ReadonlySet<string>;
|
|
53
|
+
}
|
|
54
|
+
|
|
35
55
|
/**
|
|
36
56
|
* Throws a UsageError indicating a tree is out of schema.
|
|
37
57
|
*/
|
|
38
|
-
export function throwOutOfSchema(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
58
|
+
export function throwOutOfSchema(
|
|
59
|
+
maybeError: SchemaValidationError,
|
|
60
|
+
context?: SchemaValidationErrorContext,
|
|
61
|
+
): never {
|
|
62
|
+
throw new UsageError(formatSchemaValidationError(maybeError, context));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Not exported: internal helper used by throwOutOfSchema.
|
|
66
|
+
function formatSchemaValidationError(
|
|
67
|
+
error: SchemaValidationError,
|
|
68
|
+
context: SchemaValidationErrorContext | undefined,
|
|
69
|
+
): string {
|
|
70
|
+
switch (error) {
|
|
71
|
+
case SchemaValidationError.Field_NodeTypeNotAllowed: {
|
|
72
|
+
const nodeDesc = context?.nodeType === undefined ? "unknown" : `"${context.nodeType}"`;
|
|
73
|
+
const allowedDesc =
|
|
74
|
+
context?.allowedTypes === undefined
|
|
75
|
+
? "unknown"
|
|
76
|
+
: `[${[...context.allowedTypes].map((t) => `"${t}"`).join(", ")}]`;
|
|
77
|
+
return (
|
|
78
|
+
`Tree does not conform to schema. ` +
|
|
79
|
+
`A node of type ${nodeDesc} is not allowed in this field. Allowed types: ${allowedDesc}. ` +
|
|
80
|
+
`If using a staged allowed type, the stored schema has not been upgraded to include this type yet. ` +
|
|
81
|
+
`Either upgrade the schema to enable the staged type or avoid inserting content of this type until the schema is upgraded.`
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
case SchemaValidationError.Node_MissingSchema: {
|
|
85
|
+
const nodeDesc = context?.nodeType === undefined ? "unknown" : `"${context.nodeType}"`;
|
|
86
|
+
return (
|
|
87
|
+
`Tree does not conform to schema. ` +
|
|
88
|
+
`No schema definition was found for node type ${nodeDesc}. ` +
|
|
89
|
+
`Ensure the node's type is included in the schema and that the stored schema has been upgraded if needed.`
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
case SchemaValidationError.ObjectNode_FieldNotInSchema: {
|
|
93
|
+
const nodeDesc = context?.nodeType === undefined ? "unknown" : `"${context.nodeType}"`;
|
|
94
|
+
const fieldsDesc =
|
|
95
|
+
context?.unexpectedFields === undefined || context.unexpectedFields.size === 0
|
|
96
|
+
? undefined
|
|
97
|
+
: `[${[...context.unexpectedFields].map((f) => `"${f}"`).join(", ")}]`;
|
|
98
|
+
const fieldsPart =
|
|
99
|
+
fieldsDesc === undefined
|
|
100
|
+
? "The node has fields that are not defined in its schema."
|
|
101
|
+
: `Unexpected fields: ${fieldsDesc}.`;
|
|
102
|
+
return (
|
|
103
|
+
`Tree does not conform to schema. ` +
|
|
104
|
+
`A node of type ${nodeDesc} has fields not defined in its schema. ${fieldsPart}`
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
default: {
|
|
108
|
+
return `Tree does not conform to schema: ${SchemaValidationError[error]}.`;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
42
111
|
}
|
|
43
112
|
|
|
44
113
|
type NotUndefined = number | string | boolean | bigint | symbol | object;
|
|
@@ -53,12 +122,14 @@ type NotUndefined = number | string | boolean | bigint | symbol | object;
|
|
|
53
122
|
export function isNodeInSchema<T extends NotUndefined>(
|
|
54
123
|
node: MinimalMapTreeNodeView,
|
|
55
124
|
schemaAndPolicy: SchemaAndPolicy,
|
|
56
|
-
onError: (error: SchemaValidationError) => T,
|
|
125
|
+
onError: (error: SchemaValidationError, context?: SchemaValidationErrorContext) => T,
|
|
57
126
|
): T | undefined {
|
|
58
127
|
// Validate the schema declared by the node exists
|
|
59
128
|
const schema = schemaAndPolicy.schema.nodeSchema.get(node.type);
|
|
60
129
|
if (schema === undefined) {
|
|
61
|
-
return onError(SchemaValidationError.Node_MissingSchema
|
|
130
|
+
return onError(SchemaValidationError.Node_MissingSchema, {
|
|
131
|
+
nodeType: node.type,
|
|
132
|
+
});
|
|
62
133
|
}
|
|
63
134
|
|
|
64
135
|
// Validate the node is well formed according to its schema
|
|
@@ -95,7 +166,10 @@ export function isNodeInSchema<T extends NotUndefined>(
|
|
|
95
166
|
// Code using this with a stored schema derived from a view schema rather than the document can be problematic because it may be missing unknown fields that the actual document has.
|
|
96
167
|
// Other schema evolution features like "staged" allowed types will likely cause similar issues elsewhere in this checker.
|
|
97
168
|
if (uncheckedFieldsFromNode.size > 0) {
|
|
98
|
-
return onError(SchemaValidationError.ObjectNode_FieldNotInSchema
|
|
169
|
+
return onError(SchemaValidationError.ObjectNode_FieldNotInSchema, {
|
|
170
|
+
nodeType: node.type,
|
|
171
|
+
unexpectedFields: uncheckedFieldsFromNode,
|
|
172
|
+
});
|
|
99
173
|
}
|
|
100
174
|
} else if (schema instanceof MapNodeStoredSchema) {
|
|
101
175
|
for (const [_key, field] of node.fields) {
|
|
@@ -128,7 +202,7 @@ export function isFieldInSchema<T extends NotUndefined>(
|
|
|
128
202
|
childNodes: MapTreeFieldViewGeneric<MinimalMapTreeNodeView>,
|
|
129
203
|
schema: TreeFieldStoredSchema,
|
|
130
204
|
schemaAndPolicy: SchemaAndPolicy,
|
|
131
|
-
onError: (error: SchemaValidationError) => T,
|
|
205
|
+
onError: (error: SchemaValidationError, context?: SchemaValidationErrorContext) => T,
|
|
132
206
|
): T | undefined {
|
|
133
207
|
// Validate that the field kind is handled by the schema policy
|
|
134
208
|
const kind = schemaAndPolicy.policy.fieldKinds.get(schema.kind);
|
|
@@ -147,7 +221,10 @@ export function isFieldInSchema<T extends NotUndefined>(
|
|
|
147
221
|
for (const node of childNodes) {
|
|
148
222
|
// Validate the type declared by the node is allowed in this field
|
|
149
223
|
if (schema.types !== undefined && !schema.types.has(node.type)) {
|
|
150
|
-
return onError(SchemaValidationError.Field_NodeTypeNotAllowed
|
|
224
|
+
return onError(SchemaValidationError.Field_NodeTypeNotAllowed, {
|
|
225
|
+
nodeType: node.type,
|
|
226
|
+
allowedTypes: schema.types,
|
|
227
|
+
});
|
|
151
228
|
}
|
|
152
229
|
|
|
153
230
|
// Validate the node complies with the type it declares to be.
|
package/src/index.ts
CHANGED
|
@@ -78,12 +78,14 @@ export {
|
|
|
78
78
|
type TreeIdentifierUtils,
|
|
79
79
|
independentView,
|
|
80
80
|
type IndependentViewOptions,
|
|
81
|
+
type IndependentViewTelemetryOptions,
|
|
81
82
|
createIndependentTreeBeta,
|
|
82
83
|
createIndependentTreeAlpha,
|
|
83
84
|
type CreateIndependentTreeAlphaOptions,
|
|
84
85
|
ForestTypeOptimized,
|
|
85
86
|
ForestTypeExpensiveDebug,
|
|
86
87
|
ForestTypeReference,
|
|
88
|
+
minimize,
|
|
87
89
|
} from "./shared-tree/index.js";
|
|
88
90
|
|
|
89
91
|
export {
|
|
@@ -415,3 +417,4 @@ export {
|
|
|
415
417
|
utf16LengthForCodePoints,
|
|
416
418
|
} from "./text/index.js";
|
|
417
419
|
export { ExtensibleUnionNode } from "./extensibleUnionNode.js";
|
|
420
|
+
export { Component } from "./componentApi.js";
|
package/src/packageVersion.ts
CHANGED
|
@@ -3,12 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
6
|
+
import type { IFluidHandle, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
8
8
|
import {
|
|
9
9
|
type IIdCompressor,
|
|
10
10
|
createIdCompressor,
|
|
11
11
|
} from "@fluidframework/id-compressor/internal";
|
|
12
|
+
import {
|
|
13
|
+
createChildLogger,
|
|
14
|
+
extractTelemetryLoggerExt,
|
|
15
|
+
} from "@fluidframework/telemetry-utils/internal";
|
|
12
16
|
|
|
13
17
|
import type { CodecWriteOptions, ICodecOptions } from "../codec/index.js";
|
|
14
18
|
import {
|
|
@@ -22,8 +26,8 @@ import {
|
|
|
22
26
|
FieldBatchDecodingContext,
|
|
23
27
|
defaultIncrementalEncodingPolicy,
|
|
24
28
|
schemaCodecBuilder,
|
|
29
|
+
combineChunks,
|
|
25
30
|
} from "../feature-libraries/index.js";
|
|
26
|
-
import { combineChunks } from "../feature-libraries/index.js";
|
|
27
31
|
import type {
|
|
28
32
|
TreeViewConfiguration,
|
|
29
33
|
ImplicitFieldSchema,
|
|
@@ -52,11 +56,28 @@ import {
|
|
|
52
56
|
} from "./sharedTree.js";
|
|
53
57
|
import { createTreeCheckout } from "./treeCheckout.js";
|
|
54
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Options for supplying a telemetry logger to an independent tree view.
|
|
61
|
+
* @remarks
|
|
62
|
+
* Events emitted by the independent tree are tagged with the `independentView` namespace.
|
|
63
|
+
* If no logger is provided, telemetry events are dropped.
|
|
64
|
+
* @alpha @input
|
|
65
|
+
*/
|
|
66
|
+
export interface IndependentViewTelemetryOptions {
|
|
67
|
+
/**
|
|
68
|
+
* Optional logger for telemetry.
|
|
69
|
+
*/
|
|
70
|
+
readonly logger?: ITelemetryBaseLogger | undefined;
|
|
71
|
+
}
|
|
72
|
+
|
|
55
73
|
/**
|
|
56
74
|
* {@link independentView} options.
|
|
57
75
|
* @alpha @input
|
|
58
76
|
*/
|
|
59
|
-
export interface IndependentViewOptions
|
|
77
|
+
export interface IndependentViewOptions
|
|
78
|
+
extends ForestOptions,
|
|
79
|
+
Partial<CodecWriteOptions>,
|
|
80
|
+
IndependentViewTelemetryOptions {
|
|
60
81
|
/**
|
|
61
82
|
* Optional ID compressor for generating and compressing identifiers.
|
|
62
83
|
* If not provided, a new one will be created.
|
|
@@ -69,6 +90,7 @@ export interface IndependentViewOptions extends ForestOptions, Partial<CodecWrit
|
|
|
69
90
|
* @alpha
|
|
70
91
|
*/
|
|
71
92
|
export type CreateIndependentTreeAlphaOptions = ForestOptions &
|
|
93
|
+
IndependentViewTelemetryOptions &
|
|
72
94
|
(
|
|
73
95
|
| (IndependentViewOptions & {
|
|
74
96
|
/**
|
|
@@ -120,7 +142,7 @@ export function independentView<const TSchema extends ImplicitFieldSchema>(
|
|
|
120
142
|
*/
|
|
121
143
|
export function independentInitializedView<const TSchema extends ImplicitFieldSchema>(
|
|
122
144
|
config: TreeViewConfiguration<TSchema>,
|
|
123
|
-
options: ForestOptions & ICodecOptions,
|
|
145
|
+
options: ForestOptions & ICodecOptions & IndependentViewTelemetryOptions,
|
|
124
146
|
content: ViewContent,
|
|
125
147
|
): TreeViewAlpha<TSchema> {
|
|
126
148
|
return createIndependentTreeAlpha({ ...options, content }).viewWith(
|
|
@@ -202,7 +224,13 @@ export function createIndependentTreeBeta<const TSchema extends ImplicitFieldSch
|
|
|
202
224
|
export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSchema>(
|
|
203
225
|
options?: CreateIndependentTreeAlphaOptions,
|
|
204
226
|
): ViewableTree & Pick<ITreeAlpha, "exportVerbose" | "exportSimpleSchema"> {
|
|
205
|
-
const
|
|
227
|
+
const logger = extractTelemetryLoggerExt(
|
|
228
|
+
createChildLogger({
|
|
229
|
+
logger: options?.logger,
|
|
230
|
+
namespace: "independentView",
|
|
231
|
+
}),
|
|
232
|
+
);
|
|
233
|
+
const breaker = new Breakable("independentView", logger);
|
|
206
234
|
const idCompressor: IIdCompressor =
|
|
207
235
|
options?.idCompressor ?? options?.content?.idCompressor ?? createIdCompressor();
|
|
208
236
|
const mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();
|
|
@@ -223,6 +251,7 @@ export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSc
|
|
|
223
251
|
forest,
|
|
224
252
|
schema: schemaRepository,
|
|
225
253
|
breaker,
|
|
254
|
+
logger,
|
|
226
255
|
codecOptions: options,
|
|
227
256
|
});
|
|
228
257
|
|
|
@@ -235,6 +264,7 @@ export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSc
|
|
|
235
264
|
// (finalized compressed ids or strings), so summary-style decode is correct.
|
|
236
265
|
const context = FieldBatchDecodingContext.forSummary({
|
|
237
266
|
idCompressor,
|
|
267
|
+
healing: undefined,
|
|
238
268
|
});
|
|
239
269
|
const fieldCursors = fieldBatchCodec.decode(
|
|
240
270
|
options.content.tree as JsonCompatibleReadOnly,
|
package/src/shared-tree/index.ts
CHANGED
|
@@ -43,6 +43,8 @@ export type {
|
|
|
43
43
|
SharedTreeEditBuilder,
|
|
44
44
|
} from "./sharedTreeEditBuilder.js";
|
|
45
45
|
|
|
46
|
+
export { minimize } from "./transactionMinimize.js";
|
|
47
|
+
|
|
46
48
|
export { Tree } from "./tree.js";
|
|
47
49
|
export type { RunTransaction } from "./tree.js";
|
|
48
50
|
|
|
@@ -57,6 +59,7 @@ export {
|
|
|
57
59
|
type ViewContent,
|
|
58
60
|
independentView,
|
|
59
61
|
type IndependentViewOptions,
|
|
62
|
+
type IndependentViewTelemetryOptions,
|
|
60
63
|
createIndependentTreeBeta,
|
|
61
64
|
createIndependentTreeAlpha,
|
|
62
65
|
type CreateIndependentTreeAlphaOptions,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
tryGetTreeNodeForField,
|
|
33
33
|
setField,
|
|
34
34
|
normalizeFieldSchema,
|
|
35
|
-
|
|
35
|
+
checkSchemaCompatibility,
|
|
36
36
|
type InsertableContent,
|
|
37
37
|
type TreeViewConfiguration,
|
|
38
38
|
type TreeViewAlpha,
|
|
@@ -57,6 +57,7 @@ import {
|
|
|
57
57
|
toInitialSchema,
|
|
58
58
|
toUpgradeSchema,
|
|
59
59
|
type TreeBranchAlpha,
|
|
60
|
+
type TreeSchema,
|
|
60
61
|
} from "../simple-tree/index.js";
|
|
61
62
|
import {
|
|
62
63
|
type Breakable,
|
|
@@ -98,7 +99,7 @@ export class SchematizingSimpleTreeView<
|
|
|
98
99
|
IEmitter<TreeViewEvents & TreeBranchEvents> &
|
|
99
100
|
HasListeners<TreeViewEvents & TreeBranchEvents> = createEmitter();
|
|
100
101
|
|
|
101
|
-
private readonly viewSchema:
|
|
102
|
+
private readonly viewSchema: TreeSchema;
|
|
102
103
|
|
|
103
104
|
/**
|
|
104
105
|
* Events to unregister upon flex-tree view disposal.
|
|
@@ -143,7 +144,7 @@ export class SchematizingSimpleTreeView<
|
|
|
143
144
|
|
|
144
145
|
const configAlpha = new TreeViewConfigurationAlpha({ schema: config.schema });
|
|
145
146
|
|
|
146
|
-
this.viewSchema =
|
|
147
|
+
this.viewSchema = configAlpha;
|
|
147
148
|
// This must be initialized before `update` can be called.
|
|
148
149
|
this.currentCompatibility = {
|
|
149
150
|
canView: false,
|
|
@@ -258,7 +259,7 @@ export class SchematizingSimpleTreeView<
|
|
|
258
259
|
);
|
|
259
260
|
}
|
|
260
261
|
|
|
261
|
-
const newSchema = toUpgradeSchema(this.viewSchema.
|
|
262
|
+
const newSchema = toUpgradeSchema(this.viewSchema.root);
|
|
262
263
|
this.runSchemaEdit(() => this.checkout.updateSchema(newSchema));
|
|
263
264
|
}
|
|
264
265
|
|
|
@@ -347,7 +348,10 @@ export class SchematizingSimpleTreeView<
|
|
|
347
348
|
private update(): void {
|
|
348
349
|
this.disposeFlexView();
|
|
349
350
|
|
|
350
|
-
const compatibility =
|
|
351
|
+
const compatibility = checkSchemaCompatibility(
|
|
352
|
+
this.viewSchema,
|
|
353
|
+
this.checkout.storedSchema,
|
|
354
|
+
);
|
|
351
355
|
|
|
352
356
|
this.currentCompatibility = {
|
|
353
357
|
...compatibility,
|
|
@@ -533,5 +537,11 @@ export class SchematizingSimpleTreeView<
|
|
|
533
537
|
return this.checkout.isMissingEditsFrom(context);
|
|
534
538
|
}
|
|
535
539
|
|
|
540
|
+
public computeNetChangeIfRebasedOnto(
|
|
541
|
+
context: TreeBranchAlpha,
|
|
542
|
+
): JsonCompatibleReadOnly | undefined {
|
|
543
|
+
return this.checkout.computeNetChangeIfRebasedOnto(context);
|
|
544
|
+
}
|
|
545
|
+
|
|
536
546
|
// #endregion Branching
|
|
537
547
|
}
|