@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
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
IIdCompressor,
|
|
12
12
|
SessionId,
|
|
13
13
|
SessionSpaceCompressedId,
|
|
14
|
+
StableId,
|
|
14
15
|
} from "@fluidframework/id-compressor";
|
|
15
16
|
import type {
|
|
16
17
|
IExperimentalIncrementalSummaryContext,
|
|
@@ -23,7 +24,7 @@ import type {
|
|
|
23
24
|
IChannelView,
|
|
24
25
|
IFluidSerializer,
|
|
25
26
|
} from "@fluidframework/shared-object-base/internal";
|
|
26
|
-
import { createChildLogger } from "@fluidframework/telemetry-utils/internal";
|
|
27
|
+
import { createChildLogger, UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
27
28
|
|
|
28
29
|
import type { CodecWriteOptions, DependentFormatVersion, IJsonCodec } from "../codec/index.js";
|
|
29
30
|
import {
|
|
@@ -78,6 +79,11 @@ export interface SharedTreeCoreOptionsInternal extends CodecWriteOptions {
|
|
|
78
79
|
* See {@link SharedTreeOptionsBeta.healUnresolvableIdentifiersOnDecode}.
|
|
79
80
|
*/
|
|
80
81
|
readonly healUnresolvableIdentifiersOnDecode?: boolean;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* {@inheritDoc SharedTreeOptions.retainHistory}
|
|
85
|
+
*/
|
|
86
|
+
readonly retainHistory?: boolean;
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
export interface EnrichmentConfig<TChange> {
|
|
@@ -124,6 +130,8 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
124
130
|
|
|
125
131
|
private readonly schemaAndPolicy: ClonableSchemaAndPolicy;
|
|
126
132
|
|
|
133
|
+
private static readonly maxBranchNameLength = 1024;
|
|
134
|
+
|
|
127
135
|
/**
|
|
128
136
|
* @param summarizables - Summarizers for all indexes used by this tree
|
|
129
137
|
* @param changeFamily - The change family
|
|
@@ -179,6 +187,7 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
179
187
|
this.mintRevisionTag,
|
|
180
188
|
(branchId) => this.registerSharedBranch(branchId),
|
|
181
189
|
rebaseLogger,
|
|
190
|
+
options.retainHistory ?? false,
|
|
182
191
|
);
|
|
183
192
|
|
|
184
193
|
this.registerSharedBranch("main");
|
|
@@ -391,9 +400,9 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
391
400
|
this.getResubmitMachine(branchId).onCommitSubmitted(enrichedCommit);
|
|
392
401
|
}
|
|
393
402
|
|
|
394
|
-
protected submitBranchCreation(branchId: BranchId): void {
|
|
403
|
+
protected submitBranchCreation(branchId: BranchId, branchName?: string): void {
|
|
395
404
|
this.submitMessage(
|
|
396
|
-
{ type: "branch", sessionId: this.editManager.localSessionId, branchId },
|
|
405
|
+
{ type: "branch", sessionId: this.editManager.localSessionId, branchId, branchName },
|
|
397
406
|
this.schemaAndPolicy,
|
|
398
407
|
);
|
|
399
408
|
}
|
|
@@ -471,6 +480,7 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
471
480
|
messagesSessionId,
|
|
472
481
|
brand(envelope.referenceSequenceNumber),
|
|
473
482
|
message.branchId,
|
|
483
|
+
message.branchName,
|
|
474
484
|
);
|
|
475
485
|
break;
|
|
476
486
|
}
|
|
@@ -519,21 +529,34 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
519
529
|
.filter((id): id is SessionSpaceCompressedId => id !== "main")
|
|
520
530
|
.map((id) => this.idCompressor.decompress(id));
|
|
521
531
|
}
|
|
522
|
-
public createSharedBranch(): string {
|
|
532
|
+
public createSharedBranch(branchName?: string): string {
|
|
533
|
+
if (branchName !== undefined && branchName.length > SharedTreeCore.maxBranchNameLength) {
|
|
534
|
+
throw new UsageError(
|
|
535
|
+
`Branch name is too long: ${branchName.length} > maxBranchNameLength`,
|
|
536
|
+
);
|
|
537
|
+
}
|
|
523
538
|
const branchId = this.idCompressor.generateCompressedId();
|
|
524
|
-
this.addBranch(branchId);
|
|
525
|
-
this.submitBranchCreation(branchId);
|
|
539
|
+
this.addBranch(branchId, branchName);
|
|
540
|
+
this.submitBranchCreation(branchId, branchName);
|
|
526
541
|
return this.idCompressor.decompress(branchId);
|
|
527
542
|
}
|
|
528
543
|
|
|
529
|
-
protected addBranch(branchId: BranchId): void {
|
|
530
|
-
this.editManager.addNewBranch(branchId);
|
|
544
|
+
protected addBranch(branchId: BranchId, branchName?: string): void {
|
|
545
|
+
this.editManager.addNewBranch(branchId, branchName);
|
|
531
546
|
}
|
|
532
547
|
|
|
533
548
|
public getSharedBranch(branchId: BranchId): SharedTreeBranch<TEditor, TChange> {
|
|
534
549
|
return this.editManager.getLocalBranch(branchId);
|
|
535
550
|
}
|
|
536
551
|
|
|
552
|
+
public getSharedBranchName(branchId: string): string | undefined {
|
|
553
|
+
const compressedId = this.idCompressor.tryRecompress(branchId as StableId);
|
|
554
|
+
if (compressedId === undefined) {
|
|
555
|
+
throw new UsageError(`No branch found with id: ${branchId}`);
|
|
556
|
+
}
|
|
557
|
+
return this.editManager.getSharedBranchName(compressedId);
|
|
558
|
+
}
|
|
559
|
+
|
|
537
560
|
public didAttach(): void {
|
|
538
561
|
this.detachedRevision = undefined;
|
|
539
562
|
}
|
|
@@ -574,7 +597,7 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
574
597
|
break;
|
|
575
598
|
}
|
|
576
599
|
case "branch": {
|
|
577
|
-
this.submitBranchCreation(message.branchId);
|
|
600
|
+
this.submitBranchCreation(message.branchId, message.branchName);
|
|
578
601
|
break;
|
|
579
602
|
}
|
|
580
603
|
default: {
|
|
@@ -631,7 +654,7 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
631
654
|
break;
|
|
632
655
|
}
|
|
633
656
|
case "branch": {
|
|
634
|
-
this.editManager.addNewBranch(message.branchId);
|
|
657
|
+
this.editManager.addNewBranch(message.branchId, message.branchName);
|
|
635
658
|
break;
|
|
636
659
|
}
|
|
637
660
|
default: {
|
|
@@ -464,6 +464,17 @@ export class SquashingTransactionStack<
|
|
|
464
464
|
const change =
|
|
465
465
|
postProcessor === undefined ? squash : postProcessor.processChange(squash);
|
|
466
466
|
|
|
467
|
+
if (change !== squash) {
|
|
468
|
+
// The post-processor produced a change that differs from the
|
|
469
|
+
// one that was applied to the view as the transaction's edits
|
|
470
|
+
// were made. Roll back the transaction's changes on the transaction
|
|
471
|
+
// branch (which rolls back the view) and apply the post-processed
|
|
472
|
+
// change in their place so that the view fully reflects the modified
|
|
473
|
+
// `change`.
|
|
474
|
+
transactionBranch.removeAfter(startHead);
|
|
475
|
+
transactionBranch.apply(tagChange(change, transactionRevision));
|
|
476
|
+
}
|
|
477
|
+
|
|
467
478
|
if (targetPath.length === 0) {
|
|
468
479
|
// No changes were made on the original branch since the transaction began
|
|
469
480
|
// The transaction commit can be applied directly
|
|
@@ -548,8 +559,14 @@ export class SquashingTransactionStack<
|
|
|
548
559
|
);
|
|
549
560
|
const squash = rebaser.compose(nestedSteps);
|
|
550
561
|
const processedSquash = nestedPostProcessor.processChange(squash);
|
|
551
|
-
|
|
552
|
-
|
|
562
|
+
// Roll back the transaction branch to the nested start head and apply the
|
|
563
|
+
// processed change if it differs from the original change.
|
|
564
|
+
if (processedSquash !== squash) {
|
|
565
|
+
transactionBranch.removeAfter(nestedStartHead);
|
|
566
|
+
transactionBranch.apply(
|
|
567
|
+
tagChange(processedSquash, transactionRevision),
|
|
568
|
+
);
|
|
569
|
+
}
|
|
553
570
|
}
|
|
554
571
|
}
|
|
555
572
|
break;
|
|
@@ -100,7 +100,7 @@ export {
|
|
|
100
100
|
export type { TreeSchemaEncodingOptions } from "./getJsonSchema.js";
|
|
101
101
|
export { getJsonSchema } from "./getJsonSchema.js";
|
|
102
102
|
export { getSimpleSchema } from "./getSimpleSchema.js";
|
|
103
|
-
export {
|
|
103
|
+
export { checkSchemaCompatibility } from "./schemaCompatibilityTester.js";
|
|
104
104
|
export type {
|
|
105
105
|
Unenforced,
|
|
106
106
|
FieldSchemaAlphaUnsafe,
|
|
@@ -12,58 +12,46 @@ import { getDiscrepanciesInAllowedContent } from "./discrepancies.js";
|
|
|
12
12
|
import type { SchemaCompatibilityStatus } from "./tree.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Determines the compatibility of a stored document
|
|
16
|
+
* (based on its stored schema) with a viewer (based on its view schema).
|
|
17
|
+
*
|
|
16
18
|
* @remarks
|
|
17
|
-
*
|
|
19
|
+
* Adapters can be provided to handle differences between the two schema.
|
|
20
|
+
* Adapters should only use to types in the `view` SchemaRepository.
|
|
21
|
+
*
|
|
22
|
+
* TODO: this API violates the parse don't validate design philosophy.
|
|
23
|
+
* It should be wrapped with (or replaced by) a parse style API.
|
|
18
24
|
*/
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
public checkCompatibility(
|
|
38
|
-
stored: TreeStoredSchema,
|
|
39
|
-
): Omit<SchemaCompatibilityStatus, "canInitialize"> {
|
|
40
|
-
// The public API surface assumes defaultSchemaPolicy
|
|
41
|
-
const policy = defaultSchemaPolicy;
|
|
42
|
-
|
|
43
|
-
// View schema allows a subset of documents that stored schema does, and the discrepancies are allowed by policy
|
|
44
|
-
// determined by the view schema (i.e. objects with extra optional fields in the stored schema have opted into allowing this.
|
|
45
|
-
// In the future, this would also include things like:
|
|
46
|
-
// - fields with more allowed types in the stored schema than in the view schema have out-of-schema "unknown content" adapters
|
|
47
|
-
let canView = true;
|
|
48
|
-
|
|
49
|
-
for (const _discrepancy of getDiscrepanciesInAllowedContent(this.viewSchema, stored)) {
|
|
50
|
-
canView = false;
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
25
|
+
export function checkSchemaCompatibility(
|
|
26
|
+
viewSchema: TreeSchema,
|
|
27
|
+
stored: TreeStoredSchema,
|
|
28
|
+
): Omit<SchemaCompatibilityStatus, "canInitialize"> {
|
|
29
|
+
// The public API surface assumes defaultSchemaPolicy
|
|
30
|
+
const policy = defaultSchemaPolicy;
|
|
31
|
+
|
|
32
|
+
// View schema allows a subset of documents that stored schema does, and the discrepancies are allowed by policy
|
|
33
|
+
// determined by the view schema (i.e. objects with extra optional fields in the stored schema have opted into allowing this.
|
|
34
|
+
// In the future, this would also include things like:
|
|
35
|
+
// - fields with more allowed types in the stored schema than in the view schema have out-of-schema "unknown content" adapters
|
|
36
|
+
let canView = true;
|
|
37
|
+
|
|
38
|
+
for (const _discrepancy of getDiscrepanciesInAllowedContent(viewSchema, stored)) {
|
|
39
|
+
canView = false;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
53
42
|
|
|
54
|
-
|
|
43
|
+
const wouldUpgradeTo = toUpgradeSchema(viewSchema.root);
|
|
55
44
|
|
|
56
|
-
|
|
45
|
+
const canUpgrade = allowsRepoSuperset(policy, stored, wouldUpgradeTo);
|
|
57
46
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
// If true, then upgrading has no effect on what can be stored in the document.
|
|
48
|
+
// TODO: This should likely be changed to indicate up a schema upgrade would be a no-op, including stored schema metadata.
|
|
49
|
+
const isEquivalent =
|
|
50
|
+
canView && canUpgrade && allowsRepoSuperset(policy, wouldUpgradeTo, stored);
|
|
62
51
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
52
|
+
return {
|
|
53
|
+
canView,
|
|
54
|
+
canUpgrade,
|
|
55
|
+
isEquivalent,
|
|
56
|
+
};
|
|
69
57
|
}
|
|
@@ -80,6 +80,8 @@ import type {
|
|
|
80
80
|
* Values should be preferred over generator functions when possible, as they are simpler and more efficient.
|
|
81
81
|
* Generator functions should be used when the default value needs to be dynamic or when it is not possible to provide a value directly.
|
|
82
82
|
*
|
|
83
|
+
* See {@link SchemaStaticsAlpha.withDefault} for the primary API that uses this type.
|
|
84
|
+
*
|
|
83
85
|
* @example
|
|
84
86
|
* ```typescript
|
|
85
87
|
* // Provide a value directly
|
|
@@ -102,27 +104,63 @@ export type NodeProvider<T> = T | (() => T);
|
|
|
102
104
|
*/
|
|
103
105
|
export interface SchemaStaticsAlpha {
|
|
104
106
|
/**
|
|
105
|
-
* Creates a field schema with a default value.
|
|
106
|
-
*
|
|
107
|
+
* Creates a field schema with a default value.
|
|
108
|
+
*
|
|
109
|
+
* @remarks
|
|
110
|
+
* Fields with defaults are optional in constructors, allowing them to be omitted when creating new nodes.
|
|
111
|
+
* This works with both {@link SchemaStatics.required | required} and {@link SchemaStatics.optional | optional} fields:
|
|
112
|
+
*
|
|
113
|
+
* - **Required fields with defaults**: The field is always present in the tree, but can be omitted from the constructor.
|
|
114
|
+
* The default value is used when the field is not provided.
|
|
115
|
+
*
|
|
116
|
+
* - **Optional fields with defaults**: Optional fields already default to `undefined`, but `withDefault` lets you
|
|
117
|
+
* specify a different default value.
|
|
118
|
+
*
|
|
119
|
+
* The default value can be provided in two ways (see {@link NodeProvider}):
|
|
120
|
+
*
|
|
121
|
+
* 1. **A value**: The value is deep-copied for each use, ensuring independence between instances.
|
|
122
|
+
* Prefer this when the default is a fixed value.
|
|
123
|
+
*
|
|
124
|
+
* 2. **A generator function**: A function called each time a default is needed. Use this for dynamic defaults
|
|
125
|
+
* (e.g., timestamps, UUIDs) or when explicit control over value creation is required.
|
|
126
|
+
*
|
|
127
|
+
* Defaults are evaluated eagerly during node construction.
|
|
128
|
+
*
|
|
129
|
+
* For recursive schemas, use {@link SchemaStaticsAlpha.withDefaultRecursive} instead.
|
|
130
|
+
*
|
|
131
|
+
* See the {@link https://fluidframework.com/docs/data-structures/tree/schema-definition/default-field-values | Default Field Values documentation}
|
|
132
|
+
* for a comprehensive guide with additional examples.
|
|
107
133
|
*
|
|
108
134
|
* @param fieldSchema - The field schema to add a default to (e.g., `factory.required(factory.string)` or `factory.optional(factory.number)`)
|
|
109
135
|
* @param defaultValue - A {@link NodeProvider} specifying the default value.
|
|
110
136
|
*
|
|
111
137
|
* @example
|
|
138
|
+
* A schema with a mix of required, defaulted, and dynamic fields:
|
|
112
139
|
* ```typescript
|
|
113
|
-
* const
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* //
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
140
|
+
* const factory = new SchemaFactoryAlpha("example");
|
|
141
|
+
*
|
|
142
|
+
* class Task extends factory.objectAlpha("Task", {
|
|
143
|
+
* // No default — must always be provided in the constructor
|
|
144
|
+
* title: factory.required(factory.string),
|
|
145
|
+
*
|
|
146
|
+
* // Required field with a static default
|
|
147
|
+
* status: factory.withDefault(factory.required(factory.string), "todo"),
|
|
148
|
+
*
|
|
149
|
+
* // Optional field with a custom default (instead of `undefined`)
|
|
150
|
+
* priority: factory.withDefault(factory.optional(factory.number), 0),
|
|
151
|
+
*
|
|
152
|
+
* // Dynamic default using a generator function
|
|
153
|
+
* createdAt: factory.withDefault(factory.required(factory.number), () => Date.now()),
|
|
154
|
+
* }) {}
|
|
155
|
+
*
|
|
156
|
+
* // Only `title` is required in the constructor; the rest use their defaults
|
|
157
|
+
* const task = new Task({ title: "Write docs" });
|
|
158
|
+
* // task.status === "todo"
|
|
159
|
+
* // task.priority === 0
|
|
160
|
+
* // task.createdAt is set to the current timestamp
|
|
161
|
+
*
|
|
162
|
+
* // Defaults can be overridden by providing explicit values
|
|
163
|
+
* const urgentTask = new Task({ title: "Fix bug", status: "in-progress", priority: 1 });
|
|
126
164
|
* ```
|
|
127
165
|
*
|
|
128
166
|
* @privateRemarks
|
|
@@ -208,6 +246,9 @@ export interface SchemaStaticsAlpha {
|
|
|
208
246
|
* @remarks
|
|
209
247
|
* This version of {@link SchemaStaticsAlpha.withDefault} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.
|
|
210
248
|
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
249
|
+
*
|
|
250
|
+
* See the {@link https://fluidframework.com/docs/data-structures/tree/schema-definition/default-field-values#recursive-types | Default Field Values — Recursive Types documentation}
|
|
251
|
+
* for usage examples and guidance on avoiding infinite recursion with recursive defaults.
|
|
211
252
|
*/
|
|
212
253
|
withDefaultRecursive: <
|
|
213
254
|
Kind extends FieldKind,
|
|
@@ -94,9 +94,6 @@ export interface SchemaStaticsBeta {
|
|
|
94
94
|
* A full code example of the schema migration process can be found in our {@link https://github.com/microsoft/FluidFramework/blob/main/packages/dds/tree/src/test/simple-tree/api/stagedSchemaUpgrade.spec.ts | tests}.
|
|
95
95
|
*
|
|
96
96
|
* @privateRemarks
|
|
97
|
-
* TODO:#44317 staged allowed types rely on schema validation of stored schema to output errors, these errors are not very
|
|
98
|
-
* user friendly and should be improved, particularly in the case of staged allowed types
|
|
99
|
-
*
|
|
100
97
|
* TODO: AB#45711: Update the docs above when recursive type support is added.
|
|
101
98
|
*/
|
|
102
99
|
readonly staged: <const T extends LazyItem<TreeNodeSchema>>(
|
|
@@ -13,7 +13,7 @@ import { toInitialSchema } from "../toStoredSchema.js";
|
|
|
13
13
|
import { createTreeSchema } from "../treeSchema.js";
|
|
14
14
|
|
|
15
15
|
import { TreeViewConfigurationAlpha, TreeViewConfiguration } from "./configuration.js";
|
|
16
|
-
import {
|
|
16
|
+
import { checkSchemaCompatibility } from "./schemaCompatibilityTester.js";
|
|
17
17
|
import { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
|
|
18
18
|
import {
|
|
19
19
|
decodeSchemaCompatibilitySnapshot,
|
|
@@ -78,8 +78,7 @@ export function checkCompatibility(
|
|
|
78
78
|
): Omit<SchemaCompatibilityStatus, "canInitialize"> {
|
|
79
79
|
const viewAsAlpha = new TreeViewConfigurationAlpha({ schema: view.schema });
|
|
80
80
|
const stored = toInitialSchema(viewWhichCreatedStoredSchema.schema);
|
|
81
|
-
|
|
82
|
-
return tester.checkCompatibility(stored);
|
|
81
|
+
return checkSchemaCompatibility(viewAsAlpha, stored);
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
/**
|
|
@@ -13,7 +13,7 @@ import { normalizeFieldSchema, type ImplicitFieldSchema } from "../fieldSchema.j
|
|
|
13
13
|
import { toStoredSchema } from "../toStoredSchema.js";
|
|
14
14
|
|
|
15
15
|
import { TreeViewConfigurationAlpha } from "./configuration.js";
|
|
16
|
-
import {
|
|
16
|
+
import { checkSchemaCompatibility } from "./schemaCompatibilityTester.js";
|
|
17
17
|
import type { SchemaCompatibilityStatus } from "./tree.js";
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -104,6 +104,5 @@ export function comparePersistedSchema(
|
|
|
104
104
|
const config = new TreeViewConfigurationAlpha({
|
|
105
105
|
schema: normalizeFieldSchema(view),
|
|
106
106
|
});
|
|
107
|
-
|
|
108
|
-
return viewSchema.checkCompatibility(stored);
|
|
107
|
+
return checkSchemaCompatibility(config, stored);
|
|
109
108
|
}
|
|
@@ -112,8 +112,20 @@ export interface ITreeAlpha extends ITree {
|
|
|
112
112
|
/**
|
|
113
113
|
* Creates a fork of the current state of the main branch.
|
|
114
114
|
* This new branch will be shared with and editable by all clients.
|
|
115
|
+
* @param name - Optional name for the new branch.
|
|
116
|
+
* This name is not guaranteed to be unique.
|
|
117
|
+
* (Maximum {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length | length}: 1024)
|
|
118
|
+
* @returns The ID of the new branch, which can be used to {@link ITreeAlpha.viewSharedBranchWith | view} the branch.
|
|
115
119
|
*/
|
|
116
|
-
createSharedBranch(): string;
|
|
120
|
+
createSharedBranch(name?: string): string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Retrieves the name, if any, of the shared branch with the given ID.
|
|
124
|
+
* @param branchId - The ID of the shared branch to retrieve the name of.
|
|
125
|
+
* @returns The name of the shared branch, or `undefined` if the branch has no assigned name.
|
|
126
|
+
* @throws if the branch with the given ID does not exist.
|
|
127
|
+
*/
|
|
128
|
+
getSharedBranchName(branchId: string): string | undefined;
|
|
117
129
|
|
|
118
130
|
/**
|
|
119
131
|
* Returns a list of all shared branches that currently exist on this tree.
|
|
@@ -376,6 +388,16 @@ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
|
|
|
376
388
|
* @throws UsageError if the branches are unrelated.
|
|
377
389
|
*/
|
|
378
390
|
isMissingEditsFrom(branch: TreeBranch): boolean;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Computes the net change that would result if this branch were {@link TreeBranch.rebaseOnto | rebased onto} the given branch.
|
|
394
|
+
* Note that this method does not actually perform the rebase and therefore has no effect on this branch.
|
|
395
|
+
*
|
|
396
|
+
* @param branch - The branch that would be rebased onto.
|
|
397
|
+
* @returns The net change that would result if this branch were rebased onto the given branch,
|
|
398
|
+
* or `undefined` if rebasing would have no impact.
|
|
399
|
+
*/
|
|
400
|
+
computeNetChangeIfRebasedOnto(branch: TreeBranch): JsonCompatibleReadOnly | undefined;
|
|
379
401
|
}
|
|
380
402
|
|
|
381
403
|
/**
|
|
@@ -578,7 +600,7 @@ export interface TreeViewAlpha<
|
|
|
578
600
|
* See SharedTree's README for more information about choosing a compatibility policy.
|
|
579
601
|
*
|
|
580
602
|
* @privateRemarks
|
|
581
|
-
* See {@link
|
|
603
|
+
* See {@link checkSchemaCompatibility} for the implementation of this compatibility checking.
|
|
582
604
|
*
|
|
583
605
|
* @sealed @public
|
|
584
606
|
*/
|
|
@@ -21,6 +21,7 @@ import type {
|
|
|
21
21
|
TreeLeafValue,
|
|
22
22
|
FlexListToUnion,
|
|
23
23
|
LazyItem,
|
|
24
|
+
NumberKeys,
|
|
24
25
|
AnnotatedAllowedType,
|
|
25
26
|
AnnotatedAllowedTypes,
|
|
26
27
|
} from "../core/index.js";
|
|
@@ -260,7 +261,7 @@ export namespace System_Unsafe {
|
|
|
260
261
|
>
|
|
261
262
|
? InsertableTypedNodeUnsafe<TSchema>
|
|
262
263
|
: never;
|
|
263
|
-
}[
|
|
264
|
+
}[NumberKeys<TList>];
|
|
264
265
|
|
|
265
266
|
/**
|
|
266
267
|
* {@link Unenforced} version of {@link InsertableTypedNode}.
|
package/src/simple-tree/index.ts
CHANGED