@fluidframework/tree 2.110.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 +48 -0
- package/api-report/tree.alpha.api.md +48 -31
- package/api-report/tree.beta.api.md +38 -0
- package/api-report/tree.legacy.beta.api.md +38 -0
- 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.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/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/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/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/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/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/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +2 -1
- package/dist/feature-libraries/index.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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- 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 +5 -5
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +5 -0
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +7 -4
- package/dist/shared-tree/sharedTree.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 +16 -12
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +18 -9
- 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/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/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/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +3 -1
- 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 +74 -7
- 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/snapshotCompatibilityChecker.d.ts +2 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
- 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 +86 -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/treeNodeSchema.d.ts +7 -7
- package/dist/simple-tree/core/treeNodeSchema.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/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/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 +1 -0
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +9 -1
- package/dist/util/index.js.map +1 -1
- 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/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/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/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/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 +5 -5
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +5 -0
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +8 -5
- 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 +16 -12
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +18 -9
- 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/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 +3 -1
- 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 +73 -6
- 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 +86 -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/treeNodeSchema.d.ts +7 -7
- package/lib/simple-tree/core/treeNodeSchema.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/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/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 +1 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/package.json +23 -23
- 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/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 +25 -25
- package/src/shared-tree/sharedTree.ts +16 -4
- package/src/shared-tree/transactionPostProcessor.ts +40 -0
- package/src/shared-tree/treeAlpha.ts +3 -3
- package/src/shared-tree/treeCheckout.ts +61 -44
- 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 +141 -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/text/index.ts +1 -0
- package/src/text/textDomainFormatted.ts +520 -415
- package/src/text/textDomainFormattedDefault.ts +150 -0
- package/src/util/compressedIds.ts +216 -0
- package/src/util/index.ts +15 -0
package/src/index.ts
CHANGED
|
@@ -273,17 +273,21 @@ export {
|
|
|
273
273
|
type NodeSchemaMetadata,
|
|
274
274
|
type SchemaStatics,
|
|
275
275
|
type ITreeAlpha,
|
|
276
|
+
type NoChangeConstraint,
|
|
277
|
+
type NodeInDocumentConstraint,
|
|
278
|
+
type RunTransactionParamsAlpha,
|
|
279
|
+
type RunTransactionParamsBeta,
|
|
280
|
+
type TransactionCallbackStatusAlpha,
|
|
281
|
+
type TransactionCallbackStatusBeta,
|
|
276
282
|
type TransactionConstraint,
|
|
277
283
|
type TransactionConstraintAlpha,
|
|
278
|
-
type
|
|
279
|
-
type NoChangeConstraint,
|
|
280
|
-
type RunTransactionParams,
|
|
281
|
-
type VoidTransactionCallbackStatus,
|
|
282
|
-
type TransactionCallbackStatus,
|
|
283
|
-
type TransactionResult,
|
|
284
|
-
type TransactionResultExt,
|
|
285
|
-
type TransactionResultSuccess,
|
|
284
|
+
type TransactionPostProcessor,
|
|
286
285
|
type TransactionResultFailed,
|
|
286
|
+
type TransactionResultSuccess,
|
|
287
|
+
type TransactionValueResult,
|
|
288
|
+
type TransactionVoidResult,
|
|
289
|
+
type VoidTransactionCallbackStatusAlpha,
|
|
290
|
+
type VoidTransactionCallbackStatusBeta,
|
|
287
291
|
rollback,
|
|
288
292
|
generateSchemaFromSimpleSchema,
|
|
289
293
|
evaluateLazySchema,
|
|
@@ -406,6 +410,7 @@ export { asAlpha, asBeta } from "./api.js";
|
|
|
406
410
|
export {
|
|
407
411
|
TextAsTree,
|
|
408
412
|
FormattedTextAsTree,
|
|
413
|
+
FormattedTextAsTreeDefault,
|
|
409
414
|
codePointCount,
|
|
410
415
|
utf16LengthForCodePoints,
|
|
411
416
|
} from "./text/index.js";
|
package/src/packageVersion.ts
CHANGED
|
@@ -19,9 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
createNodeIdentifierManager,
|
|
21
21
|
fieldBatchCodecBuilder,
|
|
22
|
-
|
|
23
|
-
defaultSchemaPolicy,
|
|
24
|
-
TreeCompressionStrategy,
|
|
22
|
+
FieldBatchDecodingContext,
|
|
25
23
|
defaultIncrementalEncodingPolicy,
|
|
26
24
|
schemaCodecBuilder,
|
|
27
25
|
} from "../feature-libraries/index.js";
|
|
@@ -233,14 +231,11 @@ export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSc
|
|
|
233
231
|
const fieldBatchCodec = fieldBatchCodecBuilder.buildDecoder(options);
|
|
234
232
|
const newSchema = schemaCodec.decode(options.content.schema);
|
|
235
233
|
|
|
236
|
-
|
|
237
|
-
|
|
234
|
+
// TreeAlpha.exportCompressed encodes this payload in originatorless-safe form
|
|
235
|
+
// (finalized compressed ids or strings), so summary-style decode is correct.
|
|
236
|
+
const context = FieldBatchDecodingContext.forSummary({
|
|
238
237
|
idCompressor,
|
|
239
|
-
|
|
240
|
-
schema: { schema: newSchema, policy: defaultSchemaPolicy },
|
|
241
|
-
// Not a summary blob — this is a synthetic decode of inline content.
|
|
242
|
-
isSummary: false,
|
|
243
|
-
};
|
|
238
|
+
});
|
|
244
239
|
const fieldCursors = fieldBatchCodec.decode(
|
|
245
240
|
options.content.tree as JsonCompatibleReadOnly,
|
|
246
241
|
context,
|
package/src/shared-tree/index.ts
CHANGED
|
@@ -41,11 +41,11 @@ import {
|
|
|
41
41
|
type ReadSchema,
|
|
42
42
|
type UnsafeUnknownSchema,
|
|
43
43
|
type TreeBranchEvents,
|
|
44
|
-
type
|
|
45
|
-
type
|
|
46
|
-
type
|
|
47
|
-
type
|
|
48
|
-
type
|
|
44
|
+
type VoidTransactionCallbackStatusAlpha,
|
|
45
|
+
type TransactionCallbackStatusAlpha,
|
|
46
|
+
type TransactionVoidResult,
|
|
47
|
+
type TransactionValueResult,
|
|
48
|
+
type RunTransactionParamsAlpha,
|
|
49
49
|
HydratedContext,
|
|
50
50
|
SimpleContextSlot,
|
|
51
51
|
areImplicitFieldSchemaEqual,
|
|
@@ -272,40 +272,40 @@ export class SchematizingSimpleTreeView<
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
public runTransaction<TSuccessValue, TFailureValue>(
|
|
275
|
-
transaction: () =>
|
|
276
|
-
params?:
|
|
277
|
-
):
|
|
275
|
+
transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>,
|
|
276
|
+
params?: RunTransactionParamsAlpha,
|
|
277
|
+
): TransactionValueResult<TSuccessValue, TFailureValue>;
|
|
278
278
|
public runTransaction(
|
|
279
|
-
transaction: () =>
|
|
280
|
-
params?:
|
|
281
|
-
):
|
|
279
|
+
transaction: () => VoidTransactionCallbackStatusAlpha | void,
|
|
280
|
+
params?: RunTransactionParamsAlpha,
|
|
281
|
+
): TransactionVoidResult;
|
|
282
282
|
public runTransaction<TSuccessValue, TFailureValue>(
|
|
283
283
|
transaction: () =>
|
|
284
|
-
|
|
|
285
|
-
|
|
|
284
|
+
| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
|
|
285
|
+
| VoidTransactionCallbackStatusAlpha
|
|
286
286
|
| void,
|
|
287
|
-
params?:
|
|
288
|
-
):
|
|
287
|
+
params?: RunTransactionParamsAlpha,
|
|
288
|
+
): TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult {
|
|
289
289
|
this.ensureUndisposed();
|
|
290
290
|
return this.checkout.runTransaction(transaction, params);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
public runTransactionAsync<TSuccessValue, TFailureValue>(
|
|
294
|
-
transaction: () => Promise<
|
|
295
|
-
params?:
|
|
296
|
-
): Promise<
|
|
294
|
+
transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>,
|
|
295
|
+
params?: RunTransactionParamsAlpha,
|
|
296
|
+
): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
|
|
297
297
|
public runTransactionAsync(
|
|
298
|
-
transaction: () => Promise<
|
|
299
|
-
params?:
|
|
300
|
-
): Promise<
|
|
298
|
+
transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>,
|
|
299
|
+
params?: RunTransactionParamsAlpha,
|
|
300
|
+
): Promise<TransactionVoidResult>;
|
|
301
301
|
public async runTransactionAsync<TSuccessValue, TFailureValue>(
|
|
302
302
|
transaction: () => Promise<
|
|
303
|
-
|
|
|
304
|
-
|
|
|
303
|
+
| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
|
|
304
|
+
| VoidTransactionCallbackStatusAlpha
|
|
305
305
|
| void
|
|
306
306
|
>,
|
|
307
|
-
params:
|
|
308
|
-
): Promise<
|
|
307
|
+
params: RunTransactionParamsAlpha | undefined,
|
|
308
|
+
): Promise<TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult> {
|
|
309
309
|
this.ensureUndisposed();
|
|
310
310
|
if (this.checkout.transaction.size > 0) {
|
|
311
311
|
// breaker.break() sets brokenBy synchronously before throwing.
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
} from "../core/index.js";
|
|
46
46
|
import {
|
|
47
47
|
DetachedFieldIndexSummarizer,
|
|
48
|
+
FieldBatchDecodingContext,
|
|
48
49
|
FieldKinds,
|
|
49
50
|
ForestSummarizer,
|
|
50
51
|
SchemaSummarizer,
|
|
@@ -58,6 +59,7 @@ import {
|
|
|
58
59
|
jsonableTreeFromFieldCursor,
|
|
59
60
|
makeMitigatedChangeFamily,
|
|
60
61
|
makeTreeChunker,
|
|
62
|
+
type FieldBatchEncodingContext,
|
|
61
63
|
type IncrementalEncodingPolicy,
|
|
62
64
|
} from "../feature-libraries/index.js";
|
|
63
65
|
import { schemaCodecBuilder } from "../feature-libraries/index.js";
|
|
@@ -235,24 +237,29 @@ export class SharedTreeKernel
|
|
|
235
237
|
);
|
|
236
238
|
const fieldBatchCodec = fieldBatchCodecBuilder.build(options);
|
|
237
239
|
|
|
238
|
-
const encoderContext = {
|
|
240
|
+
const encoderContext: FieldBatchEncodingContext = {
|
|
239
241
|
schema: {
|
|
240
242
|
schema,
|
|
241
243
|
policy: defaultSchemaPolicy,
|
|
242
244
|
},
|
|
243
245
|
encodeType: options.treeEncodeType,
|
|
244
|
-
originatorId: idCompressor.localSessionId,
|
|
245
246
|
idCompressor,
|
|
246
247
|
// ForestSummarizer is the only consumer of this context, and it
|
|
247
248
|
// only invokes the codec in summary encode / load paths.
|
|
248
249
|
isSummary: true,
|
|
249
|
-
healUnresolvableIdentifiersOnDecode: options.healUnresolvableIdentifiersOnDecode,
|
|
250
|
-
sharedObjectId: sharedObject.id,
|
|
251
250
|
};
|
|
251
|
+
const decoderContext = FieldBatchDecodingContext.forSummary({
|
|
252
|
+
idCompressor,
|
|
253
|
+
healing:
|
|
254
|
+
options.healUnresolvableIdentifiersOnDecode === true
|
|
255
|
+
? { sharedObjectId: sharedObject.id }
|
|
256
|
+
: undefined,
|
|
257
|
+
});
|
|
252
258
|
const forestSummarizer = new ForestSummarizer(
|
|
253
259
|
forest,
|
|
254
260
|
revisionTagCodec,
|
|
255
261
|
encoderContext,
|
|
262
|
+
decoderContext,
|
|
256
263
|
options,
|
|
257
264
|
idCompressor,
|
|
258
265
|
initialSequenceNumber,
|
|
@@ -603,6 +610,11 @@ export interface SharedTreeOptionsBeta extends ForestOptions, Partial<CodecWrite
|
|
|
603
610
|
* "Unresolvable" in the public-facing remarks corresponds to non-finalized short IDs persisted without
|
|
604
611
|
* any corresponding context for their originating session. See id-compressor internal documentation
|
|
605
612
|
* for more details.
|
|
613
|
+
*
|
|
614
|
+
* Internally this boolean is translated into {@link IdentifierHealingConfig} once the shared-object
|
|
615
|
+
* id is known (in `SharedTreeCore`'s constructor) and threaded through the codec contexts as a
|
|
616
|
+
* single `healing?` field from there on. The presence/absence of that config is the heal-on/heal-off
|
|
617
|
+
* discriminator inside the codec layer.
|
|
606
618
|
*/
|
|
607
619
|
readonly healUnresolvableIdentifiersOnDecode?: boolean;
|
|
608
620
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ChangeProcessor } from "../shared-tree-core/index.js";
|
|
7
|
+
import type { TransactionPostProcessor } from "../simple-tree/index.js";
|
|
8
|
+
|
|
9
|
+
import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The internal representation of a {@link TransactionPostProcessor}: a {@link ChangeProcessor} over
|
|
13
|
+
* {@link SharedTreeChange}.
|
|
14
|
+
* @remarks This is the (non-type-erased) form used internally to apply a transaction's post-processor.
|
|
15
|
+
*/
|
|
16
|
+
export type TransactionPostProcessorInternal = ChangeProcessor<SharedTreeChange>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Type-erases an internal {@link TransactionPostProcessorInternal | change processor} as a public
|
|
20
|
+
* {@link TransactionPostProcessor}.
|
|
21
|
+
* @remarks This is the only sanctioned way to produce a {@link TransactionPostProcessor}. The inverse conversion is
|
|
22
|
+
* {@link extractTransactionChangeProcessor}.
|
|
23
|
+
*/
|
|
24
|
+
export function createTransactionPostProcessor(
|
|
25
|
+
processor: TransactionPostProcessorInternal,
|
|
26
|
+
): TransactionPostProcessor {
|
|
27
|
+
return processor as unknown as TransactionPostProcessor;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Recovers the internal {@link TransactionPostProcessorInternal | change processor} from a type-erased
|
|
32
|
+
* {@link TransactionPostProcessor}.
|
|
33
|
+
* @remarks This reverses {@link createTransactionPostProcessor}. It is assumed that only code which produces these
|
|
34
|
+
* type-erased handles performs this conversion, allowing them to be treated as opaque elsewhere.
|
|
35
|
+
*/
|
|
36
|
+
export function extractTransactionChangeProcessor(
|
|
37
|
+
postProcessor: TransactionPostProcessor | undefined,
|
|
38
|
+
): TransactionPostProcessorInternal | undefined {
|
|
39
|
+
return postProcessor as unknown as TransactionPostProcessorInternal;
|
|
40
|
+
}
|
|
@@ -952,10 +952,10 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
952
952
|
const context: FieldBatchEncodingContext = {
|
|
953
953
|
encodeType: TreeCompressionStrategy.Compressed,
|
|
954
954
|
idCompressor,
|
|
955
|
-
originatorId: idCompressor.localSessionId, // TODO: Why is this needed?
|
|
956
955
|
schema: { schema: storedSchema, policy: defaultSchemaPolicy },
|
|
957
|
-
//
|
|
958
|
-
|
|
956
|
+
// Encode using summary-style identifier rules so the payload can be decoded
|
|
957
|
+
// without any originator session context.
|
|
958
|
+
isSummary: true,
|
|
959
959
|
};
|
|
960
960
|
const result = codec.encode(batch, context);
|
|
961
961
|
// TODO: codecs should better track which ones can contain handles, and which cannot. When done properly, casts like this can be removed.
|
|
@@ -76,6 +76,7 @@ import {
|
|
|
76
76
|
SharedTreeBranch,
|
|
77
77
|
TransactionResult as InternalTransactionResult,
|
|
78
78
|
type SharedTreeBranchChange,
|
|
79
|
+
type SquashingTransactionOptions,
|
|
79
80
|
type Transactor,
|
|
80
81
|
} from "../shared-tree-core/index.js";
|
|
81
82
|
import {
|
|
@@ -88,11 +89,11 @@ import {
|
|
|
88
89
|
type TreeBranch,
|
|
89
90
|
type TreeBranchAlpha,
|
|
90
91
|
type VerboseTree,
|
|
91
|
-
type
|
|
92
|
-
type
|
|
93
|
-
type
|
|
94
|
-
type
|
|
95
|
-
type
|
|
92
|
+
type VoidTransactionCallbackStatusAlpha,
|
|
93
|
+
type TransactionCallbackStatusAlpha,
|
|
94
|
+
type TransactionVoidResult,
|
|
95
|
+
type TransactionValueResult,
|
|
96
|
+
type RunTransactionParamsAlpha,
|
|
96
97
|
type TransactionConstraintAlpha,
|
|
97
98
|
type TreeViewAlpha,
|
|
98
99
|
getInnerNode,
|
|
@@ -117,6 +118,7 @@ import { SharedTreeChangeEnricher } from "./sharedTreeChangeEnricher.js";
|
|
|
117
118
|
import { SharedTreeChangeFamily, hasSchemaChange } from "./sharedTreeChangeFamily.js";
|
|
118
119
|
import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
119
120
|
import type { ISharedTreeEditor, SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
|
|
121
|
+
import { extractTransactionChangeProcessor } from "./transactionPostProcessor.js";
|
|
120
122
|
|
|
121
123
|
/**
|
|
122
124
|
* Yields all defined (non-`undefined`) labels from a {@link LabelTree}, depth-first.
|
|
@@ -205,6 +207,11 @@ export interface CheckoutEvents {
|
|
|
205
207
|
dispose(): void;
|
|
206
208
|
}
|
|
207
209
|
|
|
210
|
+
/**
|
|
211
|
+
* A collection of functions for managing transactions on a {@link ITreeCheckout}.
|
|
212
|
+
*/
|
|
213
|
+
export type TreeTransactor = Transactor<SquashingTransactionOptions<SharedTreeChange>>;
|
|
214
|
+
|
|
208
215
|
/**
|
|
209
216
|
* Provides a means for interacting with a SharedTree.
|
|
210
217
|
* This includes reading data from the tree and running transactions to mutate the tree.
|
|
@@ -251,13 +258,13 @@ export interface ITreeCheckout
|
|
|
251
258
|
/**
|
|
252
259
|
* A collection of functions for managing transactions.
|
|
253
260
|
*/
|
|
254
|
-
readonly transaction:
|
|
261
|
+
readonly transaction: TreeTransactor;
|
|
255
262
|
|
|
256
263
|
fork(): ITreeCheckout;
|
|
257
264
|
|
|
258
265
|
/**
|
|
259
|
-
* Replaces all
|
|
260
|
-
* Can
|
|
266
|
+
* Replaces all schemas with the provided schema.
|
|
267
|
+
* Can overwrite preexisting schemas, and removes unmentioned schemas.
|
|
261
268
|
*
|
|
262
269
|
* @param newSchema - The new schema to replace the existing schema.
|
|
263
270
|
* @param allowNonSupersetSchema - Whether to allow non-superset schemas.
|
|
@@ -390,7 +397,7 @@ function getCheckout(context: TreeBranch): TreeCheckout {
|
|
|
390
397
|
* @param constraintsOnRevert - If true, use {@link ISharedTreeEditor.addNodeExistsConstraintOnRevert}.
|
|
391
398
|
* @param constraints - The constraints to add to the transaction.
|
|
392
399
|
*
|
|
393
|
-
* @see {@link
|
|
400
|
+
* @see {@link RunTransactionParamsAlpha.preconditions}.
|
|
394
401
|
*/
|
|
395
402
|
export function addConstraintsToTransaction(
|
|
396
403
|
checkout: ITreeCheckout,
|
|
@@ -483,9 +490,9 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
483
490
|
private readonly views = new Set<TreeView<ImplicitFieldSchema>>();
|
|
484
491
|
|
|
485
492
|
/**
|
|
486
|
-
*
|
|
493
|
+
* Revertibles maintained for automatic disposal
|
|
487
494
|
*/
|
|
488
|
-
private readonly revertibles = new
|
|
495
|
+
private readonly revertibles = new Map<RevisionTag, RevertibleAlpha>();
|
|
489
496
|
|
|
490
497
|
/**
|
|
491
498
|
* Each branch's head commit corresponds to a revertible commit.
|
|
@@ -746,7 +753,7 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
746
753
|
revision,
|
|
747
754
|
this.#transaction.activeBranch.fork(commit),
|
|
748
755
|
);
|
|
749
|
-
this.revertibles.
|
|
756
|
+
this.revertibles.set(revision, revertible);
|
|
750
757
|
return revertible;
|
|
751
758
|
};
|
|
752
759
|
|
|
@@ -785,6 +792,11 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
785
792
|
});
|
|
786
793
|
withinEventContext = false;
|
|
787
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
|
+
}
|
|
788
800
|
} else if (this.isRemoteChangeEvent(event)) {
|
|
789
801
|
// TODO: figure out how to plumb through commit kind info for remote changes
|
|
790
802
|
this.emitChangedLocked(() => {
|
|
@@ -885,49 +897,52 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
885
897
|
}
|
|
886
898
|
|
|
887
899
|
public runTransaction<TSuccessValue, TFailureValue>(
|
|
888
|
-
transaction: () =>
|
|
889
|
-
params?:
|
|
890
|
-
):
|
|
900
|
+
transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>,
|
|
901
|
+
params?: RunTransactionParamsAlpha,
|
|
902
|
+
): TransactionValueResult<TSuccessValue, TFailureValue>;
|
|
891
903
|
public runTransaction(
|
|
892
|
-
transaction: () =>
|
|
893
|
-
params?:
|
|
894
|
-
):
|
|
904
|
+
transaction: () => VoidTransactionCallbackStatusAlpha | void,
|
|
905
|
+
params?: RunTransactionParamsAlpha,
|
|
906
|
+
): TransactionVoidResult;
|
|
895
907
|
@breakingMethod
|
|
896
908
|
public runTransaction<TSuccessValue, TFailureValue>(
|
|
897
909
|
transaction: () =>
|
|
898
|
-
|
|
|
899
|
-
|
|
|
910
|
+
| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
|
|
911
|
+
| VoidTransactionCallbackStatusAlpha
|
|
900
912
|
| void,
|
|
901
|
-
params?:
|
|
902
|
-
):
|
|
913
|
+
params?: RunTransactionParamsAlpha,
|
|
914
|
+
): TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult {
|
|
903
915
|
this.mountTransaction(params, false);
|
|
904
916
|
const transactionCallbackStatus = transaction();
|
|
905
917
|
return this.unmountTransaction(transactionCallbackStatus, params);
|
|
906
918
|
}
|
|
907
919
|
|
|
908
920
|
public runTransactionAsync<TSuccessValue, TFailureValue>(
|
|
909
|
-
transaction: () => Promise<
|
|
910
|
-
params?:
|
|
911
|
-
): Promise<
|
|
921
|
+
transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>,
|
|
922
|
+
params?: RunTransactionParamsAlpha,
|
|
923
|
+
): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
|
|
912
924
|
public runTransactionAsync(
|
|
913
|
-
transaction: () => Promise<
|
|
914
|
-
params?:
|
|
915
|
-
): Promise<
|
|
925
|
+
transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>,
|
|
926
|
+
params?: RunTransactionParamsAlpha,
|
|
927
|
+
): Promise<TransactionVoidResult>;
|
|
916
928
|
@breakingMethod
|
|
917
929
|
public async runTransactionAsync<TSuccessValue, TFailureValue>(
|
|
918
930
|
transaction: () => Promise<
|
|
919
|
-
|
|
|
920
|
-
|
|
|
931
|
+
| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
|
|
932
|
+
| VoidTransactionCallbackStatusAlpha
|
|
921
933
|
| void
|
|
922
934
|
>,
|
|
923
|
-
params:
|
|
924
|
-
): Promise<
|
|
935
|
+
params: RunTransactionParamsAlpha | undefined,
|
|
936
|
+
): Promise<TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult> {
|
|
925
937
|
this.mountTransaction(params, true);
|
|
926
938
|
const transactionCallbackStatus = await transaction();
|
|
927
939
|
return this.unmountTransaction(transactionCallbackStatus, params);
|
|
928
940
|
}
|
|
929
941
|
|
|
930
|
-
private mountTransaction(
|
|
942
|
+
private mountTransaction(
|
|
943
|
+
params: RunTransactionParamsAlpha | undefined,
|
|
944
|
+
isAsync: boolean,
|
|
945
|
+
): void {
|
|
931
946
|
this.checkNotDisposed();
|
|
932
947
|
// Starting a transaction is an edit, so it is forbidden from within a change-event
|
|
933
948
|
// callback (where the edit lock is held), the same as direct edits. For the async
|
|
@@ -944,22 +959,24 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
944
959
|
);
|
|
945
960
|
}
|
|
946
961
|
this.pushLabelFrame(params?.label);
|
|
947
|
-
this.transaction.start(
|
|
962
|
+
this.transaction.start({
|
|
963
|
+
postProcessor: extractTransactionChangeProcessor(params?.postProcessor),
|
|
964
|
+
});
|
|
948
965
|
|
|
949
966
|
addConstraintsToTransaction(this, false, params?.preconditions);
|
|
950
967
|
}
|
|
951
968
|
|
|
952
969
|
private unmountTransaction<TSuccessValue, TFailureValue>(
|
|
953
970
|
transactionCallbackStatus:
|
|
954
|
-
|
|
|
955
|
-
|
|
|
971
|
+
| TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
|
|
972
|
+
| VoidTransactionCallbackStatusAlpha
|
|
956
973
|
| void,
|
|
957
|
-
params:
|
|
958
|
-
):
|
|
974
|
+
params: RunTransactionParamsAlpha | undefined,
|
|
975
|
+
): TransactionValueResult<TSuccessValue, TFailureValue> | TransactionVoidResult {
|
|
959
976
|
this.checkNotDisposed();
|
|
960
977
|
const rollback = transactionCallbackStatus?.rollback;
|
|
961
978
|
const value = (
|
|
962
|
-
transactionCallbackStatus as
|
|
979
|
+
transactionCallbackStatus as TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>
|
|
963
980
|
)?.value;
|
|
964
981
|
|
|
965
982
|
if (rollback === true) {
|
|
@@ -1127,7 +1144,7 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
1127
1144
|
"Unable to dispose a revertible that has already been disposed.",
|
|
1128
1145
|
);
|
|
1129
1146
|
}
|
|
1130
|
-
checkout.disposeRevertible(
|
|
1147
|
+
checkout.disposeRevertible(revision);
|
|
1131
1148
|
onRevertibleDisposed?.(revertible);
|
|
1132
1149
|
},
|
|
1133
1150
|
};
|
|
@@ -1175,7 +1192,7 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
1175
1192
|
return this.forest.anchors.locate(anchor);
|
|
1176
1193
|
}
|
|
1177
1194
|
|
|
1178
|
-
public get transaction():
|
|
1195
|
+
public get transaction(): TreeTransactor {
|
|
1179
1196
|
return this.#transaction;
|
|
1180
1197
|
}
|
|
1181
1198
|
/**
|
|
@@ -1380,15 +1397,15 @@ export class TreeCheckout implements ITreeCheckout {
|
|
|
1380
1397
|
}
|
|
1381
1398
|
|
|
1382
1399
|
private purgeRevertibles(): void {
|
|
1383
|
-
for (const revertible of this.revertibles) {
|
|
1400
|
+
for (const revertible of this.revertibles.values()) {
|
|
1384
1401
|
revertible.dispose();
|
|
1385
1402
|
}
|
|
1386
1403
|
}
|
|
1387
1404
|
|
|
1388
|
-
private disposeRevertible(
|
|
1405
|
+
private disposeRevertible(revision: RevisionTag): void {
|
|
1389
1406
|
this.revertibleCommitBranches.get(revision)?.dispose();
|
|
1390
1407
|
this.revertibleCommitBranches.delete(revision);
|
|
1391
|
-
this.revertibles.delete(
|
|
1408
|
+
this.revertibles.delete(revision);
|
|
1392
1409
|
}
|
|
1393
1410
|
|
|
1394
1411
|
private revertRevertible(
|
|
@@ -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
|
),
|