@fluidframework/tree 2.116.1 → 2.117.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +116 -0
- package/api-report/tree.alpha.api.md +78 -30
- package/api-report/tree.beta.api.md +12 -9
- package/api-report/tree.legacy.beta.api.md +12 -9
- package/dist/codec/codec.d.ts +18 -0
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +18 -0
- package/dist/codec/codec.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +39 -2
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +37 -2
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +1 -0
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/revertible.d.ts +62 -6
- package/dist/core/revertible.d.ts.map +1 -1
- package/dist/core/revertible.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/indexing/types.d.ts +1 -1
- package/dist/feature-libraries/indexing/types.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -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/history.d.ts +22 -0
- package/dist/shared-tree/history.d.ts.map +1 -0
- package/dist/shared-tree/history.js +66 -0
- package/dist/shared-tree/history.js.map +1 -0
- package/dist/shared-tree/schematizingTreeView.d.ts +12 -7
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +13 -0
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -0
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/tree.js +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +8 -20
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +9 -12
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +16 -9
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +122 -25
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.d.ts +3 -2
- package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js +3 -0
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +16 -2
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +20 -2
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitCounter.d.ts +31 -0
- package/dist/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
- package/dist/shared-tree-core/branchCommitCounter.js +79 -0
- package/dist/shared-tree-core/branchCommitCounter.js.map +1 -0
- package/dist/shared-tree-core/customMetadataCodec.d.ts +9 -0
- package/dist/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
- package/dist/shared-tree-core/customMetadataCodec.js +37 -0
- package/dist/shared-tree-core/customMetadataCodec.js.map +1 -0
- package/dist/shared-tree-core/customMetadataFormat.d.ts +18 -0
- package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/customMetadataFormat.js +15 -0
- package/dist/shared-tree-core/customMetadataFormat.js.map +1 -0
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +15 -3
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +5 -0
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +17 -5
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +18 -8
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -3
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +2 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js +12 -3
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +5 -0
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +1 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +6 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +10 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +2 -0
- 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 +4 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +9 -0
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +26 -4
- 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/transactionTypes.d.ts +28 -2
- 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 +180 -61
- 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/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/tableSchema.js +10 -10
- package/dist/tableSchema.js.map +1 -1
- package/lib/codec/codec.d.ts +18 -0
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +18 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +39 -2
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +35 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +1 -0
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/revertible.d.ts +62 -6
- package/lib/core/revertible.d.ts.map +1 -1
- package/lib/core/revertible.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/indexing/types.d.ts +1 -1
- package/lib/feature-libraries/indexing/types.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +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/history.d.ts +22 -0
- package/lib/shared-tree/history.d.ts.map +1 -0
- package/lib/shared-tree/history.js +62 -0
- package/lib/shared-tree/history.js.map +1 -0
- package/lib/shared-tree/schematizingTreeView.d.ts +12 -7
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +13 -0
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -0
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/tree.js +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +8 -20
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +9 -12
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +16 -9
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +123 -26
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.d.ts +3 -2
- package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js +3 -0
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +16 -2
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +20 -2
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitCounter.d.ts +31 -0
- package/lib/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
- package/lib/shared-tree-core/branchCommitCounter.js +75 -0
- package/lib/shared-tree-core/branchCommitCounter.js.map +1 -0
- package/lib/shared-tree-core/customMetadataCodec.d.ts +9 -0
- package/lib/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
- package/lib/shared-tree-core/customMetadataCodec.js +32 -0
- package/lib/shared-tree-core/customMetadataCodec.js.map +1 -0
- package/lib/shared-tree-core/customMetadataFormat.d.ts +18 -0
- package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/customMetadataFormat.js +11 -0
- package/lib/shared-tree-core/customMetadataFormat.js.map +1 -0
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +16 -4
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +5 -0
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +17 -5
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +18 -8
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +4 -3
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +2 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +1 -0
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js +12 -3
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +5 -0
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +1 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +6 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +10 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js +2 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +5 -3
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +9 -0
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +27 -5
- 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/transactionTypes.d.ts +28 -2
- 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 +180 -61
- 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/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/tableSchema.js +10 -10
- package/lib/tableSchema.js.map +1 -1
- package/package.json +22 -22
- package/src/codec/codec.ts +19 -0
- package/src/core/index.ts +4 -0
- package/src/core/rebase/index.ts +2 -0
- package/src/core/rebase/types.ts +72 -2
- package/src/core/rebase/utils.ts +1 -0
- package/src/core/revertible.ts +67 -6
- package/src/entrypoints/alpha.ts +8 -0
- package/src/entrypoints/beta.ts +1 -0
- package/src/entrypoints/legacy.ts +1 -0
- package/src/feature-libraries/indexing/types.ts +1 -1
- package/src/index.ts +8 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/history.ts +99 -0
- package/src/shared-tree/schematizingTreeView.ts +25 -8
- package/src/shared-tree/sharedTree.ts +5 -2
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +17 -35
- package/src/shared-tree/treeCheckout.ts +170 -31
- package/src/shared-tree/unhydratedTreeContext.ts +6 -2
- package/src/shared-tree-core/branch.ts +34 -2
- package/src/shared-tree-core/branchCommitCounter.ts +103 -0
- package/src/shared-tree-core/customMetadataCodec.ts +42 -0
- package/src/shared-tree-core/customMetadataFormat.ts +39 -0
- package/src/shared-tree-core/editManager.ts +22 -3
- package/src/shared-tree-core/editManagerCodecs.ts +12 -0
- package/src/shared-tree-core/editManagerCodecsCommons.ts +41 -15
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +7 -1
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -0
- package/src/shared-tree-core/editManagerFormatCommons.ts +46 -12
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +13 -5
- package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -2
- package/src/shared-tree-core/index.ts +3 -0
- package/src/shared-tree-core/messageCodecV1ToV4.ts +18 -5
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +9 -2
- package/src/shared-tree-core/messageCodecs.ts +12 -0
- package/src/shared-tree-core/messageFormat.ts +6 -0
- package/src/shared-tree-core/messageFormatV1ToV4.ts +21 -3
- package/src/shared-tree-core/messageFormatVSharedBranches.ts +8 -0
- package/src/shared-tree-core/sharedTreeCore.ts +5 -2
- package/src/shared-tree-core/transaction.ts +56 -4
- package/src/simple-tree/api/index.ts +5 -0
- package/src/simple-tree/api/transactionTypes.ts +29 -2
- package/src/simple-tree/api/tree.ts +199 -60
- package/src/simple-tree/index.ts +5 -0
- package/src/tableSchema.ts +9 -9
|
@@ -15,10 +15,12 @@ import type {
|
|
|
15
15
|
import {
|
|
16
16
|
type JsonCompatibleReadOnlyObject,
|
|
17
17
|
JsonCompatibleReadOnlySchema,
|
|
18
|
+
type Mutable,
|
|
18
19
|
} from "../util/index.js";
|
|
19
20
|
|
|
20
21
|
import type { MessageDecodingContext, MessageEncodingContext } from "./messageCodecs.js";
|
|
21
|
-
import
|
|
22
|
+
import { MessageFormatVersion } from "./messageFormat.js";
|
|
23
|
+
import { decodeCustomMetadataTree, encodeCustomMetadataTree } from "./customMetadataCodec.js";
|
|
22
24
|
import { Message } from "./messageFormatV1ToV4.js";
|
|
23
25
|
import type { DecodedMessage } from "./messageTypes.js";
|
|
24
26
|
|
|
@@ -35,9 +37,15 @@ export function makeV1ToV4CodecWithVersion<TChangeset>(
|
|
|
35
37
|
| typeof MessageFormatVersion.v2
|
|
36
38
|
| typeof MessageFormatVersion.v3
|
|
37
39
|
| typeof MessageFormatVersion.v4
|
|
38
|
-
| typeof MessageFormatVersion.v6
|
|
40
|
+
| typeof MessageFormatVersion.v6
|
|
41
|
+
| typeof MessageFormatVersion.v7,
|
|
39
42
|
): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext, MessageDecodingContext> {
|
|
40
|
-
|
|
43
|
+
// Persisted commit metadata was introduced in v7; older formats must not write the field.
|
|
44
|
+
const supportsCustomMetadata = version >= MessageFormatVersion.v7;
|
|
45
|
+
const schema = Message(
|
|
46
|
+
changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema,
|
|
47
|
+
supportsCustomMetadata,
|
|
48
|
+
);
|
|
41
49
|
return {
|
|
42
50
|
schema,
|
|
43
51
|
encode: (
|
|
@@ -50,7 +58,7 @@ export function makeV1ToV4CodecWithVersion<TChangeset>(
|
|
|
50
58
|
0xc69 /* Only commit messages to main are supported */,
|
|
51
59
|
);
|
|
52
60
|
const { commit, sessionId: originatorId } = decoded;
|
|
53
|
-
|
|
61
|
+
const encoded: Mutable<Message & JsonCompatibleReadOnlyObject & Versioned> = {
|
|
54
62
|
revision: revisionTagCodec.encode(commit.revision, {
|
|
55
63
|
originatorId,
|
|
56
64
|
idCompressor: context.idCompressor,
|
|
@@ -67,12 +75,16 @@ export function makeV1ToV4CodecWithVersion<TChangeset>(
|
|
|
67
75
|
}),
|
|
68
76
|
version,
|
|
69
77
|
};
|
|
78
|
+
if (supportsCustomMetadata && commit.customMetadata !== undefined) {
|
|
79
|
+
encoded.customMetadata = encodeCustomMetadataTree(commit.customMetadata);
|
|
80
|
+
}
|
|
81
|
+
return encoded;
|
|
70
82
|
},
|
|
71
83
|
decode: (
|
|
72
84
|
encoded: Message & JsonCompatibleReadOnlyObject & Versioned,
|
|
73
85
|
context: MessageDecodingContext,
|
|
74
86
|
): DecodedMessage<TChangeset> => {
|
|
75
|
-
const { revision: encodedRevision, originatorId, changeset } = encoded;
|
|
87
|
+
const { revision: encodedRevision, originatorId, changeset, customMetadata } = encoded;
|
|
76
88
|
|
|
77
89
|
const revision = revisionTagCodec.decode(encodedRevision, {
|
|
78
90
|
originatorId,
|
|
@@ -92,6 +104,7 @@ export function makeV1ToV4CodecWithVersion<TChangeset>(
|
|
|
92
104
|
idCompressor: context.idCompressor,
|
|
93
105
|
isSummary: false,
|
|
94
106
|
}),
|
|
107
|
+
customMetadata: decodeCustomMetadataTree(customMetadata),
|
|
95
108
|
},
|
|
96
109
|
sessionId: originatorId,
|
|
97
110
|
};
|
|
@@ -14,9 +14,10 @@ import type {
|
|
|
14
14
|
EncodedRevisionTag,
|
|
15
15
|
RevisionTag,
|
|
16
16
|
} from "../core/index.js";
|
|
17
|
-
import type { JsonCompatibleReadOnlyObject } from "../util/index.js";
|
|
17
|
+
import type { JsonCompatibleReadOnlyObject, Mutable } from "../util/index.js";
|
|
18
18
|
|
|
19
19
|
import { decodeBranchId, encodeBranchId } from "./branchIdCodec.js";
|
|
20
|
+
import { decodeCustomMetadataTree, encodeCustomMetadataTree } from "./customMetadataCodec.js";
|
|
20
21
|
import type { MessageDecodingContext, MessageEncodingContext } from "./messageCodecs.js";
|
|
21
22
|
import type { MessageFormatVersion } from "./messageFormat.js";
|
|
22
23
|
import { Message } from "./messageFormatVSharedBranches.js";
|
|
@@ -51,7 +52,7 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
|
51
52
|
isSummary: false,
|
|
52
53
|
};
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
const encoded: Mutable<Message & JsonCompatibleReadOnlyObject & Versioned> = {
|
|
55
56
|
revision: revisionTagCodec.encode(message.commit.revision, {
|
|
56
57
|
originatorId: message.sessionId,
|
|
57
58
|
idCompressor: context.idCompressor,
|
|
@@ -63,6 +64,10 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
|
63
64
|
branchId: encodeBranchId(context.idCompressor, message.branchId),
|
|
64
65
|
version,
|
|
65
66
|
};
|
|
67
|
+
if (message.commit.customMetadata !== undefined) {
|
|
68
|
+
encoded.customMetadata = encodeCustomMetadataTree(message.commit.customMetadata);
|
|
69
|
+
}
|
|
70
|
+
return encoded;
|
|
66
71
|
}
|
|
67
72
|
case "branch": {
|
|
68
73
|
return {
|
|
@@ -87,6 +92,7 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
|
87
92
|
changeset,
|
|
88
93
|
branchId: encodedBranchId,
|
|
89
94
|
branchName: encodedBranchName,
|
|
95
|
+
customMetadata,
|
|
90
96
|
} = encoded;
|
|
91
97
|
|
|
92
98
|
const changeContext: ChangeEncodingContext = {
|
|
@@ -120,6 +126,7 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
|
120
126
|
idCompressor: context.idCompressor,
|
|
121
127
|
isSummary: false,
|
|
122
128
|
}),
|
|
129
|
+
customMetadata: decodeCustomMetadataTree(customMetadata),
|
|
123
130
|
},
|
|
124
131
|
branchId,
|
|
125
132
|
sessionId: originatorId,
|
|
@@ -125,6 +125,18 @@ export function makeMessageCodecBuilder<TChangeset>(): VersionDispatchingCodecBu
|
|
|
125
125
|
MessageFormatVersion.v6,
|
|
126
126
|
),
|
|
127
127
|
},
|
|
128
|
+
{
|
|
129
|
+
minVersionForCollab: FluidClientVersion.v2_117,
|
|
130
|
+
formatVersion: MessageFormatVersion.v7,
|
|
131
|
+
codec: (options: MessageCodecBuilderOptions<TChangeset>) =>
|
|
132
|
+
makeV1ToV4CodecWithVersion(
|
|
133
|
+
options.changeCodecs.resolve(
|
|
134
|
+
options.dependentChangeFormatVersion.lookup(MessageFormatVersion.v7),
|
|
135
|
+
),
|
|
136
|
+
options.revisionTagCodec,
|
|
137
|
+
MessageFormatVersion.v7,
|
|
138
|
+
),
|
|
139
|
+
},
|
|
128
140
|
{
|
|
129
141
|
minVersionForCollab: undefined,
|
|
130
142
|
formatVersion: MessageFormatVersion.vSharedBranches,
|
|
@@ -52,6 +52,11 @@ export const MessageFormatVersion = strictEnum("MessageFormatVersion", {
|
|
|
52
52
|
* Adds support for "no change" constraints.
|
|
53
53
|
*/
|
|
54
54
|
v6: 6,
|
|
55
|
+
/**
|
|
56
|
+
* Introduced and made available for writing in 2.117.0.
|
|
57
|
+
* Adds support for {@link GraphCommit.customMetadata | persisted commit metadata}.
|
|
58
|
+
*/
|
|
59
|
+
v7: 7,
|
|
55
60
|
/**
|
|
56
61
|
* Not yet released.
|
|
57
62
|
* Only used for testing shared branches.
|
|
@@ -63,5 +68,6 @@ export const supportedMessageFormatVersions: ReadonlySet<MessageFormatVersion> =
|
|
|
63
68
|
MessageFormatVersion.v3,
|
|
64
69
|
MessageFormatVersion.v4,
|
|
65
70
|
MessageFormatVersion.v6,
|
|
71
|
+
MessageFormatVersion.v7,
|
|
66
72
|
MessageFormatVersion.vSharedBranches,
|
|
67
73
|
]);
|
|
@@ -10,6 +10,7 @@ import type { TSchema } from "@sinclair/typebox";
|
|
|
10
10
|
import { type EncodedRevisionTag, RevisionTagSchema, SessionIdSchema } from "../core/index.js";
|
|
11
11
|
import type { JsonCompatibleReadOnly } from "../util/index.js";
|
|
12
12
|
|
|
13
|
+
import { EncodedCustomMetadataTree } from "./customMetadataFormat.js";
|
|
13
14
|
import { MessageFormatVersion } from "./messageFormat.js";
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -29,6 +30,12 @@ export interface Message {
|
|
|
29
30
|
*/
|
|
30
31
|
readonly changeset: JsonCompatibleReadOnly;
|
|
31
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Arbitrary, application-defined metadata to persist alongside the commit in this message.
|
|
35
|
+
* @remarks Only written at {@link MessageFormatVersion.v7} and later.
|
|
36
|
+
*/
|
|
37
|
+
readonly customMetadata?: EncodedCustomMetadataTree;
|
|
38
|
+
|
|
32
39
|
/**
|
|
33
40
|
* The version of the message. This controls how the message is encoded.
|
|
34
41
|
*
|
|
@@ -40,16 +47,25 @@ export interface Message {
|
|
|
40
47
|
| typeof MessageFormatVersion.v2
|
|
41
48
|
| typeof MessageFormatVersion.v3
|
|
42
49
|
| typeof MessageFormatVersion.v4
|
|
43
|
-
| typeof MessageFormatVersion.v6
|
|
50
|
+
| typeof MessageFormatVersion.v6
|
|
51
|
+
| typeof MessageFormatVersion.v7;
|
|
44
52
|
}
|
|
45
53
|
|
|
54
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
46
55
|
// Return type is intentionally derived.
|
|
47
|
-
//
|
|
48
|
-
|
|
56
|
+
// Unlike the summary formats, this schema does not set `additionalProperties: false`: the op envelope
|
|
57
|
+
// has always tolerated unknown properties, and tightening it could reject ops from other versions.
|
|
58
|
+
export const Message = <ChangeSchema extends TSchema>(
|
|
59
|
+
tChange: ChangeSchema,
|
|
60
|
+
includeCustomMetadata: boolean,
|
|
61
|
+
) =>
|
|
49
62
|
Type.Object({
|
|
50
63
|
revision: RevisionTagSchema,
|
|
51
64
|
originatorId: SessionIdSchema,
|
|
52
65
|
changeset: tChange,
|
|
66
|
+
...(includeCustomMetadata
|
|
67
|
+
? { customMetadata: Type.Optional(EncodedCustomMetadataTree) }
|
|
68
|
+
: {}),
|
|
53
69
|
version: Type.Optional(
|
|
54
70
|
Type.Union([
|
|
55
71
|
Type.Literal(MessageFormatVersion.v1),
|
|
@@ -57,6 +73,8 @@ export const Message = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>
|
|
|
57
73
|
Type.Literal(MessageFormatVersion.v3),
|
|
58
74
|
Type.Literal(MessageFormatVersion.v4),
|
|
59
75
|
Type.Literal(MessageFormatVersion.v6),
|
|
76
|
+
Type.Literal(MessageFormatVersion.v7),
|
|
60
77
|
]),
|
|
61
78
|
),
|
|
62
79
|
});
|
|
80
|
+
/* eslint-enable @typescript-eslint/explicit-function-return-type */
|
|
@@ -11,6 +11,7 @@ import { type EncodedRevisionTag, RevisionTagSchema, SessionIdSchema } from "../
|
|
|
11
11
|
import type { JsonCompatibleReadOnly } from "../util/index.js";
|
|
12
12
|
|
|
13
13
|
import type { EncodedBranchId } from "./branch.js";
|
|
14
|
+
import { EncodedCustomMetadataTree } from "./customMetadataFormat.js";
|
|
14
15
|
import { MessageFormatVersion } from "./messageFormat.js";
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -41,6 +42,12 @@ export interface Message {
|
|
|
41
42
|
*/
|
|
42
43
|
readonly branchName?: string;
|
|
43
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Arbitrary, application-defined metadata to persist alongside the commit in this message.
|
|
47
|
+
* @remarks See {@link GraphCommit.customMetadata}.
|
|
48
|
+
*/
|
|
49
|
+
readonly customMetadata?: EncodedCustomMetadataTree;
|
|
50
|
+
|
|
44
51
|
/**
|
|
45
52
|
* The version of the message format.
|
|
46
53
|
*/
|
|
@@ -56,5 +63,6 @@ export const Message = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>
|
|
|
56
63
|
changeset: Type.Optional(tChange),
|
|
57
64
|
branchId: Type.Optional(Type.Number()),
|
|
58
65
|
branchName: Type.Optional(Type.String()),
|
|
66
|
+
customMetadata: Type.Optional(EncodedCustomMetadataTree),
|
|
59
67
|
version: Type.Literal(MessageFormatVersion.vSharedBranches),
|
|
60
68
|
});
|
|
@@ -30,6 +30,7 @@ import type { CodecWriteOptions, DependentFormatVersion, IJsonCodec } from "../c
|
|
|
30
30
|
import {
|
|
31
31
|
type ChangeFamily,
|
|
32
32
|
type ChangeFamilyEditor,
|
|
33
|
+
CommitKind,
|
|
33
34
|
type GraphCommit,
|
|
34
35
|
replaceChange,
|
|
35
36
|
type RevisionTag,
|
|
@@ -669,10 +670,12 @@ export class SharedTreeCore<
|
|
|
669
670
|
switch (type) {
|
|
670
671
|
case "commit": {
|
|
671
672
|
const {
|
|
672
|
-
commit: { revision, change },
|
|
673
|
+
commit: { revision, change, customMetadata },
|
|
673
674
|
branchId,
|
|
674
675
|
} = message;
|
|
675
|
-
this.editManager
|
|
676
|
+
this.editManager
|
|
677
|
+
.getLocalBranch(branchId)
|
|
678
|
+
.apply({ change, revision }, CommitKind.Default, customMetadata);
|
|
676
679
|
break;
|
|
677
680
|
}
|
|
678
681
|
case "branch": {
|
|
@@ -15,15 +15,25 @@ import {
|
|
|
15
15
|
mintCommit,
|
|
16
16
|
rebaseBranch,
|
|
17
17
|
tagChange,
|
|
18
|
+
CommitKind,
|
|
18
19
|
type ChangeFamilyEditor,
|
|
20
|
+
type CustomMetadataTree,
|
|
19
21
|
type GraphCommit,
|
|
20
22
|
type ProcessChangeFn,
|
|
21
23
|
type RevisionTag,
|
|
22
24
|
} from "../core/index.js";
|
|
23
|
-
import { getLast, getOrCreate } from "../util/index.js";
|
|
25
|
+
import { getLast, getOrCreate, type JsonCompatibleReadOnlyObject } from "../util/index.js";
|
|
24
26
|
|
|
25
27
|
import type { SharedTreeBranch, SharedTreeBranchEvents } from "./branch.js";
|
|
26
28
|
|
|
29
|
+
/**
|
|
30
|
+
* A {@link CustomMetadataTree} under construction.
|
|
31
|
+
*/
|
|
32
|
+
interface MutableCustomMetadataTree {
|
|
33
|
+
metadata: JsonCompatibleReadOnlyObject | undefined;
|
|
34
|
+
children: MutableCustomMetadataTree[];
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
/**
|
|
28
38
|
* Describes the result of a transaction.
|
|
29
39
|
* Transactions may either succeed and commit, or fail and abort.
|
|
@@ -290,6 +300,15 @@ export interface SquashingTransactionOptions<TChange, TChangeProcessingContext>
|
|
|
290
300
|
* {@link ChangeProcessor.applicability | applicability}.
|
|
291
301
|
*/
|
|
292
302
|
readonly postProcessor?: ChangeProcessor<TChange, TChangeProcessingContext>;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Arbitrary, application-defined metadata to attach to the commit that this transaction produces.
|
|
306
|
+
*
|
|
307
|
+
* @remarks
|
|
308
|
+
* Each transaction in the stack contributes a node to the resulting {@link CustomMetadataTree}. If
|
|
309
|
+
* the transaction produces no commit, the metadata is discarded.
|
|
310
|
+
*/
|
|
311
|
+
readonly customMetadata?: JsonCompatibleReadOnlyObject;
|
|
293
312
|
}
|
|
294
313
|
|
|
295
314
|
/**
|
|
@@ -409,6 +428,15 @@ export class SquashingTransactionStack<
|
|
|
409
428
|
startOptions?: SquashingTransactionOptions<TChange, TChangeProcessingContext>,
|
|
410
429
|
): Callbacks<SquashingTransactionOptions<TChange, TChangeProcessingContext>> => {
|
|
411
430
|
postProcessorStack.push(resolvePostProcessor(startOptions?.postProcessor));
|
|
431
|
+
// Each transaction in the stack contributes a node to a tree mirroring the nesting, which is
|
|
432
|
+
// attached to the single commit they produce. `openMetadataNode` is the innermost open node.
|
|
433
|
+
const rootMetadataNode: MutableCustomMetadataTree = {
|
|
434
|
+
metadata: startOptions?.customMetadata,
|
|
435
|
+
children: [],
|
|
436
|
+
};
|
|
437
|
+
let openMetadataNode = rootMetadataNode;
|
|
438
|
+
const hasCustomMetadata = (node: CustomMetadataTree): boolean =>
|
|
439
|
+
node.metadata !== undefined || node.children.some(hasCustomMetadata);
|
|
412
440
|
// Keep track of the commit that each transaction was on when it started
|
|
413
441
|
const startHead = this.activeBranch.getHead();
|
|
414
442
|
const changeFamily = this.branch.changeFamily;
|
|
@@ -490,19 +518,31 @@ export class SquashingTransactionStack<
|
|
|
490
518
|
// change in their place so that the view fully reflects the modified
|
|
491
519
|
// `change`.
|
|
492
520
|
transactionBranch.removeAfter(startHead);
|
|
493
|
-
transactionBranch.apply(
|
|
521
|
+
transactionBranch.apply(
|
|
522
|
+
tagChange(change, transactionRevision),
|
|
523
|
+
CommitKind.Default,
|
|
524
|
+
undefined,
|
|
525
|
+
);
|
|
494
526
|
}
|
|
495
527
|
|
|
528
|
+
const customMetadata = hasCustomMetadata(rootMetadataNode)
|
|
529
|
+
? rootMetadataNode
|
|
530
|
+
: undefined;
|
|
496
531
|
if (targetPath.length === 0) {
|
|
497
532
|
// No changes were made on the original branch since the transaction began
|
|
498
533
|
// The transaction commit can be applied directly
|
|
499
|
-
this.branch.apply(
|
|
534
|
+
this.branch.apply(
|
|
535
|
+
tagChange(change, transactionRevision),
|
|
536
|
+
CommitKind.Default,
|
|
537
|
+
customMetadata,
|
|
538
|
+
);
|
|
500
539
|
// The view is already up-to-date so there's nothing more to do
|
|
501
540
|
} else {
|
|
502
541
|
// Some changes were made on `branch` since the transaction began
|
|
503
542
|
const unrebasedHead = mintCommit(startHead, {
|
|
504
543
|
change,
|
|
505
544
|
revision: transactionRevision,
|
|
545
|
+
customMetadata,
|
|
506
546
|
});
|
|
507
547
|
// We need to rebase the transaction commit on top of the new changes
|
|
508
548
|
const rebased = rebaseBranch(
|
|
@@ -515,7 +555,7 @@ export class SquashingTransactionStack<
|
|
|
515
555
|
rebased.newSourceHead.revision === transactionRevision,
|
|
516
556
|
0xcd0 /* The transaction commit should be rebased to the tip */,
|
|
517
557
|
);
|
|
518
|
-
this.branch.apply(rebased.newSourceHead);
|
|
558
|
+
this.branch.apply(rebased.newSourceHead, CommitKind.Default, customMetadata);
|
|
519
559
|
viewUpdate = rebased.sourceChange;
|
|
520
560
|
}
|
|
521
561
|
} else {
|
|
@@ -546,6 +586,13 @@ export class SquashingTransactionStack<
|
|
|
546
586
|
SquashingTransactionOptions<TChange, TChangeProcessingContext>
|
|
547
587
|
> = (nestedStartOptions) => {
|
|
548
588
|
postProcessorStack.push(resolvePostProcessor(nestedStartOptions?.postProcessor));
|
|
589
|
+
const nestedMetadataNode: MutableCustomMetadataTree = {
|
|
590
|
+
metadata: nestedStartOptions?.customMetadata,
|
|
591
|
+
children: [],
|
|
592
|
+
};
|
|
593
|
+
const metadataParent = openMetadataNode;
|
|
594
|
+
metadataParent.children.push(nestedMetadataNode);
|
|
595
|
+
openMetadataNode = nestedMetadataNode;
|
|
549
596
|
const nestedStartHead = this.activeBranch.getHead();
|
|
550
597
|
const nestedOuterOnPop = onPush?.();
|
|
551
598
|
transactionBranch.editor.enterTransaction();
|
|
@@ -553,9 +600,12 @@ export class SquashingTransactionStack<
|
|
|
553
600
|
// Invoked when a nested transaction ends
|
|
554
601
|
onPop: (result) => {
|
|
555
602
|
const nestedPostProcessor = postProcessorStack.pop();
|
|
603
|
+
openMetadataNode = metadataParent;
|
|
556
604
|
transactionBranch.editor.exitTransaction();
|
|
557
605
|
switch (result) {
|
|
558
606
|
case TransactionResult.Abort: {
|
|
607
|
+
// The aborted transaction contributed nothing; its node is necessarily the last child.
|
|
608
|
+
metadataParent.children.pop();
|
|
559
609
|
// When a transaction is aborted, roll back all the transaction's changes on the current branch
|
|
560
610
|
transactionBranch.removeAfter(nestedStartHead);
|
|
561
611
|
break;
|
|
@@ -585,6 +635,8 @@ export class SquashingTransactionStack<
|
|
|
585
635
|
transactionBranch.removeAfter(nestedStartHead);
|
|
586
636
|
transactionBranch.apply(
|
|
587
637
|
tagChange(processedSquash, transactionRevision),
|
|
638
|
+
CommitKind.Default,
|
|
639
|
+
undefined,
|
|
588
640
|
);
|
|
589
641
|
}
|
|
590
642
|
}
|
|
@@ -13,6 +13,7 @@ export {
|
|
|
13
13
|
TreeViewConfigurationAlpha,
|
|
14
14
|
} from "./configuration.js";
|
|
15
15
|
export type {
|
|
16
|
+
CommitRevision,
|
|
16
17
|
ITree,
|
|
17
18
|
TreeView,
|
|
18
19
|
ViewableTree,
|
|
@@ -20,9 +21,13 @@ export type {
|
|
|
20
21
|
SchemaCompatibilityStatus,
|
|
21
22
|
TreeViewAlpha,
|
|
22
23
|
TreeViewBeta,
|
|
24
|
+
UntypedTreeView,
|
|
23
25
|
TreeBranch,
|
|
24
26
|
TreeBranchAlpha,
|
|
27
|
+
UntypedTreeViewAlpha,
|
|
25
28
|
TreeBranchEvents,
|
|
29
|
+
TreeBranchCommitMetadata,
|
|
30
|
+
TreeBranchHistory,
|
|
26
31
|
TreeContextAlpha,
|
|
27
32
|
ITreeAlpha,
|
|
28
33
|
} from "./tree.js";
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import type { ErasedType } from "@fluidframework/core-interfaces";
|
|
7
7
|
|
|
8
8
|
import type { TreeNode } from "../core/index.js";
|
|
9
|
+
import type { JsonCompatibleReadOnlyObject } from "../../util/index.js";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* A special object that signifies when a SharedTree {@link RunTransaction | transaction} should "roll back".
|
|
@@ -103,7 +104,7 @@ export type TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue> =
|
|
|
103
104
|
};
|
|
104
105
|
|
|
105
106
|
/**
|
|
106
|
-
* The result of a {@link
|
|
107
|
+
* The result of a {@link UntypedTreeViewAlpha.(runTransaction:2) | transaction} that doesn't return a value.
|
|
107
108
|
* @input
|
|
108
109
|
* @alpha
|
|
109
110
|
*/
|
|
@@ -181,7 +182,7 @@ export interface RunTransactionParamsBeta {
|
|
|
181
182
|
/**
|
|
182
183
|
* A label for this transaction that allows it to be correlated with later edits (e.g. for controlling undo/redo grouping).
|
|
183
184
|
* @remarks
|
|
184
|
-
* If this transaction is applied to
|
|
185
|
+
* If this transaction is applied to an {@link UntypedTreeViewAlpha | untyped view}, the label will be available in the {@link LocalChangeMetadata.label | metadata} of the {@link TreeBranchEvents.changed | `changed`} event.
|
|
185
186
|
*
|
|
186
187
|
* If there is a nested transaction, only the outermost transaction label will be used.
|
|
187
188
|
*/
|
|
@@ -218,4 +219,30 @@ export interface RunTransactionParamsAlpha extends RunTransactionParamsBeta {
|
|
|
218
219
|
* reserving the behavior; a real post-processor will be provided in a future change.
|
|
219
220
|
*/
|
|
220
221
|
readonly postProcessor?: TransactionPostProcessor;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Arbitrary, application-defined metadata to persist alongside the commit that this transaction produces.
|
|
225
|
+
* @remarks
|
|
226
|
+
* The metadata is replicated to all collaborating clients and persisted in the document, and is readable
|
|
227
|
+
* via {@link TreeBranchCommitMetadata.custom} while walking the branch's
|
|
228
|
+
* {@link UntypedTreeViewAlpha.branchHistory | history}. It shares the lifetime of the commit it is attached
|
|
229
|
+
* to: once that commit is trimmed from the trunk, the metadata goes with it. If the transaction produces no
|
|
230
|
+
* commit — because its body made no changes, or because it was rolled back — the metadata is discarded.
|
|
231
|
+
*
|
|
232
|
+
* Nested transactions all contribute to the single commit they produce, and their metadata is available
|
|
233
|
+
* both flattened via {@link TreeBranchCommitMetadata.custom} and structurally via
|
|
234
|
+
* {@link TreeBranchCommitMetadata.customTree}.
|
|
235
|
+
*
|
|
236
|
+
* To attach metadata to the commit produced by
|
|
237
|
+
* {@link RevertibleAlpha.(revert:3) | reverting}, use {@link RevertOptionsAlpha.customMetadata} instead.
|
|
238
|
+
*
|
|
239
|
+
* The value is snapshotted when the transaction starts and normalized as `JSON.stringify` would. An error is
|
|
240
|
+
* thrown if it cannot be represented as a JSON object at all, such as when it contains a cycle or a
|
|
241
|
+
* `bigint`. Because it is persisted, it should be kept small; it is also bounded by the runtime's maximum
|
|
242
|
+
* op size.
|
|
243
|
+
*
|
|
244
|
+
* Metadata is only written to the document when `minVersionForCollab` is set to `"2.117.0"` or later.
|
|
245
|
+
* Otherwise it is retained in memory for the local session but not persisted or replicated.
|
|
246
|
+
*/
|
|
247
|
+
readonly customMetadata?: JsonCompatibleReadOnlyObject;
|
|
221
248
|
}
|