@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/tree",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.117.0",
|
|
4
4
|
"description": "Distributed tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -101,17 +101,17 @@
|
|
|
101
101
|
"temp-directory": "nyc/.nyc_output"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@fluid-internal/client-utils": "~2.
|
|
105
|
-
"@fluidframework/core-interfaces": "~2.
|
|
106
|
-
"@fluidframework/core-utils": "~2.
|
|
107
|
-
"@fluidframework/datastore-definitions": "~2.
|
|
108
|
-
"@fluidframework/driver-definitions": "~2.
|
|
109
|
-
"@fluidframework/id-compressor": "~2.
|
|
110
|
-
"@fluidframework/runtime-definitions": "~2.
|
|
111
|
-
"@fluidframework/runtime-utils": "~2.
|
|
112
|
-
"@fluidframework/shared-object-base": "~2.
|
|
113
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
114
|
-
"@fluidframework/type-factory": "~2.
|
|
104
|
+
"@fluid-internal/client-utils": "~2.117.0",
|
|
105
|
+
"@fluidframework/core-interfaces": "~2.117.0",
|
|
106
|
+
"@fluidframework/core-utils": "~2.117.0",
|
|
107
|
+
"@fluidframework/datastore-definitions": "~2.117.0",
|
|
108
|
+
"@fluidframework/driver-definitions": "~2.117.0",
|
|
109
|
+
"@fluidframework/id-compressor": "~2.117.0",
|
|
110
|
+
"@fluidframework/runtime-definitions": "~2.117.0",
|
|
111
|
+
"@fluidframework/runtime-utils": "~2.117.0",
|
|
112
|
+
"@fluidframework/shared-object-base": "~2.117.0",
|
|
113
|
+
"@fluidframework/telemetry-utils": "~2.117.0",
|
|
114
|
+
"@fluidframework/type-factory": "~2.117.0",
|
|
115
115
|
"@sinclair/typebox": "^0.34.13",
|
|
116
116
|
"@tylerbu/sorted-btree-es6": "^2.1.1",
|
|
117
117
|
"semver-ts": "^1.0.3",
|
|
@@ -121,21 +121,21 @@
|
|
|
121
121
|
"devDependencies": {
|
|
122
122
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
123
123
|
"@biomejs/biome": "~2.4.5",
|
|
124
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
125
|
-
"@fluid-private/stochastic-test-utils": "~2.
|
|
126
|
-
"@fluid-private/test-dds-utils": "~2.
|
|
127
|
-
"@fluid-private/test-drivers": "~2.
|
|
124
|
+
"@fluid-internal/mocha-test-setup": "~2.117.0",
|
|
125
|
+
"@fluid-private/stochastic-test-utils": "~2.117.0",
|
|
126
|
+
"@fluid-private/test-dds-utils": "~2.117.0",
|
|
127
|
+
"@fluid-private/test-drivers": "~2.117.0",
|
|
128
128
|
"@fluid-tools/benchmark": "^0.59.0",
|
|
129
129
|
"@fluid-tools/build-cli": "^0.67.0",
|
|
130
130
|
"@fluidframework/build-common": "^2.0.3",
|
|
131
131
|
"@fluidframework/build-tools": "^0.67.0",
|
|
132
|
-
"@fluidframework/container-definitions": "~2.
|
|
133
|
-
"@fluidframework/container-loader": "~2.
|
|
134
|
-
"@fluidframework/container-runtime": "~2.
|
|
132
|
+
"@fluidframework/container-definitions": "~2.117.0",
|
|
133
|
+
"@fluidframework/container-loader": "~2.117.0",
|
|
134
|
+
"@fluidframework/container-runtime": "~2.117.0",
|
|
135
135
|
"@fluidframework/eslint-config-fluid": "^14.0.0",
|
|
136
|
-
"@fluidframework/local-driver": "~2.
|
|
137
|
-
"@fluidframework/test-runtime-utils": "~2.
|
|
138
|
-
"@fluidframework/test-utils": "~2.
|
|
136
|
+
"@fluidframework/local-driver": "~2.117.0",
|
|
137
|
+
"@fluidframework/test-runtime-utils": "~2.117.0",
|
|
138
|
+
"@fluidframework/test-utils": "~2.117.0",
|
|
139
139
|
"@fluidframework/tree-previous": "npm:@fluidframework/tree@2.116.0",
|
|
140
140
|
"@microsoft/api-extractor": "7.58.1",
|
|
141
141
|
"@types/diff": "^3.5.1",
|
package/src/codec/codec.ts
CHANGED
|
@@ -540,6 +540,25 @@ export const FluidClientVersion = {
|
|
|
540
540
|
* - ModularChangeFormatVersion.v5 - written when minVersionForCollab \>= 2.80
|
|
541
541
|
*/
|
|
542
542
|
v2_80: "2.80.0",
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Fluid Framework Client 2.117 and newer.
|
|
546
|
+
* @remarks
|
|
547
|
+
* New formats introduced in 2.117:
|
|
548
|
+
* - MessageFormatVersion.v7 - written when minVersionForCollab \>= 2.117
|
|
549
|
+
* - EditManagerFormatVersion.v7 - written when minVersionForCollab \>= 2.117
|
|
550
|
+
*
|
|
551
|
+
* @privateRemarks
|
|
552
|
+
* These formats are gated at 2.117.0 rather than 3.0.0 so that they can also be carried by a
|
|
553
|
+
* 2.117.0 minor cut from the last pre-3.0 commit on main, should one be needed for consumers
|
|
554
|
+
* that cannot yet absorb the 3.0 breaking changes. Since 3.0.0 \> 2.117.0, 3.x clients select
|
|
555
|
+
* these formats for any minVersionForCollab at or above 2.117.0 whether or not that release
|
|
556
|
+
* ever ships.
|
|
557
|
+
*
|
|
558
|
+
* Every client at or above 2.117.0 must therefore be able to read and write these formats. A
|
|
559
|
+
* client that maps 2.117.0 to an older format would silently strip metadata when encoding.
|
|
560
|
+
*/
|
|
561
|
+
v2_117: "2.117.0",
|
|
543
562
|
} as const satisfies Record<string, OldestSupportedClientVersion>;
|
|
544
563
|
|
|
545
564
|
/**
|
package/src/core/index.ts
CHANGED
|
@@ -188,6 +188,7 @@ export {
|
|
|
188
188
|
type RemoteChangeMetadata,
|
|
189
189
|
type ChangeMetadata,
|
|
190
190
|
type LabelTree,
|
|
191
|
+
type CustomMetadataTree,
|
|
191
192
|
type TransactionLabels,
|
|
192
193
|
type RevisionTag,
|
|
193
194
|
RevisionTagSchema,
|
|
@@ -202,6 +203,7 @@ export {
|
|
|
202
203
|
tagRollbackInverse,
|
|
203
204
|
SessionIdSchema,
|
|
204
205
|
mintCommit,
|
|
206
|
+
flattenCustomMetadata,
|
|
205
207
|
rebaseBranch,
|
|
206
208
|
type BranchRebaseResult,
|
|
207
209
|
rebaseChange,
|
|
@@ -236,4 +238,6 @@ export {
|
|
|
236
238
|
type RevertibleFactory,
|
|
237
239
|
type RevertibleAlphaFactory,
|
|
238
240
|
type RevertibleAlpha,
|
|
241
|
+
type RevertOptionsAlpha,
|
|
242
|
+
type RevertToOptionsAlpha,
|
|
239
243
|
} from "./revertible.js";
|
package/src/core/rebase/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export {
|
|
|
9
9
|
makeChangeAtomId,
|
|
10
10
|
asChangeAtomId,
|
|
11
11
|
mintCommit,
|
|
12
|
+
flattenCustomMetadata,
|
|
12
13
|
type GraphCommit,
|
|
13
14
|
CommitKind,
|
|
14
15
|
type CommitMetadata,
|
|
@@ -18,6 +19,7 @@ export {
|
|
|
18
19
|
type RemoteChangeMetadata,
|
|
19
20
|
type ChangeMetadata,
|
|
20
21
|
type LabelTree,
|
|
22
|
+
type CustomMetadataTree,
|
|
21
23
|
type TransactionLabels,
|
|
22
24
|
type RevisionTag,
|
|
23
25
|
RevisionTagSchema,
|
package/src/core/rebase/types.ts
CHANGED
|
@@ -15,6 +15,7 @@ import * as Type from "@sinclair/typebox";
|
|
|
15
15
|
import {
|
|
16
16
|
type Brand,
|
|
17
17
|
type JsonCompatibleReadOnly,
|
|
18
|
+
type JsonCompatibleReadOnlyObject,
|
|
18
19
|
type NestedMap,
|
|
19
20
|
RangeMap,
|
|
20
21
|
brand,
|
|
@@ -166,6 +167,74 @@ export interface GraphCommit<TChange> {
|
|
|
166
167
|
readonly change: TChange;
|
|
167
168
|
/** The parent of this commit, on whose change this commit's change is based */
|
|
168
169
|
readonly parent?: GraphCommit<TChange>;
|
|
170
|
+
/**
|
|
171
|
+
* Arbitrary, application-defined metadata that is persisted alongside this commit.
|
|
172
|
+
* @remarks
|
|
173
|
+
* Set via {@link RunTransactionParamsAlpha.customMetadata}. This is a tree rather than a single
|
|
174
|
+
* object because a commit may be produced by nested transactions.
|
|
175
|
+
* @privateRemarks
|
|
176
|
+
* Always copy this property when copying a commit.
|
|
177
|
+
*/
|
|
178
|
+
readonly customMetadata: CustomMetadataTree | undefined;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* A tree representing the nesting structure of transaction metadata.
|
|
183
|
+
*
|
|
184
|
+
* @remarks
|
|
185
|
+
* Each transaction contributes a node whose {@link CustomMetadataTree.metadata} is its
|
|
186
|
+
* {@link RunTransactionParamsAlpha.customMetadata | metadata} (or `undefined` if none was provided).
|
|
187
|
+
* When transactions are nested, inner transaction nodes become
|
|
188
|
+
* {@link CustomMetadataTree.children | children} of outer ones.
|
|
189
|
+
*
|
|
190
|
+
* @sealed @alpha
|
|
191
|
+
*/
|
|
192
|
+
export interface CustomMetadataTree {
|
|
193
|
+
/**
|
|
194
|
+
* The metadata supplied by this transaction, or `undefined` if it supplied none.
|
|
195
|
+
*/
|
|
196
|
+
readonly metadata: JsonCompatibleReadOnlyObject | undefined;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* The metadata trees of any nested transactions within this one.
|
|
200
|
+
*/
|
|
201
|
+
readonly children: readonly CustomMetadataTree[];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Flattens a {@link CustomMetadataTree} into a single object.
|
|
206
|
+
* @remarks
|
|
207
|
+
* Where two transactions used the same property, the outermost one wins. Among siblings, the later one
|
|
208
|
+
* wins. Returns `undefined` if no transaction in the tree supplied any metadata.
|
|
209
|
+
*/
|
|
210
|
+
export function flattenCustomMetadata(
|
|
211
|
+
tree: CustomMetadataTree | undefined,
|
|
212
|
+
): JsonCompatibleReadOnlyObject | undefined {
|
|
213
|
+
if (tree === undefined) {
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
let flattened: Record<string, JsonCompatibleReadOnly | undefined> | undefined;
|
|
217
|
+
const visit = (node: CustomMetadataTree): void => {
|
|
218
|
+
// Descendants first, so that a containing transaction's metadata wins on conflict.
|
|
219
|
+
for (const child of node.children) {
|
|
220
|
+
visit(child);
|
|
221
|
+
}
|
|
222
|
+
if (node.metadata !== undefined) {
|
|
223
|
+
flattened ??= {};
|
|
224
|
+
// `defineProperty` rather than assignment: assigning the valid JSON key "__proto__" would
|
|
225
|
+
// invoke the inherited setter and set the prototype instead of creating a property.
|
|
226
|
+
for (const key of Object.keys(node.metadata)) {
|
|
227
|
+
Object.defineProperty(flattened, key, {
|
|
228
|
+
value: node.metadata[key],
|
|
229
|
+
writable: true,
|
|
230
|
+
enumerable: true,
|
|
231
|
+
configurable: true,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
visit(tree);
|
|
237
|
+
return flattened;
|
|
169
238
|
}
|
|
170
239
|
|
|
171
240
|
/**
|
|
@@ -210,7 +279,7 @@ export interface LocalChangeMetadata extends CommitMetadata {
|
|
|
210
279
|
/**
|
|
211
280
|
* Returns a serializable object that encodes the change.
|
|
212
281
|
* @remarks This is only available for local changes.
|
|
213
|
-
* This change object can be {@link
|
|
282
|
+
* This change object can be {@link UntypedTreeViewAlpha.applyChange | applied to another view} in the same state as the one which generated it.
|
|
214
283
|
* The change object must be applied to a SharedTree with the same IdCompressor session ID as it was created from.
|
|
215
284
|
* @privateRemarks
|
|
216
285
|
* This is a `SerializedChange` from treeCheckout.ts.
|
|
@@ -473,11 +542,12 @@ export function mintCommit<TChange>(
|
|
|
473
542
|
parent: GraphCommit<TChange>,
|
|
474
543
|
commit: Omit<GraphCommit<TChange>, "parent">,
|
|
475
544
|
): GraphCommit<TChange> {
|
|
476
|
-
const { revision, change } = commit;
|
|
545
|
+
const { revision, change, customMetadata } = commit;
|
|
477
546
|
return {
|
|
478
547
|
revision,
|
|
479
548
|
change,
|
|
480
549
|
parent,
|
|
550
|
+
customMetadata,
|
|
481
551
|
};
|
|
482
552
|
}
|
|
483
553
|
|
package/src/core/rebase/utils.ts
CHANGED
package/src/core/revertible.ts
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type {
|
|
6
|
+
import type { JsonCompatibleReadOnlyObject } from "../util/index.js";
|
|
7
|
+
|
|
8
|
+
import type { UntypedTreeView } from "../simple-tree/index.js";
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Allows reversion of a change made to SharedTree.
|
|
@@ -21,6 +23,9 @@ export interface Revertible {
|
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* Reverts the associated change and disposes it.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Concurrent changes that are sequenced before the revert will not be overwritten by the revert if they affect different parts of the document.
|
|
24
29
|
*/
|
|
25
30
|
revert(): void;
|
|
26
31
|
/**
|
|
@@ -29,6 +34,9 @@ export interface Revertible {
|
|
|
29
34
|
* @param dispose - If true, the revertible will be disposed after being reverted.
|
|
30
35
|
* If false, the revertible will remain valid. This can be useful for scenarios where the revert may be dropped
|
|
31
36
|
* due to merge conflicts, and one wants to attempt reverting again.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* Concurrent changes that are sequenced before the revert will not be overwritten by the revert if they affect different parts of the document.
|
|
32
40
|
*/
|
|
33
41
|
revert(dispose: boolean): void;
|
|
34
42
|
|
|
@@ -38,6 +46,43 @@ export interface Revertible {
|
|
|
38
46
|
dispose(): void;
|
|
39
47
|
}
|
|
40
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Options for {@link RevertibleAlpha.(revert:3) | RevertibleAlpha.revert}.
|
|
51
|
+
*
|
|
52
|
+
* @sealed @alpha
|
|
53
|
+
*/
|
|
54
|
+
export interface RevertOptionsAlpha {
|
|
55
|
+
/**
|
|
56
|
+
* If true (the default), the revertible will be disposed after being reverted.
|
|
57
|
+
* If false, the revertible will remain valid. This can be useful for scenarios where the revert may be dropped
|
|
58
|
+
* due to merge conflicts, and one wants to attempt reverting again.
|
|
59
|
+
*/
|
|
60
|
+
readonly dispose?: boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Arbitrary, application-defined metadata to attach to the commit that the revert produces.
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
* See {@link RunTransactionParamsAlpha.customMetadata} for how this metadata is persisted and read back.
|
|
67
|
+
*/
|
|
68
|
+
readonly customMetadata?: JsonCompatibleReadOnlyObject;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Options for {@link UntypedTreeViewAlpha.revertTo}.
|
|
73
|
+
*
|
|
74
|
+
* @sealed @alpha
|
|
75
|
+
*/
|
|
76
|
+
export interface RevertToOptionsAlpha {
|
|
77
|
+
/**
|
|
78
|
+
* Arbitrary, application-defined metadata to attach to the commit that the revert produces.
|
|
79
|
+
*
|
|
80
|
+
* @remarks
|
|
81
|
+
* See {@link RunTransactionParamsAlpha.customMetadata} for how this metadata is persisted and read back.
|
|
82
|
+
*/
|
|
83
|
+
readonly customMetadata?: JsonCompatibleReadOnlyObject;
|
|
84
|
+
}
|
|
85
|
+
|
|
41
86
|
/**
|
|
42
87
|
* A {@link Revertible} with features that are not yet stable.
|
|
43
88
|
*
|
|
@@ -45,14 +90,30 @@ export interface Revertible {
|
|
|
45
90
|
*/
|
|
46
91
|
export interface RevertibleAlpha extends Revertible {
|
|
47
92
|
/**
|
|
48
|
-
*
|
|
93
|
+
* {@inheritDoc Revertible.(revert:1)}
|
|
94
|
+
*/
|
|
95
|
+
revert(): void;
|
|
96
|
+
/**
|
|
97
|
+
* {@inheritDoc Revertible.(revert:2)}
|
|
98
|
+
*/
|
|
99
|
+
revert(dispose: boolean): void;
|
|
100
|
+
/**
|
|
101
|
+
* Reverts the associated change according to the given options.
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* Concurrent changes that are sequenced before the revert will not be overwritten by the revert if they affect different parts of the document.
|
|
105
|
+
*/
|
|
106
|
+
revert(options: RevertOptionsAlpha): void;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Clones the {@link Revertible} to a target view.
|
|
49
110
|
*
|
|
50
|
-
* @param
|
|
51
|
-
* The target
|
|
111
|
+
* @param view - A target view to apply the revertible to.
|
|
112
|
+
* The target view must contain the same commit that this revertible is meant to revert, otherwise will throw an error.
|
|
52
113
|
* @returns A cloned revertible is independent of the original, meaning disposing of one will not affect the other,
|
|
53
|
-
* provided they do not belong to the same
|
|
114
|
+
* provided they do not belong to the same view. Both revertibles can be reverted independently.
|
|
54
115
|
*/
|
|
55
|
-
clone: (
|
|
116
|
+
clone: (view: UntypedTreeView) => RevertibleAlpha;
|
|
56
117
|
}
|
|
57
118
|
|
|
58
119
|
/**
|
package/src/entrypoints/alpha.ts
CHANGED
|
@@ -148,6 +148,7 @@ export {
|
|
|
148
148
|
UnannotateAllowedTypesList,
|
|
149
149
|
UnannotateAllowedTypesListUnsafe,
|
|
150
150
|
UnionToTuple,
|
|
151
|
+
UntypedTreeView,
|
|
151
152
|
VoidTransactionCallbackStatusBeta,
|
|
152
153
|
WithValue,
|
|
153
154
|
adaptEnum,
|
|
@@ -179,8 +180,10 @@ export {
|
|
|
179
180
|
CodecName,
|
|
180
181
|
CodecWriteOptions,
|
|
181
182
|
CommitOutcome,
|
|
183
|
+
CommitRevision,
|
|
182
184
|
Component,
|
|
183
185
|
CreateIndependentTreeAlphaOptions,
|
|
186
|
+
CustomMetadataTree,
|
|
184
187
|
DirtyTreeMap,
|
|
185
188
|
DirtyTreeStatus,
|
|
186
189
|
ErasedNode,
|
|
@@ -256,6 +259,8 @@ export {
|
|
|
256
259
|
RemoteChangeMetadata,
|
|
257
260
|
RevertibleAlpha,
|
|
258
261
|
RevertibleAlphaFactory,
|
|
262
|
+
RevertOptionsAlpha,
|
|
263
|
+
RevertToOptionsAlpha,
|
|
259
264
|
RunTransactionParamsAlpha,
|
|
260
265
|
SchemaFactoryAlpha,
|
|
261
266
|
SchemaStaticsAlpha,
|
|
@@ -284,7 +289,9 @@ export {
|
|
|
284
289
|
TreeAlpha,
|
|
285
290
|
TreeArrayNodeAlpha,
|
|
286
291
|
TreeBranchAlpha,
|
|
292
|
+
TreeBranchCommitMetadata,
|
|
287
293
|
TreeBranchEvents,
|
|
294
|
+
TreeBranchHistory,
|
|
288
295
|
TreeChangeEventsAlpha,
|
|
289
296
|
TreeCompressionStrategy,
|
|
290
297
|
TreeContextAlpha,
|
|
@@ -297,6 +304,7 @@ export {
|
|
|
297
304
|
TreeViewAlpha,
|
|
298
305
|
TreeViewConfigurationAlpha,
|
|
299
306
|
UnsafeUnknownSchema,
|
|
307
|
+
UntypedTreeViewAlpha,
|
|
300
308
|
ValueSchema,
|
|
301
309
|
VerboseTree,
|
|
302
310
|
VerboseTreeNode,
|
package/src/entrypoints/beta.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type TreeIndexNodes<TNode> = readonly [first: TNode, ...rest: TNode[]];
|
|
|
15
15
|
/**
|
|
16
16
|
* An index allows lookup content from a tree using keys.
|
|
17
17
|
* @remarks
|
|
18
|
-
* The index will be kept up to date with the {@link
|
|
18
|
+
* The index will be kept up to date with the {@link UntypedTreeViewAlpha} it is associated with.
|
|
19
19
|
* Keeping an index up to date incurs overhead.
|
|
20
20
|
* Therefore, indexes should only be created when needed and disposed when no longer needed.
|
|
21
21
|
* @privateRemarks
|
package/src/index.ts
CHANGED
|
@@ -18,10 +18,13 @@ export {
|
|
|
18
18
|
type RemoteChangeMetadata,
|
|
19
19
|
type ChangeMetadata,
|
|
20
20
|
type LabelTree,
|
|
21
|
+
type CustomMetadataTree,
|
|
21
22
|
type TransactionLabels,
|
|
22
23
|
type RevertibleFactory,
|
|
23
24
|
type RevertibleAlphaFactory,
|
|
24
25
|
type RevertibleAlpha,
|
|
26
|
+
type RevertOptionsAlpha,
|
|
27
|
+
type RevertToOptionsAlpha,
|
|
25
28
|
} from "./core/index.js";
|
|
26
29
|
|
|
27
30
|
import type {
|
|
@@ -91,6 +94,7 @@ export {
|
|
|
91
94
|
} from "./shared-tree/index.js";
|
|
92
95
|
|
|
93
96
|
export {
|
|
97
|
+
type CommitRevision,
|
|
94
98
|
TreeArrayNode,
|
|
95
99
|
type TreeArrayNodeAlpha,
|
|
96
100
|
type Unhydrated,
|
|
@@ -269,10 +273,14 @@ export {
|
|
|
269
273
|
type ReadonlyArrayNode,
|
|
270
274
|
type InsertableTreeNodeFromAllowedTypes,
|
|
271
275
|
type Input,
|
|
276
|
+
type UntypedTreeView,
|
|
272
277
|
type TreeBranch,
|
|
273
278
|
type TreeBranchAlpha,
|
|
279
|
+
type UntypedTreeViewAlpha,
|
|
274
280
|
type TreeBranchEvents,
|
|
275
281
|
asTreeViewAlpha,
|
|
282
|
+
type TreeBranchCommitMetadata,
|
|
283
|
+
type TreeBranchHistory,
|
|
276
284
|
type NodeSchemaOptions,
|
|
277
285
|
type NodeSchemaOptionsAlpha,
|
|
278
286
|
type NodeSchemaMetadata,
|
package/src/packageVersion.ts
CHANGED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
|
+
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
8
|
+
|
|
9
|
+
import type { GraphCommit, CustomMetadataTree } from "../core/index.js";
|
|
10
|
+
import { flattenCustomMetadata } from "../core/index.js";
|
|
11
|
+
import { BranchCommitCounter, type SharedTreeBranch } from "../shared-tree-core/index.js";
|
|
12
|
+
import type { TreeBranchCommitMetadata, TreeBranchHistory } from "../simple-tree/index.js";
|
|
13
|
+
import type { JsonCompatibleReadOnlyObject } from "../util/index.js";
|
|
14
|
+
|
|
15
|
+
import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
16
|
+
import type { SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A lazily constructed implementation of {@link TreeBranchCommitMetadata} that wraps a {@link GraphCommit}.
|
|
20
|
+
*/
|
|
21
|
+
class LazyTreeBranchCommitMetadata implements TreeBranchCommitMetadata {
|
|
22
|
+
public readonly revision: string;
|
|
23
|
+
private parentCache?: {
|
|
24
|
+
readonly prior: GraphCommit<SharedTreeChange>;
|
|
25
|
+
readonly cached: TreeBranchCommitMetadata;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
public constructor(
|
|
29
|
+
private readonly commit: GraphCommit<SharedTreeChange>,
|
|
30
|
+
private readonly idCompressor: IIdCompressor,
|
|
31
|
+
) {
|
|
32
|
+
assert(
|
|
33
|
+
commit.revision !== "root",
|
|
34
|
+
0xd34 /* Cannot construct metadata for the root commit */,
|
|
35
|
+
);
|
|
36
|
+
this.revision = idCompressor.decompress(commit.revision);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public get custom(): JsonCompatibleReadOnlyObject | undefined {
|
|
40
|
+
return flattenCustomMetadata(this.commit.customMetadata);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public get customTree(): CustomMetadataTree | undefined {
|
|
44
|
+
return this.commit.customMetadata;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public getParent(): TreeBranchCommitMetadata | undefined {
|
|
48
|
+
// The parent of the commit may change over time due to trunk trimming.
|
|
49
|
+
if (this.commit.parent !== this.parentCache?.prior) {
|
|
50
|
+
const { parent } = this.commit;
|
|
51
|
+
this.parentCache =
|
|
52
|
+
parent === undefined || parent.revision === "root"
|
|
53
|
+
? undefined
|
|
54
|
+
: {
|
|
55
|
+
prior: parent,
|
|
56
|
+
cached: new LazyTreeBranchCommitMetadata(parent, this.idCompressor),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return this.parentCache?.cached;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A default implementation of {@link TreeBranchHistory} that wraps a {@link SharedTreeBranch}.
|
|
65
|
+
*/
|
|
66
|
+
export class DefaultTreeBranchHistory implements TreeBranchHistory {
|
|
67
|
+
private readonly commitCounter: BranchCommitCounter<
|
|
68
|
+
SharedTreeEditBuilder,
|
|
69
|
+
SharedTreeChange,
|
|
70
|
+
unknown
|
|
71
|
+
>;
|
|
72
|
+
|
|
73
|
+
public constructor(
|
|
74
|
+
private readonly branch: SharedTreeBranch<
|
|
75
|
+
SharedTreeEditBuilder,
|
|
76
|
+
SharedTreeChange,
|
|
77
|
+
unknown
|
|
78
|
+
>,
|
|
79
|
+
private readonly idCompressor: IIdCompressor,
|
|
80
|
+
) {
|
|
81
|
+
this.commitCounter = new BranchCommitCounter(branch);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public dispose(): void {
|
|
85
|
+
this.commitCounter.dispose();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public get length(): number {
|
|
89
|
+
return this.commitCounter.count;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public getHead(): TreeBranchCommitMetadata | undefined {
|
|
93
|
+
const head = this.branch.getHead();
|
|
94
|
+
if (head.revision === "root") {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
return new LazyTreeBranchCommitMetadata(head, this.idCompressor);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
13
13
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
14
14
|
|
|
15
|
-
import { anchorSlot, rootFieldKey } from "../core/index.js";
|
|
15
|
+
import { anchorSlot, rootFieldKey, type RevertToOptionsAlpha } from "../core/index.js";
|
|
16
16
|
import {
|
|
17
17
|
type NodeIdentifierManager,
|
|
18
18
|
defaultSchemaPolicy,
|
|
@@ -58,7 +58,8 @@ import {
|
|
|
58
58
|
TreeViewConfigurationAlpha,
|
|
59
59
|
toInitialSchema,
|
|
60
60
|
toUpgradeSchema,
|
|
61
|
-
type
|
|
61
|
+
type TreeBranchHistory,
|
|
62
|
+
type UntypedTreeViewAlpha,
|
|
62
63
|
type TreeSchema,
|
|
63
64
|
} from "../simple-tree/index.js";
|
|
64
65
|
import {
|
|
@@ -180,7 +181,11 @@ export class SchematizingSimpleTreeView<
|
|
|
180
181
|
);
|
|
181
182
|
}
|
|
182
183
|
|
|
183
|
-
public isBranch(): this is
|
|
184
|
+
public isBranch(): this is UntypedTreeViewAlpha {
|
|
185
|
+
return this.isView();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
public isView(): this is UntypedTreeViewAlpha {
|
|
184
189
|
return true;
|
|
185
190
|
}
|
|
186
191
|
|
|
@@ -542,28 +547,40 @@ export class SchematizingSimpleTreeView<
|
|
|
542
547
|
|
|
543
548
|
// #region Branching
|
|
544
549
|
|
|
545
|
-
public fork(): ReturnType<
|
|
550
|
+
public fork(): ReturnType<UntypedTreeViewAlpha["fork"]> &
|
|
546
551
|
SchematizingSimpleTreeView<TRootSchema> {
|
|
547
552
|
return this.checkout.fork().viewWith(this.config);
|
|
548
553
|
}
|
|
549
554
|
|
|
550
|
-
public
|
|
555
|
+
public rewindTo(revision: string): void {
|
|
556
|
+
this.checkout.rewindTo(revision);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
public revertTo(revision: string, options?: RevertToOptionsAlpha): void {
|
|
560
|
+
this.checkout.revertTo(revision, options);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
public merge(context: UntypedTreeViewAlpha, disposeMerged = true): void {
|
|
551
564
|
this.checkout.merge(context, disposeMerged);
|
|
552
565
|
}
|
|
553
566
|
|
|
554
|
-
public rebaseOnto(context:
|
|
567
|
+
public rebaseOnto(context: UntypedTreeViewAlpha): void {
|
|
555
568
|
this.checkout.rebaseOnto(context);
|
|
556
569
|
}
|
|
557
570
|
|
|
558
|
-
public isMissingEditsFrom(context:
|
|
571
|
+
public isMissingEditsFrom(context: UntypedTreeViewAlpha): boolean {
|
|
559
572
|
return this.checkout.isMissingEditsFrom(context);
|
|
560
573
|
}
|
|
561
574
|
|
|
562
575
|
public computeNetChangeIfRebasedOnto(
|
|
563
|
-
context:
|
|
576
|
+
context: UntypedTreeViewAlpha,
|
|
564
577
|
): JsonCompatibleReadOnly | undefined {
|
|
565
578
|
return this.checkout.computeNetChangeIfRebasedOnto(context);
|
|
566
579
|
}
|
|
567
580
|
|
|
568
581
|
// #endregion Branching
|
|
582
|
+
|
|
583
|
+
public get branchHistory(): TreeBranchHistory {
|
|
584
|
+
return this.checkout.branchHistory;
|
|
585
|
+
}
|
|
569
586
|
}
|