@fluidframework/tree 2.103.0 → 2.111.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/.vscode/settings.json +1 -0
- package/CHANGELOG.md +109 -0
- package/api-report/tree.alpha.api.md +60 -34
- package/api-report/tree.beta.api.md +49 -3
- package/api-report/tree.legacy.beta.api.md +49 -3
- package/dist/codec/versioned/format.js +2 -24
- package/dist/codec/versioned/format.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +3 -10
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/rebase/types.d.ts +2 -2
- package/dist/core/rebase/types.js +2 -24
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/formatV1.js +2 -24
- package/dist/core/schema-stored/formatV1.js.map +1 -1
- package/dist/core/schema-stored/formatV2.js +2 -24
- package/dist/core/schema-stored/formatV2.js.map +1 -1
- package/dist/core/schema-stored/index.js +3 -25
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +2 -2
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/tree/anchorSet.js +4 -8
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -24
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.js +2 -24
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js +2 -24
- package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/entrypoints/beta.d.ts +1 -1
- package/dist/entrypoints/beta.d.ts.map +1 -1
- package/dist/entrypoints/beta.js.map +1 -1
- package/dist/entrypoints/internal.js +2 -15
- package/dist/entrypoints/internal.js.map +1 -1
- package/dist/entrypoints/legacy.d.ts +1 -1
- package/dist/entrypoints/legacy.d.ts.map +1 -1
- package/dist/entrypoints/legacy.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +7 -11
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +13 -32
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +83 -9
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +11 -0
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +9 -19
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +3 -13
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -6
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.js +2 -24
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +4 -25
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +2 -24
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +10 -30
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -24
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +2 -24
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -5
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +11 -55
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +2 -24
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +2 -24
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +2 -24
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +2 -24
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +2 -24
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.js +2 -24
- package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js +2 -24
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.js +2 -24
- package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -25
- 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.map +1 -1
- package/dist/shared-tree/independentView.js +4 -7
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +6 -5
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +7 -41
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +5 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +13 -49
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.js +2 -24
- package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/dist/shared-tree/transactionPostProcessor.d.ts +28 -0
- package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -0
- package/dist/shared-tree/transactionPostProcessor.js +28 -0
- package/dist/shared-tree/transactionPostProcessor.js.map +1 -0
- package/dist/shared-tree/treeAlpha.js +3 -3
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +28 -15
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +124 -145
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.d.ts +5 -5
- package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/branch.js +13 -17
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -2
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -4
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +2 -24
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +2 -24
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +2 -24
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +5 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +5 -10
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +1 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -2
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -24
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +2 -24
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +2 -24
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +9 -44
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +84 -9
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +94 -37
- 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.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +1 -1
- package/dist/simple-tree/api/schemaFactory.js +2 -2
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +2 -24
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +4 -26
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +91 -28
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +96 -22
- 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/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +83 -93
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -7
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +6 -10
- package/dist/simple-tree/core/unhydratedFlexTree.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.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +2 -12
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +2 -6
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +2 -24
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/tableSchema.d.ts +50 -4
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +202 -106
- package/dist/tableSchema.js.map +1 -1
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +3 -1
- package/dist/text/index.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +69 -758
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +275 -322
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/text/textDomainFormattedDefault.d.ts +273 -0
- package/dist/text/textDomainFormattedDefault.d.ts.map +1 -0
- package/dist/text/textDomainFormattedDefault.js +94 -0
- package/dist/text/textDomainFormattedDefault.js.map +1 -0
- package/dist/util/arrayUtilities.d.ts +20 -0
- package/dist/util/arrayUtilities.d.ts.map +1 -1
- package/dist/util/arrayUtilities.js +24 -1
- package/dist/util/arrayUtilities.js.map +1 -1
- package/dist/util/compressedIds.d.ts +118 -0
- package/dist/util/compressedIds.d.ts.map +1 -0
- package/dist/util/compressedIds.js +133 -0
- package/dist/util/compressedIds.js.map +1 -0
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +11 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/rangeMap.d.ts +13 -0
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +69 -8
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/typeboxBrand.js +2 -24
- package/dist/util/typeboxBrand.js.map +1 -1
- package/dist/util/utils.js +2 -24
- package/dist/util/utils.js.map +1 -1
- package/eslint.config.mts +0 -30
- package/lib/core/change-family/changeFamily.d.ts +3 -10
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/rebase/types.d.ts +2 -2
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +2 -2
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/tree/anchorSet.js +1 -5
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/entrypoints/beta.d.ts +1 -1
- package/lib/entrypoints/beta.d.ts.map +1 -1
- package/lib/entrypoints/beta.js.map +1 -1
- package/lib/entrypoints/legacy.d.ts +1 -1
- package/lib/entrypoints/legacy.d.ts.map +1 -1
- package/lib/entrypoints/legacy.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +1 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +14 -33
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +82 -9
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +12 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +1 -11
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +1 -11
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -6
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- 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/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -10
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +10 -30
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -5
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +1 -45
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -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.map +1 -1
- package/lib/shared-tree/independentView.js +5 -8
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +6 -5
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +4 -38
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +5 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +9 -45
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/transactionPostProcessor.d.ts +28 -0
- package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -0
- package/lib/shared-tree/transactionPostProcessor.js +23 -0
- package/lib/shared-tree/transactionPostProcessor.js.map +1 -0
- package/lib/shared-tree/treeAlpha.js +3 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +28 -15
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +80 -101
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.d.ts +5 -5
- package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -5
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -2
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +3 -5
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +5 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +5 -10
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +1 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +1 -1
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +4 -39
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +84 -9
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +74 -17
- 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.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +1 -1
- package/lib/simple-tree/api/schemaFactory.js +2 -2
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +91 -28
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +96 -22
- 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/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +1 -11
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -7
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +1 -5
- package/lib/simple-tree/core/unhydratedFlexTree.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.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +1 -11
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +1 -5
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/tableSchema.d.ts +50 -4
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +171 -75
- package/lib/tableSchema.js.map +1 -1
- package/lib/text/index.d.ts +1 -0
- package/lib/text/index.d.ts.map +1 -1
- package/lib/text/index.js +1 -0
- package/lib/text/index.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +69 -758
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +277 -324
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/text/textDomainFormattedDefault.d.ts +273 -0
- package/lib/text/textDomainFormattedDefault.d.ts.map +1 -0
- package/lib/text/textDomainFormattedDefault.js +91 -0
- package/lib/text/textDomainFormattedDefault.js.map +1 -0
- package/lib/util/arrayUtilities.d.ts +20 -0
- package/lib/util/arrayUtilities.d.ts.map +1 -1
- package/lib/util/arrayUtilities.js +22 -0
- package/lib/util/arrayUtilities.js.map +1 -1
- package/lib/util/compressedIds.d.ts +118 -0
- package/lib/util/compressedIds.d.ts.map +1 -0
- package/lib/util/compressedIds.js +124 -0
- package/lib/util/compressedIds.js.map +1 -0
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/rangeMap.d.ts +13 -0
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +69 -8
- package/lib/util/rangeMap.js.map +1 -1
- package/package.json +25 -24
- package/src/core/change-family/changeFamily.ts +3 -12
- package/src/core/rebase/types.ts +2 -2
- package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
- package/src/entrypoints/alpha.ts +12 -8
- package/src/entrypoints/beta.ts +8 -0
- package/src/entrypoints/legacy.ts +8 -0
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +35 -64
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +138 -42
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +32 -4
- package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
- package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +7 -19
- package/src/feature-libraries/chunked-forest/index.ts +3 -0
- package/src/feature-libraries/forest-summary/codec.ts +5 -3
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -5
- package/src/feature-libraries/index.ts +3 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +13 -9
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -47
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +0 -5
- package/src/index.ts +13 -8
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +5 -10
- package/src/shared-tree/index.ts +1 -0
- package/src/shared-tree/schematizingTreeView.ts +29 -25
- package/src/shared-tree/sharedTree.ts +18 -10
- package/src/shared-tree/transactionPostProcessor.ts +40 -0
- package/src/shared-tree/treeAlpha.ts +3 -3
- package/src/shared-tree/treeCheckout.ts +120 -95
- package/src/shared-tree/unhydratedTreeContext.ts +18 -15
- package/src/shared-tree-core/editManagerCodecs.ts +3 -2
- package/src/shared-tree-core/editManagerCodecsCommons.ts +10 -14
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -2
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +5 -9
- package/src/shared-tree-core/index.ts +8 -5
- package/src/shared-tree-core/sharedTreeCore.ts +3 -2
- package/src/shared-tree-core/transaction.ts +148 -18
- package/src/simple-tree/api/index.ts +13 -9
- package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
- package/src/simple-tree/api/schemaFactory.ts +2 -2
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +2 -2
- package/src/simple-tree/api/transactionTypes.ts +111 -39
- package/src/simple-tree/api/tree.ts +152 -47
- package/src/simple-tree/api/treeBeta.ts +2 -0
- package/src/simple-tree/core/treeNodeSchema.ts +7 -7
- package/src/simple-tree/index.ts +12 -8
- package/src/tableSchema.ts +306 -80
- package/src/text/index.ts +1 -0
- package/src/text/textDomainFormatted.ts +520 -415
- package/src/text/textDomainFormattedDefault.ts +150 -0
- package/src/util/arrayUtilities.ts +35 -0
- package/src/util/compressedIds.ts +216 -0
- package/src/util/index.ts +17 -0
- package/src/util/rangeMap.ts +108 -9
- package/tsconfig.json +5 -0
|
@@ -8,7 +8,7 @@ import type { IFluidHandle, Listenable } from "@fluidframework/core-interfaces/i
|
|
|
8
8
|
import { assert, unreachableCase, fail } from "@fluidframework/core-utils/internal";
|
|
9
9
|
import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
|
|
10
10
|
import { isStableId } from "@fluidframework/id-compressor/internal";
|
|
11
|
-
import {
|
|
11
|
+
import { type TelemetryLoggerExt, UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
FluidClientVersion,
|
|
@@ -57,6 +57,7 @@ import {
|
|
|
57
57
|
makeAnonChange,
|
|
58
58
|
type TaggedChange,
|
|
59
59
|
deltaFieldMapHasVisibleChanges,
|
|
60
|
+
findCommonAncestor,
|
|
60
61
|
} from "../core/index.js";
|
|
61
62
|
import {
|
|
62
63
|
type FieldBatchCodec,
|
|
@@ -74,8 +75,8 @@ import {
|
|
|
74
75
|
SquashingTransactionStack,
|
|
75
76
|
SharedTreeBranch,
|
|
76
77
|
TransactionResult as InternalTransactionResult,
|
|
77
|
-
onForkTransitive,
|
|
78
78
|
type SharedTreeBranchChange,
|
|
79
|
+
type SquashingTransactionOptions,
|
|
79
80
|
type Transactor,
|
|
80
81
|
} from "../shared-tree-core/index.js";
|
|
81
82
|
import {
|
|
@@ -87,13 +88,12 @@ import {
|
|
|
87
88
|
type ViewableTree,
|
|
88
89
|
type TreeBranch,
|
|
89
90
|
type TreeBranchAlpha,
|
|
90
|
-
type TreeChangeEvents,
|
|
91
91
|
type VerboseTree,
|
|
92
|
-
type
|
|
93
|
-
type
|
|
94
|
-
type
|
|
95
|
-
type
|
|
96
|
-
type
|
|
92
|
+
type VoidTransactionCallbackStatusAlpha,
|
|
93
|
+
type TransactionCallbackStatusAlpha,
|
|
94
|
+
type TransactionVoidResult,
|
|
95
|
+
type TransactionValueResult,
|
|
96
|
+
type RunTransactionParamsAlpha,
|
|
97
97
|
type TransactionConstraintAlpha,
|
|
98
98
|
type TreeViewAlpha,
|
|
99
99
|
getInnerNode,
|
|
@@ -118,6 +118,7 @@ import { SharedTreeChangeEnricher } from "./sharedTreeChangeEnricher.js";
|
|
|
118
118
|
import { SharedTreeChangeFamily, hasSchemaChange } from "./sharedTreeChangeFamily.js";
|
|
119
119
|
import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
120
120
|
import type { ISharedTreeEditor, SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
|
|
121
|
+
import { extractTransactionChangeProcessor } from "./transactionPostProcessor.js";
|
|
121
122
|
|
|
122
123
|
/**
|
|
123
124
|
* Yields all defined (non-`undefined`) labels from a {@link LabelTree}, depth-first.
|
|
@@ -206,6 +207,11 @@ export interface CheckoutEvents {
|
|
|
206
207
|
dispose(): void;
|
|
207
208
|
}
|
|
208
209
|
|
|
210
|
+
/**
|
|
211
|
+
* A collection of functions for managing transactions on a {@link ITreeCheckout}.
|
|
212
|
+
*/
|
|
213
|
+
export type TreeTransactor = Transactor<SquashingTransactionOptions<SharedTreeChange>>;
|
|
214
|
+
|
|
209
215
|
/**
|
|
210
216
|
* Provides a means for interacting with a SharedTree.
|
|
211
217
|
* This includes reading data from the tree and running transactions to mutate the tree.
|
|
@@ -252,13 +258,13 @@ export interface ITreeCheckout
|
|
|
252
258
|
/**
|
|
253
259
|
* A collection of functions for managing transactions.
|
|
254
260
|
*/
|
|
255
|
-
readonly transaction:
|
|
261
|
+
readonly transaction: TreeTransactor;
|
|
256
262
|
|
|
257
263
|
fork(): ITreeCheckout;
|
|
258
264
|
|
|
259
265
|
/**
|
|
260
|
-
* Replaces all
|
|
261
|
-
* Can
|
|
266
|
+
* Replaces all schemas with the provided schema.
|
|
267
|
+
* Can overwrite preexisting schemas, and removes unmentioned schemas.
|
|
262
268
|
*
|
|
263
269
|
* @param newSchema - The new schema to replace the existing schema.
|
|
264
270
|
* @param allowNonSupersetSchema - Whether to allow non-superset schemas.
|
|
@@ -308,7 +314,6 @@ export function createTreeCheckout(
|
|
|
308
314
|
chunkCompressionStrategy?: TreeCompressionStrategy;
|
|
309
315
|
logger?: TelemetryLoggerExt;
|
|
310
316
|
breaker?: Breakable;
|
|
311
|
-
disposeForksAfterTransaction?: boolean;
|
|
312
317
|
codecOptions?: Partial<CodecWriteOptions>;
|
|
313
318
|
},
|
|
314
319
|
): TreeCheckout {
|
|
@@ -355,7 +360,6 @@ export function createTreeCheckout(
|
|
|
355
360
|
args?.removedRoots,
|
|
356
361
|
args?.logger,
|
|
357
362
|
breaker,
|
|
358
|
-
args?.disposeForksAfterTransaction,
|
|
359
363
|
);
|
|
360
364
|
}
|
|
361
365
|
|
|
@@ -393,7 +397,7 @@ function getCheckout(context: TreeBranch): TreeCheckout {
|
|
|
393
397
|
* @param constraintsOnRevert - If true, use {@link ISharedTreeEditor.addNodeExistsConstraintOnRevert}.
|
|
394
398
|
* @param constraints - The constraints to add to the transaction.
|
|
395
399
|
*
|
|
396
|
-
* @see {@link
|
|
400
|
+
* @see {@link RunTransactionParamsAlpha.preconditions}.
|
|
397
401
|
*/
|
|
398
402
|
export function addConstraintsToTransaction(
|
|
399
403
|
checkout: ITreeCheckout,
|
|
@@ -486,9 +490,9 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
486
490
|
private readonly views = new Set<TreeView<ImplicitFieldSchema>>();
|
|
487
491
|
|
|
488
492
|
/**
|
|
489
|
-
*
|
|
493
|
+
* Revertibles maintained for automatic disposal
|
|
490
494
|
*/
|
|
491
|
-
private readonly revertibles = new
|
|
495
|
+
private readonly revertibles = new Map<RevisionTag, RevertibleAlpha>();
|
|
492
496
|
|
|
493
497
|
/**
|
|
494
498
|
* Each branch's head commit corresponds to a revertible commit.
|
|
@@ -527,7 +531,6 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
527
531
|
/** Optional logger for telemetry. */
|
|
528
532
|
private readonly logger?: TelemetryLoggerExt,
|
|
529
533
|
public readonly breaker: Breakable = new Breakable("TreeCheckout"),
|
|
530
|
-
public readonly disposeForksAfterTransaction = true,
|
|
531
534
|
) {
|
|
532
535
|
this.#transaction = this.createTransactionStack(branch);
|
|
533
536
|
this.editLock = new EditLock(this.#transaction.activeBranchEditor);
|
|
@@ -659,9 +662,6 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
659
662
|
branch: SharedTreeBranch<SharedTreeEditBuilder, SharedTreeChange>,
|
|
660
663
|
): SquashingTransactionStack<SharedTreeEditBuilder, SharedTreeChange> {
|
|
661
664
|
return new SquashingTransactionStack(branch, this.mintRevisionTag, () => {
|
|
662
|
-
const disposeForks = this.disposeForksAfterTransaction
|
|
663
|
-
? trackForksForDisposal(this)
|
|
664
|
-
: undefined;
|
|
665
665
|
// When each transaction is started, make a restorable checkpoint of the current state of removed roots
|
|
666
666
|
const restoreRemovedRoots = this._removedRoots.createCheckpoint();
|
|
667
667
|
return (result, viewUpdate: SharedTreeChange | undefined) => {
|
|
@@ -688,7 +688,6 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
688
688
|
unreachableCase(result);
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
disposeForks?.();
|
|
692
691
|
};
|
|
693
692
|
});
|
|
694
693
|
}
|
|
@@ -754,7 +753,7 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
754
753
|
revision,
|
|
755
754
|
this.#transaction.activeBranch.fork(commit),
|
|
756
755
|
);
|
|
757
|
-
this.revertibles.
|
|
756
|
+
this.revertibles.set(revision, revertible);
|
|
758
757
|
return revertible;
|
|
759
758
|
};
|
|
760
759
|
|
|
@@ -788,19 +787,53 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
788
787
|
labels: buildLabelsSet(this.labelTreeNode),
|
|
789
788
|
};
|
|
790
789
|
|
|
791
|
-
this
|
|
790
|
+
this.emitChangedLocked(() => {
|
|
791
|
+
this.#events.emit("changed", metadata, getRevertible);
|
|
792
|
+
});
|
|
792
793
|
withinEventContext = false;
|
|
793
794
|
}
|
|
795
|
+
} else if (event.type === "remove") {
|
|
796
|
+
// Commits that are rolled back should no longer be revertible
|
|
797
|
+
for (const commit of event.removedCommits) {
|
|
798
|
+
this.revertibles.get(commit.revision)?.dispose();
|
|
799
|
+
}
|
|
794
800
|
} else if (this.isRemoteChangeEvent(event)) {
|
|
795
801
|
// TODO: figure out how to plumb through commit kind info for remote changes
|
|
796
|
-
this
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
802
|
+
this.emitChangedLocked(() => {
|
|
803
|
+
this.#events.emit("changed", {
|
|
804
|
+
isLocal: false,
|
|
805
|
+
kind: CommitKind.Default,
|
|
806
|
+
labels: new Set<unknown>(),
|
|
807
|
+
});
|
|
800
808
|
});
|
|
801
809
|
}
|
|
802
810
|
};
|
|
803
811
|
|
|
812
|
+
/**
|
|
813
|
+
* Hold the `editLock` for the duration of `emit`, so that re-entrant edits, transactions,
|
|
814
|
+
* branch operations, etc. attempted from inside a `changed` listener throw the canonical
|
|
815
|
+
* "forbidden during a change event" {@link UsageError} via {@link EditLock.checkUnlocked}.
|
|
816
|
+
*
|
|
817
|
+
* @remarks
|
|
818
|
+
* Shared by both the local and remote `changed` emission paths in {@link TreeCheckout.onAfterBranchChange}.
|
|
819
|
+
* The `try`/`finally` ensures the lock is released even if a listener throws.
|
|
820
|
+
*/
|
|
821
|
+
private emitChangedLocked(emit: () => void): void {
|
|
822
|
+
this.editLock.lock();
|
|
823
|
+
try {
|
|
824
|
+
emit();
|
|
825
|
+
} finally {
|
|
826
|
+
// TODO: any event that throws potentially leaves the code which triggered that event,
|
|
827
|
+
// and thus this checkout (and likely more) in a broken state.
|
|
828
|
+
// Unlocking this editLock prevents future use of this broken state from giving a confusing error in this case,
|
|
829
|
+
// however, a better approach would probably be to put something (this checkout and/or the editLock)
|
|
830
|
+
// into a broken state (using a properly scoped `Breakable`),
|
|
831
|
+
// likely by moving emitChangedLocked into EditLock, and having EditLock get a Breakable,
|
|
832
|
+
// and having the new emitChangedLocked use `Breakable.use`.
|
|
833
|
+
this.editLock.unlock();
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
804
837
|
private readonly onAfterChange = (event: SharedTreeBranchChange<SharedTreeChange>): void => {
|
|
805
838
|
this.editLock.lock();
|
|
806
839
|
this.#events.emit("beforeBatch", event);
|
|
@@ -864,72 +897,86 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
864
897
|
}
|
|
865
898
|
|
|
866
899
|
public runTransaction<TSuccessValue, TFailureValue>(
|
|
867
|
-
transaction: () =>
|
|
868
|
-
params?:
|
|
869
|
-
):
|
|
900
|
+
transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>,
|
|
901
|
+
params?: RunTransactionParamsAlpha,
|
|
902
|
+
): TransactionValueResult<TSuccessValue, TFailureValue>;
|
|
870
903
|
public runTransaction(
|
|
871
|
-
transaction: () =>
|
|
872
|
-
params?:
|
|
873
|
-
):
|
|
904
|
+
transaction: () => VoidTransactionCallbackStatusAlpha | void,
|
|
905
|
+
params?: RunTransactionParamsAlpha,
|
|
906
|
+
): TransactionVoidResult;
|
|
874
907
|
@breakingMethod
|
|
875
908
|
public runTransaction<TSuccessValue, TFailureValue>(
|
|
876
909
|
transaction: () =>
|
|
877
|
-
|
|
|
878
|
-
|
|
|
910
|
+
| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
|
|
911
|
+
| VoidTransactionCallbackStatusAlpha
|
|
879
912
|
| void,
|
|
880
|
-
params?:
|
|
881
|
-
):
|
|
913
|
+
params?: RunTransactionParamsAlpha,
|
|
914
|
+
): TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult {
|
|
882
915
|
this.mountTransaction(params, false);
|
|
883
916
|
const transactionCallbackStatus = transaction();
|
|
884
917
|
return this.unmountTransaction(transactionCallbackStatus, params);
|
|
885
918
|
}
|
|
886
919
|
|
|
887
920
|
public runTransactionAsync<TSuccessValue, TFailureValue>(
|
|
888
|
-
transaction: () => Promise<
|
|
889
|
-
params?:
|
|
890
|
-
): Promise<
|
|
921
|
+
transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>,
|
|
922
|
+
params?: RunTransactionParamsAlpha,
|
|
923
|
+
): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
|
|
891
924
|
public runTransactionAsync(
|
|
892
|
-
transaction: () => Promise<
|
|
893
|
-
params?:
|
|
894
|
-
): Promise<
|
|
925
|
+
transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>,
|
|
926
|
+
params?: RunTransactionParamsAlpha,
|
|
927
|
+
): Promise<TransactionVoidResult>;
|
|
895
928
|
@breakingMethod
|
|
896
929
|
public async runTransactionAsync<TSuccessValue, TFailureValue>(
|
|
897
930
|
transaction: () => Promise<
|
|
898
|
-
|
|
|
899
|
-
|
|
|
931
|
+
| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
|
|
932
|
+
| VoidTransactionCallbackStatusAlpha
|
|
900
933
|
| void
|
|
901
934
|
>,
|
|
902
|
-
params:
|
|
903
|
-
): Promise<
|
|
935
|
+
params: RunTransactionParamsAlpha | undefined,
|
|
936
|
+
): Promise<TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult> {
|
|
904
937
|
this.mountTransaction(params, true);
|
|
905
938
|
const transactionCallbackStatus = await transaction();
|
|
906
939
|
return this.unmountTransaction(transactionCallbackStatus, params);
|
|
907
940
|
}
|
|
908
941
|
|
|
909
|
-
private mountTransaction(
|
|
942
|
+
private mountTransaction(
|
|
943
|
+
params: RunTransactionParamsAlpha | undefined,
|
|
944
|
+
isAsync: boolean,
|
|
945
|
+
): void {
|
|
910
946
|
this.checkNotDisposed();
|
|
947
|
+
// Starting a transaction is an edit, so it is forbidden from within a change-event
|
|
948
|
+
// callback (where the edit lock is held), the same as direct edits. For the async
|
|
949
|
+
// entry point this throw is captured as a rejected promise by the `async` wrapper.
|
|
950
|
+
//
|
|
951
|
+
// Note: because runTransaction/runTransactionAsync are `@breakingMethod`, this throw also
|
|
952
|
+
// puts the checkout into a broken state (unlike a direct edit, which throws recoverably).
|
|
953
|
+
// That is the same pre-existing broken-state limitation tracked by the TODO in
|
|
954
|
+
// `emitChangedLocked`, not something specific to transactions.
|
|
955
|
+
this.editLock.checkUnlocked("Running a transaction");
|
|
911
956
|
if (isAsync && this.transaction.size > 0) {
|
|
912
957
|
throw new UsageError(
|
|
913
958
|
"An asynchronous transaction cannot be started while another transaction is already in progress.",
|
|
914
959
|
);
|
|
915
960
|
}
|
|
916
961
|
this.pushLabelFrame(params?.label);
|
|
917
|
-
this.transaction.start(
|
|
962
|
+
this.transaction.start({
|
|
963
|
+
postProcessor: extractTransactionChangeProcessor(params?.postProcessor),
|
|
964
|
+
});
|
|
918
965
|
|
|
919
966
|
addConstraintsToTransaction(this, false, params?.preconditions);
|
|
920
967
|
}
|
|
921
968
|
|
|
922
969
|
private unmountTransaction<TSuccessValue, TFailureValue>(
|
|
923
970
|
transactionCallbackStatus:
|
|
924
|
-
|
|
|
925
|
-
|
|
|
971
|
+
| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
|
|
972
|
+
| VoidTransactionCallbackStatusAlpha
|
|
926
973
|
| void,
|
|
927
|
-
params:
|
|
928
|
-
):
|
|
974
|
+
params: RunTransactionParamsAlpha | undefined,
|
|
975
|
+
): TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult {
|
|
929
976
|
this.checkNotDisposed();
|
|
930
977
|
const rollback = transactionCallbackStatus?.rollback;
|
|
931
978
|
const value = (
|
|
932
|
-
transactionCallbackStatus as
|
|
979
|
+
transactionCallbackStatus as TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
|
|
933
980
|
)?.value;
|
|
934
981
|
|
|
935
982
|
if (rollback === true) {
|
|
@@ -1097,7 +1144,7 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
1097
1144
|
"Unable to dispose a revertible that has already been disposed.",
|
|
1098
1145
|
);
|
|
1099
1146
|
}
|
|
1100
|
-
checkout.disposeRevertible(
|
|
1147
|
+
checkout.disposeRevertible(revision);
|
|
1101
1148
|
onRevertibleDisposed?.(revertible);
|
|
1102
1149
|
},
|
|
1103
1150
|
};
|
|
@@ -1145,7 +1192,7 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
1145
1192
|
return this.forest.anchors.locate(anchor);
|
|
1146
1193
|
}
|
|
1147
1194
|
|
|
1148
|
-
public get transaction():
|
|
1195
|
+
public get transaction(): TreeTransactor {
|
|
1149
1196
|
return this.#transaction;
|
|
1150
1197
|
}
|
|
1151
1198
|
/**
|
|
@@ -1170,7 +1217,6 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
1170
1217
|
throw new UsageError("A view cannot be forked while it has a pending transaction.");
|
|
1171
1218
|
}
|
|
1172
1219
|
|
|
1173
|
-
this.editLock.checkUnlocked("Branching");
|
|
1174
1220
|
const branch = this.#transaction.activeBranch.fork();
|
|
1175
1221
|
const storedSchema = this.storedSchema.clone();
|
|
1176
1222
|
const forkBreaker = new Breakable("TreeCheckout");
|
|
@@ -1187,7 +1233,6 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
1187
1233
|
this._removedRoots.clone(),
|
|
1188
1234
|
this.logger,
|
|
1189
1235
|
forkBreaker,
|
|
1190
|
-
this.disposeForksAfterTransaction,
|
|
1191
1236
|
);
|
|
1192
1237
|
this.#events.emit("fork", checkout);
|
|
1193
1238
|
return checkout;
|
|
@@ -1250,6 +1295,19 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
1250
1295
|
getCheckout(branch).rebase(this);
|
|
1251
1296
|
}
|
|
1252
1297
|
|
|
1298
|
+
public isMissingEditsFrom(branch: TreeBranch): boolean {
|
|
1299
|
+
const branchCheckout = getCheckout(branch);
|
|
1300
|
+
const targetPath: GraphCommit<unknown>[] = [];
|
|
1301
|
+
const ancestor = findCommonAncestor(this.mainBranch.getHead(), [
|
|
1302
|
+
branchCheckout.mainBranch.getHead(),
|
|
1303
|
+
targetPath,
|
|
1304
|
+
]);
|
|
1305
|
+
if (ancestor === undefined) {
|
|
1306
|
+
throw new UsageError("Branches do not share a common ancestor.");
|
|
1307
|
+
}
|
|
1308
|
+
return targetPath.length > 0;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1253
1311
|
public merge(branch: TreeBranch): void;
|
|
1254
1312
|
public merge(branch: TreeBranch, disposeMerged: boolean): void;
|
|
1255
1313
|
public merge(branch: TreeBranch, disposeMerged = true): void {
|
|
@@ -1339,15 +1397,15 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
1339
1397
|
}
|
|
1340
1398
|
|
|
1341
1399
|
private purgeRevertibles(): void {
|
|
1342
|
-
for (const revertible of this.revertibles) {
|
|
1400
|
+
for (const revertible of this.revertibles.values()) {
|
|
1343
1401
|
revertible.dispose();
|
|
1344
1402
|
}
|
|
1345
1403
|
}
|
|
1346
1404
|
|
|
1347
|
-
private disposeRevertible(
|
|
1405
|
+
private disposeRevertible(revision: RevisionTag): void {
|
|
1348
1406
|
this.revertibleCommitBranches.get(revision)?.dispose();
|
|
1349
1407
|
this.revertibleCommitBranches.delete(revision);
|
|
1350
|
-
this.revertibles.delete(
|
|
1408
|
+
this.revertibles.delete(revision);
|
|
1351
1409
|
}
|
|
1352
1410
|
|
|
1353
1411
|
private revertRevertible(
|
|
@@ -1681,12 +1739,7 @@ class EditLock {
|
|
|
1681
1739
|
*/
|
|
1682
1740
|
public checkUnlocked<T extends string>(action: T extends Capitalize<T> ? T : never): void {
|
|
1683
1741
|
if (this.locked) {
|
|
1684
|
-
|
|
1685
|
-
const nodeChanged: keyof TreeChangeEvents = "nodeChanged";
|
|
1686
|
-
const treeChanged: keyof TreeChangeEvents = "treeChanged";
|
|
1687
|
-
throw new UsageError(
|
|
1688
|
-
`${action} is forbidden during a ${nodeChanged} or ${treeChanged} event`,
|
|
1689
|
-
);
|
|
1742
|
+
throw new UsageError(`${action} is forbidden during a change event callback`);
|
|
1690
1743
|
}
|
|
1691
1744
|
}
|
|
1692
1745
|
|
|
@@ -1700,34 +1753,6 @@ class EditLock {
|
|
|
1700
1753
|
}
|
|
1701
1754
|
}
|
|
1702
1755
|
|
|
1703
|
-
/**
|
|
1704
|
-
* Keeps track of all new forks created until the returned function is invoked, which will dispose all of those for.
|
|
1705
|
-
* The returned function may only be called once.
|
|
1706
|
-
*
|
|
1707
|
-
* @param checkout - The tree checkout for which you want to monitor forks for disposal.
|
|
1708
|
-
* @returns a function which can be called to dispose all of the tracked forks.
|
|
1709
|
-
*/
|
|
1710
|
-
function trackForksForDisposal(checkout: TreeCheckout): () => void {
|
|
1711
|
-
const forks = new Set<TreeCheckout>();
|
|
1712
|
-
const onDisposeUnSubscribes: (() => void)[] = [];
|
|
1713
|
-
const onForkUnSubscribe = onForkTransitive(checkout, (fork) => {
|
|
1714
|
-
forks.add(fork);
|
|
1715
|
-
onDisposeUnSubscribes.push(fork.events.on("dispose", () => forks.delete(fork)));
|
|
1716
|
-
});
|
|
1717
|
-
let disposed = false;
|
|
1718
|
-
return () => {
|
|
1719
|
-
assert(!disposed, 0xaa9 /* Forks may only be disposed once */);
|
|
1720
|
-
for (const fork of forks) {
|
|
1721
|
-
fork.dispose();
|
|
1722
|
-
}
|
|
1723
|
-
for (const unsubscribe of onDisposeUnSubscribes) {
|
|
1724
|
-
unsubscribe();
|
|
1725
|
-
}
|
|
1726
|
-
onForkUnSubscribe();
|
|
1727
|
-
disposed = true;
|
|
1728
|
-
};
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
1756
|
function verboseFromCursor(
|
|
1732
1757
|
reader: ITreeCursor,
|
|
1733
1758
|
schema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>,
|
|
@@ -8,9 +8,9 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
|
8
8
|
import type {
|
|
9
9
|
TreeContextAlpha,
|
|
10
10
|
TreeBranchAlpha,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
RunTransactionParamsAlpha,
|
|
12
|
+
TransactionVoidResult,
|
|
13
|
+
TransactionValueResult,
|
|
14
14
|
WithValue,
|
|
15
15
|
} from "../simple-tree/index.js";
|
|
16
16
|
|
|
@@ -30,13 +30,16 @@ export class UnhydratedTreeContext implements TreeContextAlpha {
|
|
|
30
30
|
|
|
31
31
|
public runTransaction<TValue>(
|
|
32
32
|
t: () => WithValue<TValue>,
|
|
33
|
-
params?:
|
|
34
|
-
):
|
|
35
|
-
public runTransaction(
|
|
33
|
+
params?: RunTransactionParamsAlpha,
|
|
34
|
+
): TransactionValueResult<TValue, TValue>;
|
|
35
|
+
public runTransaction(
|
|
36
|
+
t: () => void,
|
|
37
|
+
_params?: RunTransactionParamsAlpha,
|
|
38
|
+
): TransactionVoidResult;
|
|
36
39
|
public runTransaction(
|
|
37
40
|
t: () => WithValue<unknown> | void,
|
|
38
|
-
params?:
|
|
39
|
-
):
|
|
41
|
+
params?: RunTransactionParamsAlpha,
|
|
42
|
+
): TransactionValueResult<unknown, unknown> | TransactionVoidResult {
|
|
40
43
|
for (const constraint of params?.preconditions ?? []) {
|
|
41
44
|
assertValidConstraint(constraint, false);
|
|
42
45
|
}
|
|
@@ -50,16 +53,16 @@ export class UnhydratedTreeContext implements TreeContextAlpha {
|
|
|
50
53
|
|
|
51
54
|
public runTransactionAsync<TValue>(
|
|
52
55
|
t: () => Promise<WithValue<TValue>>,
|
|
53
|
-
params?:
|
|
54
|
-
): Promise<
|
|
56
|
+
params?: RunTransactionParamsAlpha,
|
|
57
|
+
): Promise<TransactionValueResult<TValue, TValue>>;
|
|
55
58
|
public runTransactionAsync(
|
|
56
59
|
t: () => Promise<void>,
|
|
57
|
-
params?:
|
|
58
|
-
): Promise<
|
|
60
|
+
params?: RunTransactionParamsAlpha,
|
|
61
|
+
): Promise<TransactionVoidResult>;
|
|
59
62
|
public async runTransactionAsync(
|
|
60
63
|
t: () => Promise<WithValue<unknown> | void>,
|
|
61
|
-
params?:
|
|
62
|
-
): Promise<
|
|
64
|
+
params?: RunTransactionParamsAlpha,
|
|
65
|
+
): Promise<TransactionValueResult<unknown, unknown> | TransactionVoidResult> {
|
|
63
66
|
if (this.transactionCount > 0) {
|
|
64
67
|
throw new UsageError(
|
|
65
68
|
"An asynchronous transaction cannot be started while another transaction is already in progress.",
|
|
@@ -78,7 +81,7 @@ export class UnhydratedTreeContext implements TreeContextAlpha {
|
|
|
78
81
|
|
|
79
82
|
private static wrapTransactionResult<TValue>(
|
|
80
83
|
value: WithValue<TValue> | void,
|
|
81
|
-
):
|
|
84
|
+
): TransactionValueResult<TValue, TValue> | TransactionVoidResult {
|
|
82
85
|
if (value?.value !== undefined) {
|
|
83
86
|
return { success: true, value: value.value };
|
|
84
87
|
}
|
|
@@ -24,6 +24,7 @@ import type {
|
|
|
24
24
|
RevisionTag,
|
|
25
25
|
SchemaAndPolicy,
|
|
26
26
|
} from "../core/index.js";
|
|
27
|
+
import type { IdentifierHealingConfig } from "../util/index.js";
|
|
27
28
|
|
|
28
29
|
import type { SummaryData } from "./editManager.js";
|
|
29
30
|
import { makeV1toV4andV6CodecWithVersion } from "./editManagerCodecsV1toV4.js";
|
|
@@ -37,8 +38,8 @@ export interface EditManagerEncodingContext {
|
|
|
37
38
|
idCompressor: IIdCompressor;
|
|
38
39
|
readonly schema?: SchemaAndPolicy;
|
|
39
40
|
readonly isSummary: boolean;
|
|
40
|
-
|
|
41
|
-
readonly
|
|
41
|
+
/** See {@link IdentifierHealingConfig}. */
|
|
42
|
+
readonly healing?: IdentifierHealingConfig;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
/**
|
|
@@ -13,7 +13,12 @@ import type {
|
|
|
13
13
|
RevisionTag,
|
|
14
14
|
SchemaAndPolicy,
|
|
15
15
|
} from "../core/index.js";
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
mapIterable,
|
|
18
|
+
type IdentifierHealingConfig,
|
|
19
|
+
type JsonCompatibleReadOnly,
|
|
20
|
+
type Mutable,
|
|
21
|
+
} from "../util/index.js";
|
|
17
22
|
|
|
18
23
|
import { decodeBranchId, encodeBranchId } from "./branchIdCodec.js";
|
|
19
24
|
import type { SharedBranchSummaryData } from "./editManager.js";
|
|
@@ -34,14 +39,8 @@ export interface EditManagerEncodingContext {
|
|
|
34
39
|
* but it is carried explicitly so downstream codecs can read it.
|
|
35
40
|
*/
|
|
36
41
|
readonly isSummary: boolean;
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
*/
|
|
40
|
-
readonly healUnresolvableIdentifiersOnDecode?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* See {@link ChangeEncodingContext.sharedObjectId}.
|
|
43
|
-
*/
|
|
44
|
-
readonly sharedObjectId?: string;
|
|
42
|
+
/** See {@link IdentifierHealingConfig}. */
|
|
43
|
+
readonly healing?: IdentifierHealingConfig;
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -207,8 +206,7 @@ export function decodeSharedBranch<TChangeset>(
|
|
|
207
206
|
idCompressor: context.idCompressor,
|
|
208
207
|
revision: undefined,
|
|
209
208
|
isSummary: context.isSummary,
|
|
210
|
-
|
|
211
|
-
sharedObjectId: context.sharedObjectId,
|
|
209
|
+
healing: context.healing,
|
|
212
210
|
}),
|
|
213
211
|
),
|
|
214
212
|
peerLocalBranches: new Map(
|
|
@@ -232,9 +230,7 @@ export function decodeSharedBranch<TChangeset>(
|
|
|
232
230
|
idCompressor: context.idCompressor,
|
|
233
231
|
revision: undefined,
|
|
234
232
|
isSummary: context.isSummary,
|
|
235
|
-
|
|
236
|
-
context.healUnresolvableIdentifiersOnDecode,
|
|
237
|
-
sharedObjectId: context.sharedObjectId,
|
|
233
|
+
healing: context.healing,
|
|
238
234
|
},
|
|
239
235
|
),
|
|
240
236
|
),
|
|
@@ -13,6 +13,7 @@ import type {
|
|
|
13
13
|
SchemaAndPolicy,
|
|
14
14
|
} from "../core/index.js";
|
|
15
15
|
import {
|
|
16
|
+
type IdentifierHealingConfig,
|
|
16
17
|
type JsonCompatibleReadOnly,
|
|
17
18
|
type JsonCompatibleReadOnlyObject,
|
|
18
19
|
JsonCompatibleReadOnlySchema,
|
|
@@ -26,8 +27,8 @@ export interface EditManagerEncodingContext {
|
|
|
26
27
|
idCompressor: IIdCompressor;
|
|
27
28
|
readonly schema?: SchemaAndPolicy;
|
|
28
29
|
readonly isSummary: boolean;
|
|
29
|
-
|
|
30
|
-
readonly
|
|
30
|
+
/** See {@link IdentifierHealingConfig}. */
|
|
31
|
+
readonly healing?: IdentifierHealingConfig;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
SchemaAndPolicy,
|
|
15
15
|
} from "../core/index.js";
|
|
16
16
|
import {
|
|
17
|
+
type IdentifierHealingConfig,
|
|
17
18
|
type JsonCompatibleReadOnly,
|
|
18
19
|
type JsonCompatibleReadOnlyObject,
|
|
19
20
|
JsonCompatibleReadOnlySchema,
|
|
@@ -30,8 +31,8 @@ export interface EditManagerEncodingContext {
|
|
|
30
31
|
idCompressor: IIdCompressor;
|
|
31
32
|
readonly schema?: SchemaAndPolicy;
|
|
32
33
|
readonly isSummary: boolean;
|
|
33
|
-
|
|
34
|
-
readonly
|
|
34
|
+
/** See {@link IdentifierHealingConfig}. */
|
|
35
|
+
readonly healing?: IdentifierHealingConfig;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
@@ -16,7 +16,7 @@ import type { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal"
|
|
|
16
16
|
|
|
17
17
|
import type { IJsonCodec } from "../codec/index.js";
|
|
18
18
|
import type { ChangeFamily, ChangeFamilyEditor, SchemaAndPolicy } from "../core/index.js";
|
|
19
|
-
import type { JsonCompatibleReadOnly } from "../util/index.js";
|
|
19
|
+
import type { IdentifierHealingConfig, JsonCompatibleReadOnly } from "../util/index.js";
|
|
20
20
|
|
|
21
21
|
import type { EditManager, SummaryData } from "./editManager.js";
|
|
22
22
|
import type { EditManagerEncodingContext } from "./editManagerCodecs.js";
|
|
@@ -85,10 +85,8 @@ export class EditManagerSummarizer<TChangeset>
|
|
|
85
85
|
private readonly idCompressor: IIdCompressor,
|
|
86
86
|
minVersionForCollab: MinimumVersionForCollab,
|
|
87
87
|
private readonly schemaAndPolicy?: SchemaAndPolicy,
|
|
88
|
-
/** See {@link
|
|
89
|
-
private readonly
|
|
90
|
-
/** See {@link EditManagerEncodingContext.sharedObjectId}. */
|
|
91
|
-
private readonly sharedObjectId?: string,
|
|
88
|
+
/** See {@link IdentifierHealingConfig}. */
|
|
89
|
+
private readonly healing?: IdentifierHealingConfig,
|
|
92
90
|
) {
|
|
93
91
|
super(
|
|
94
92
|
EditManagerSummarizer.key,
|
|
@@ -111,8 +109,7 @@ export class EditManagerSummarizer<TChangeset>
|
|
|
111
109
|
idCompressor: this.idCompressor,
|
|
112
110
|
schema: this.schemaAndPolicy,
|
|
113
111
|
isSummary: true,
|
|
114
|
-
|
|
115
|
-
sharedObjectId: this.sharedObjectId,
|
|
112
|
+
healing: this.healing,
|
|
116
113
|
};
|
|
117
114
|
const jsonCompatible = this.codec.encode(this.editManager.getSummaryData(), context);
|
|
118
115
|
const dataString = stringify(jsonCompatible);
|
|
@@ -137,8 +134,7 @@ export class EditManagerSummarizer<TChangeset>
|
|
|
137
134
|
const data = this.codec.decode(summary, {
|
|
138
135
|
idCompressor: this.idCompressor,
|
|
139
136
|
isSummary: true,
|
|
140
|
-
|
|
141
|
-
sharedObjectId: this.sharedObjectId,
|
|
137
|
+
healing: this.healing,
|
|
142
138
|
});
|
|
143
139
|
this.editManager.loadSummaryData(data);
|
|
144
140
|
}
|