@fluidframework/tree 2.113.0-411909 → 2.114.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 +272 -0
- package/api-report/tree.alpha.api.md +19 -0
- package/dist/core/change-family/changeFamily.d.ts +15 -4
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/change-family/editBuilder.d.ts +2 -3
- package/dist/core/change-family/editBuilder.d.ts.map +1 -1
- package/dist/core/change-family/editBuilder.js +1 -2
- package/dist/core/change-family/editBuilder.js.map +1 -1
- package/dist/core/change-family/index.d.ts +1 -1
- package/dist/core/change-family/index.d.ts.map +1 -1
- package/dist/core/change-family/index.js.map +1 -1
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/tree/delta.d.ts +62 -16
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +7 -13
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +32 -46
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/index.d.ts +1 -0
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +2 -4
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +2 -2
- package/dist/core/tree/visitorUtils.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 +5 -2
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +10 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
- package/dist/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
- package/dist/feature-libraries/comparison-forest/comparisonForest.js +98 -0
- package/dist/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
- package/dist/feature-libraries/comparison-forest/index.d.ts +6 -0
- package/dist/feature-libraries/comparison-forest/index.d.ts.map +1 -0
- package/dist/feature-libraries/comparison-forest/index.js +10 -0
- package/dist/feature-libraries/comparison-forest/index.js.map +1 -0
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.js +3 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +18 -6
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -3
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +4 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +77 -72
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +12 -0
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/invert.d.ts +15 -0
- package/dist/feature-libraries/modular-schema/invert.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/invert.js +159 -0
- package/dist/feature-libraries/modular-schema/invert.js.map +1 -0
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +53 -406
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
- package/dist/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeUtils.js +205 -0
- package/dist/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
- package/dist/feature-libraries/modular-schema/prune.d.ts +10 -0
- package/dist/feature-libraries/modular-schema/prune.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/prune.js +49 -0
- package/dist/feature-libraries/modular-schema/prune.js.map +1 -0
- package/dist/feature-libraries/optional-field/optionalField.js +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.d.ts +15 -0
- package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js +64 -1
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/serializedChange.d.ts +2 -2
- package/dist/shared-tree/serializedChange.d.ts.map +1 -1
- package/dist/shared-tree/serializedChange.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +6 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +8 -6
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +57 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/transactionMinimize.d.ts.map +1 -1
- package/dist/shared-tree/transactionMinimize.js +2 -2
- package/dist/shared-tree/transactionMinimize.js.map +1 -1
- package/dist/shared-tree/transactionPostProcessor.d.ts +2 -1
- package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -1
- package/dist/shared-tree/transactionPostProcessor.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +8 -7
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +1 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +23 -9
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +7 -0
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +4 -4
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +2 -0
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -14
- 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 +11 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
- 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 +4 -11
- 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 +4 -4
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +0 -1
- package/dist/shared-tree-core/editManagerSummarizer.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.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +8 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +5 -5
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +10 -10
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +6 -3
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.js +15 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +9 -0
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/text/textDomain.d.ts +12 -0
- package/dist/text/textDomain.d.ts.map +1 -1
- package/dist/text/textDomain.js +37 -16
- package/dist/text/textDomain.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +155 -61
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +147 -71
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/text/textDomainFormattedDefault.d.ts +37 -14
- package/dist/text/textDomainFormattedDefault.d.ts.map +1 -1
- package/dist/text/textDomainFormattedDefault.js +13 -5
- package/dist/text/textDomainFormattedDefault.js.map +1 -1
- package/dist/treeDataStore.d.ts +49 -0
- package/dist/treeDataStore.d.ts.map +1 -0
- package/dist/treeDataStore.js +57 -0
- package/dist/treeDataStore.js.map +1 -0
- package/dist/treeFactory.d.ts +8 -3
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +6 -1
- package/dist/treeFactory.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +15 -4
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/change-family/editBuilder.d.ts +2 -3
- package/lib/core/change-family/editBuilder.d.ts.map +1 -1
- package/lib/core/change-family/editBuilder.js +1 -2
- package/lib/core/change-family/editBuilder.js.map +1 -1
- package/lib/core/change-family/index.d.ts +1 -1
- package/lib/core/change-family/index.d.ts.map +1 -1
- package/lib/core/change-family/index.js.map +1 -1
- package/lib/core/index.d.ts +3 -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/tree/delta.d.ts +62 -16
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +7 -13
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +7 -21
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/index.d.ts +1 -0
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +2 -4
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +2 -2
- package/lib/core/tree/visitorUtils.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 +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +10 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts +51 -0
- package/lib/feature-libraries/comparison-forest/comparisonForest.d.ts.map +1 -0
- package/lib/feature-libraries/comparison-forest/comparisonForest.js +94 -0
- package/lib/feature-libraries/comparison-forest/comparisonForest.js.map +1 -0
- package/lib/feature-libraries/comparison-forest/index.d.ts +6 -0
- package/lib/feature-libraries/comparison-forest/index.d.ts.map +1 -0
- package/lib/feature-libraries/comparison-forest/index.js +6 -0
- package/lib/feature-libraries/comparison-forest/index.js.map +1 -0
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +8 -6
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -3
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.js +3 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +6 -3
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +16 -4
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -3
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -3
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +4 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +12 -0
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +9 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/invert.d.ts +15 -0
- package/lib/feature-libraries/modular-schema/invert.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/invert.js +155 -0
- package/lib/feature-libraries/modular-schema/invert.js.map +1 -0
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +3 -4
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js +2 -2
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +9 -9
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -22
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +16 -367
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts +61 -0
- package/lib/feature-libraries/modular-schema/modularChangeUtils.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeUtils.js +192 -0
- package/lib/feature-libraries/modular-schema/modularChangeUtils.js.map +1 -0
- package/lib/feature-libraries/modular-schema/prune.d.ts +10 -0
- package/lib/feature-libraries/modular-schema/prune.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/prune.js +45 -0
- package/lib/feature-libraries/modular-schema/prune.js.map +1 -0
- package/lib/feature-libraries/optional-field/optionalField.js +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +2 -2
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.d.ts +15 -0
- package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
- package/lib/feature-libraries/treeTextCursor.js +62 -1
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/serializedChange.d.ts +2 -2
- package/lib/shared-tree/serializedChange.d.ts.map +1 -1
- package/lib/shared-tree/serializedChange.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +6 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +9 -7
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +2 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +41 -4
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +55 -0
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/transactionMinimize.d.ts.map +1 -1
- package/lib/shared-tree/transactionMinimize.js +3 -3
- package/lib/shared-tree/transactionMinimize.js.map +1 -1
- package/lib/shared-tree/transactionPostProcessor.d.ts +2 -1
- package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -1
- package/lib/shared-tree/transactionPostProcessor.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +8 -7
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +1 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +23 -9
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +7 -0
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +4 -4
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +2 -0
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -14
- 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 +11 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +4 -11
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +4 -11
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +4 -4
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +0 -1
- package/lib/shared-tree-core/editManagerSummarizer.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.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +8 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +5 -5
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +10 -10
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +6 -3
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts +15 -0
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.js +15 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +21 -2
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +9 -0
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/text/textDomain.d.ts +12 -0
- package/lib/text/textDomain.d.ts.map +1 -1
- package/lib/text/textDomain.js +34 -15
- package/lib/text/textDomain.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +155 -61
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +148 -73
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/text/textDomainFormattedDefault.d.ts +37 -14
- package/lib/text/textDomainFormattedDefault.d.ts.map +1 -1
- package/lib/text/textDomainFormattedDefault.js +14 -6
- package/lib/text/textDomainFormattedDefault.js.map +1 -1
- package/lib/treeDataStore.d.ts +49 -0
- package/lib/treeDataStore.d.ts.map +1 -0
- package/lib/treeDataStore.js +52 -0
- package/lib/treeDataStore.js.map +1 -0
- package/lib/treeFactory.d.ts +8 -3
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +5 -0
- package/lib/treeFactory.js.map +1 -1
- package/package.json +25 -24
- package/src/core/change-family/changeFamily.ts +32 -4
- package/src/core/change-family/editBuilder.ts +1 -2
- package/src/core/change-family/index.ts +2 -0
- package/src/core/index.ts +9 -6
- package/src/core/tree/delta.ts +62 -16
- package/src/core/tree/detachedFieldIndex.ts +7 -38
- package/src/core/tree/index.ts +2 -0
- package/src/core/tree/visitorUtils.ts +3 -17
- package/src/entrypoints/alpha.ts +7 -3
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +11 -1
- package/src/feature-libraries/comparison-forest/comparisonForest.ts +140 -0
- package/src/feature-libraries/comparison-forest/index.ts +6 -0
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +20 -6
- package/src/feature-libraries/default-schema/index.ts +1 -0
- package/src/feature-libraries/default-schema/noChangeCodecs.ts +11 -3
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +33 -5
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -3
- package/src/feature-libraries/index.ts +5 -0
- package/src/feature-libraries/mitigatedChangeFamily.ts +21 -3
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +10 -1
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +9 -4
- package/src/feature-libraries/modular-schema/index.ts +1 -0
- package/src/feature-libraries/modular-schema/invert.ts +338 -0
- package/src/feature-libraries/modular-schema/minimizeModularChange.ts +3 -5
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +16 -13
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +3 -1
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +45 -644
- package/src/feature-libraries/modular-schema/modularChangeUtils.ts +340 -0
- package/src/feature-libraries/modular-schema/prune.ts +69 -0
- package/src/feature-libraries/optional-field/optionalField.ts +1 -1
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -2
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +6 -3
- package/src/feature-libraries/treeTextCursor.ts +66 -1
- package/src/index.ts +4 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/serializedChange.ts +2 -2
- package/src/shared-tree/sharedTree.ts +34 -14
- package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -3
- package/src/shared-tree/sharedTreeChangeFamily.ts +77 -2
- package/src/shared-tree/transactionMinimize.ts +7 -3
- package/src/shared-tree/transactionPostProcessor.ts +5 -1
- package/src/shared-tree/treeCheckout.ts +55 -16
- package/src/shared-tree-core/branch.ts +40 -12
- package/src/shared-tree-core/editManager.ts +46 -25
- package/src/shared-tree-core/editManagerCodecs.ts +9 -21
- package/src/shared-tree-core/editManagerCodecsCommons.ts +14 -2
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +18 -21
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +18 -20
- package/src/shared-tree-core/editManagerSummarizer.ts +9 -6
- package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -2
- package/src/shared-tree-core/messageCodecs.ts +12 -2
- package/src/shared-tree-core/sharedTreeCore.ts +15 -6
- package/src/shared-tree-core/transaction.ts +47 -25
- package/src/simple-tree/api/eraseSchemaDetails.ts +15 -0
- package/src/simple-tree/node-kinds/array/arrayNode.ts +21 -2
- package/src/simple-tree/node-kinds/map/mapNode.ts +24 -2
- package/src/text/textDomain.ts +29 -6
- package/src/text/textDomainFormatted.ts +351 -134
- package/src/text/textDomainFormattedDefault.ts +25 -16
- package/src/treeDataStore.ts +125 -0
- package/src/treeFactory.ts +11 -3
|
@@ -74,11 +74,14 @@ const maxRebaseStatsAggregationCount = 1000;
|
|
|
74
74
|
export class EditManager<
|
|
75
75
|
TEditor extends ChangeFamilyEditor,
|
|
76
76
|
TChangeset,
|
|
77
|
-
|
|
77
|
+
TChangeProcessingContext = never,
|
|
78
78
|
> {
|
|
79
79
|
private readonly _events = createEmitter<BranchTrimmingEvents>();
|
|
80
80
|
|
|
81
|
-
private readonly sharedBranches = new Map<
|
|
81
|
+
private readonly sharedBranches = new Map<
|
|
82
|
+
BranchId,
|
|
83
|
+
SharedBranch<TEditor, TChangeset, TChangeProcessingContext>
|
|
84
|
+
>();
|
|
82
85
|
|
|
83
86
|
/**
|
|
84
87
|
* Tracks where on the trunk of the main branch all registered branches are based.
|
|
@@ -90,7 +93,7 @@ export class EditManager<
|
|
|
90
93
|
*/
|
|
91
94
|
private readonly trunkBranches = new BTree<
|
|
92
95
|
SequenceId,
|
|
93
|
-
Set<SharedTreeBranch<TEditor, TChangeset>>
|
|
96
|
+
Set<SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>>
|
|
94
97
|
>(undefined, sequenceIdComparator);
|
|
95
98
|
|
|
96
99
|
/**
|
|
@@ -121,7 +124,7 @@ export class EditManager<
|
|
|
121
124
|
* @param retainHistory - when `true`, trunk commits are never trimmed/evicted.
|
|
122
125
|
*/
|
|
123
126
|
public constructor(
|
|
124
|
-
public readonly changeFamily:
|
|
127
|
+
public readonly changeFamily: ChangeFamily<TEditor, TChangeset, TChangeProcessingContext>,
|
|
125
128
|
public readonly localSessionId: SessionId,
|
|
126
129
|
private readonly mintRevisionTag: () => RevisionTag,
|
|
127
130
|
private readonly onSharedBranchCreated?: (branchId: BranchId) => void,
|
|
@@ -155,7 +158,9 @@ export class EditManager<
|
|
|
155
158
|
this.createAndAddSharedBranch("main", "main", undefined, undefined, mainTrunk);
|
|
156
159
|
}
|
|
157
160
|
|
|
158
|
-
public getLocalBranch(
|
|
161
|
+
public getLocalBranch(
|
|
162
|
+
branchId: BranchId,
|
|
163
|
+
): SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext> {
|
|
159
164
|
return this.getSharedBranch(branchId).localBranch;
|
|
160
165
|
}
|
|
161
166
|
|
|
@@ -163,7 +168,9 @@ export class EditManager<
|
|
|
163
168
|
return this.getSharedBranch(branchId).branchName;
|
|
164
169
|
}
|
|
165
170
|
|
|
166
|
-
private getSharedBranch(
|
|
171
|
+
private getSharedBranch(
|
|
172
|
+
branchId: BranchId,
|
|
173
|
+
): SharedBranch<TEditor, TChangeset, TChangeProcessingContext> {
|
|
167
174
|
const branch = this.sharedBranches.get(branchId);
|
|
168
175
|
if (branch === undefined) {
|
|
169
176
|
throw new UsageError("No shared branch with such ID");
|
|
@@ -180,7 +187,9 @@ export class EditManager<
|
|
|
180
187
|
* TODO#AB6925: Maintain the divergence point between each branch and the trunk so that we don't have to recompute
|
|
181
188
|
* it so often.
|
|
182
189
|
*/
|
|
183
|
-
private registerBranch(
|
|
190
|
+
private registerBranch(
|
|
191
|
+
branch: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
|
|
192
|
+
): void {
|
|
184
193
|
this.trackBranch(branch);
|
|
185
194
|
// Whenever the branch is rebased, update our record of its base trunk commit
|
|
186
195
|
const offBeforeRebase = branch.events.on("beforeChange", (args) => {
|
|
@@ -204,7 +213,9 @@ export class EditManager<
|
|
|
204
213
|
});
|
|
205
214
|
}
|
|
206
215
|
|
|
207
|
-
private trackBranch(
|
|
216
|
+
private trackBranch(
|
|
217
|
+
b: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
|
|
218
|
+
): void {
|
|
208
219
|
const main = this.getSharedBranch("main");
|
|
209
220
|
const trunkCommit =
|
|
210
221
|
findCommonAncestor(main.trunk.getHead(), b.getHead()) ??
|
|
@@ -216,7 +227,9 @@ export class EditManager<
|
|
|
216
227
|
branches.add(b);
|
|
217
228
|
}
|
|
218
229
|
|
|
219
|
-
private untrackBranch(
|
|
230
|
+
private untrackBranch(
|
|
231
|
+
b: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
|
|
232
|
+
): void {
|
|
220
233
|
const main = this.getSharedBranch("main");
|
|
221
234
|
const trunkCommit =
|
|
222
235
|
findCommonAncestor(main.trunk.getHead(), b.getHead()) ??
|
|
@@ -498,9 +511,9 @@ export class EditManager<
|
|
|
498
511
|
branchId: BranchId,
|
|
499
512
|
branchName: string | undefined,
|
|
500
513
|
sessionId: SessionId | undefined,
|
|
501
|
-
parent: SharedBranch<TEditor, TChangeset> | undefined,
|
|
502
|
-
branch: SharedTreeBranch<TEditor, TChangeset>,
|
|
503
|
-
): SharedBranch<TEditor, TChangeset> {
|
|
514
|
+
parent: SharedBranch<TEditor, TChangeset, TChangeProcessingContext> | undefined,
|
|
515
|
+
branch: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
|
|
516
|
+
): SharedBranch<TEditor, TChangeset, TChangeProcessingContext> {
|
|
504
517
|
const sharedBranch = this.createSharedBranch(
|
|
505
518
|
branchId,
|
|
506
519
|
branchName,
|
|
@@ -514,7 +527,7 @@ export class EditManager<
|
|
|
514
527
|
|
|
515
528
|
private addSharedBranch(
|
|
516
529
|
branchId: BranchId,
|
|
517
|
-
branch: SharedBranch<TEditor, TChangeset>,
|
|
530
|
+
branch: SharedBranch<TEditor, TChangeset, TChangeProcessingContext>,
|
|
518
531
|
): void {
|
|
519
532
|
assert(
|
|
520
533
|
!this.sharedBranches.has(branchId),
|
|
@@ -537,9 +550,9 @@ export class EditManager<
|
|
|
537
550
|
branchId: BranchId,
|
|
538
551
|
branchName: string | undefined,
|
|
539
552
|
sessionId: SessionId | undefined,
|
|
540
|
-
parent: SharedBranch<TEditor, TChangeset> | undefined,
|
|
541
|
-
branch: SharedTreeBranch<TEditor, TChangeset>,
|
|
542
|
-
): SharedBranch<TEditor, TChangeset> {
|
|
553
|
+
parent: SharedBranch<TEditor, TChangeset, TChangeProcessingContext> | undefined,
|
|
554
|
+
branch: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
|
|
555
|
+
): SharedBranch<TEditor, TChangeset, TChangeProcessingContext> {
|
|
543
556
|
const sharedBranch = new SharedBranch(
|
|
544
557
|
parent,
|
|
545
558
|
branch,
|
|
@@ -587,6 +600,7 @@ export class EditManager<
|
|
|
587
600
|
sequenceId: SequenceId,
|
|
588
601
|
previousSequenceId: SequenceId,
|
|
589
602
|
): void => {
|
|
603
|
+
branch.localBranch.commitWasSequenced(commit);
|
|
590
604
|
// Next, we need to update the sequence IDs that our local branches (user's branches, not peer branches) are associated with.
|
|
591
605
|
// In particular, if a local branch is based on the previous trunk head (the branch's first ancestor in the trunk is the commit that was the head before we pushed the new commit)
|
|
592
606
|
// and also branches off of the local branch (it has an ancestor that is part of the local branch), it needs to have its sequence number advanced to be that of the new trunk head.
|
|
@@ -604,6 +618,7 @@ export class EditManager<
|
|
|
604
618
|
if (findAncestor(forkedBranch.getHead(), (c) => c === commit) !== undefined) {
|
|
605
619
|
newBranches.add(forkedBranch);
|
|
606
620
|
currentBranches.delete(forkedBranch);
|
|
621
|
+
forkedBranch.commitWasSequenced(commit);
|
|
607
622
|
}
|
|
608
623
|
}
|
|
609
624
|
// Clean up our trunk branches map by removing any empty sets.
|
|
@@ -675,19 +690,21 @@ function getPathFromBase<TCommit extends { parent?: TCommit }>(
|
|
|
675
690
|
return path;
|
|
676
691
|
}
|
|
677
692
|
|
|
678
|
-
class SharedBranch<TEditor extends ChangeFamilyEditor, TChangeset> {
|
|
693
|
+
class SharedBranch<TEditor extends ChangeFamilyEditor, TChangeset, TChangeProcessingContext> {
|
|
679
694
|
/**
|
|
680
695
|
* This branch holds the changes made by this client which have not yet been confirmed as sequenced changes.
|
|
681
696
|
*/
|
|
682
|
-
public readonly localBranch: SharedTreeBranch<TEditor, TChangeset>;
|
|
697
|
+
public readonly localBranch: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>;
|
|
683
698
|
|
|
684
699
|
/**
|
|
685
700
|
* Branches are maintained to represent the local change list that the issuing client had
|
|
686
701
|
* at the time of submitting the latest known edit on the branch.
|
|
687
702
|
* This means the head commit of each branch is always in its original (non-rebased) form.
|
|
688
703
|
*/
|
|
689
|
-
private readonly peerLocalBranches: Map<
|
|
690
|
-
|
|
704
|
+
private readonly peerLocalBranches: Map<
|
|
705
|
+
SessionId,
|
|
706
|
+
SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>
|
|
707
|
+
> = new Map();
|
|
691
708
|
|
|
692
709
|
/**
|
|
693
710
|
* A map from a sequence id to the commit which has that sequence id.
|
|
@@ -714,13 +731,15 @@ class SharedBranch<TEditor extends ChangeFamilyEditor, TChangeset> {
|
|
|
714
731
|
>();
|
|
715
732
|
|
|
716
733
|
public constructor(
|
|
717
|
-
public readonly parentBranch:
|
|
718
|
-
|
|
734
|
+
public readonly parentBranch:
|
|
735
|
+
| SharedBranch<TEditor, TChangeset, TChangeProcessingContext>
|
|
736
|
+
| undefined,
|
|
737
|
+
public readonly trunk: SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext>,
|
|
719
738
|
private readonly id: BranchId,
|
|
720
739
|
public readonly branchName: string | undefined,
|
|
721
740
|
private readonly sessionId: SessionId | undefined,
|
|
722
741
|
baseCommitSequenceId: SequenceId,
|
|
723
|
-
private readonly changeFamily: ChangeFamily<TEditor, TChangeset>,
|
|
742
|
+
private readonly changeFamily: ChangeFamily<TEditor, TChangeset, TChangeProcessingContext>,
|
|
724
743
|
private readonly mintRevisionTag: () => RevisionTag,
|
|
725
744
|
branchTrimmer: Listenable<BranchTrimmingEvents>,
|
|
726
745
|
telemetryEventBatcher: TelemetryEventBatcher<keyof RebaseStatsWithDuration> | undefined,
|
|
@@ -837,7 +856,7 @@ class SharedBranch<TEditor extends ChangeFamilyEditor, TChangeset> {
|
|
|
837
856
|
public rebasePeer(
|
|
838
857
|
sessionId: SessionId,
|
|
839
858
|
referenceSequenceNumber: SeqNumber,
|
|
840
|
-
): SharedTreeBranch<TEditor, TChangeset> {
|
|
859
|
+
): SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext> {
|
|
841
860
|
const [, baseRevisionInTrunk] = this.getClosestTrunkCommit(referenceSequenceNumber);
|
|
842
861
|
const peerLocalBranch = getOrCreate(
|
|
843
862
|
this.peerLocalBranches,
|
|
@@ -848,7 +867,9 @@ class SharedBranch<TEditor extends ChangeFamilyEditor, TChangeset> {
|
|
|
848
867
|
return peerLocalBranch;
|
|
849
868
|
}
|
|
850
869
|
|
|
851
|
-
public getPeerBranchOrTrunk(
|
|
870
|
+
public getPeerBranchOrTrunk(
|
|
871
|
+
sessionId: SessionId,
|
|
872
|
+
): SharedTreeBranch<TEditor, TChangeset, TChangeProcessingContext> {
|
|
852
873
|
return this.peerLocalBranches.get(sessionId) ?? this.trunk;
|
|
853
874
|
}
|
|
854
875
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
6
|
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
8
7
|
import { lowestMinVersionForCollab } from "@fluidframework/runtime-utils/internal";
|
|
9
8
|
|
|
@@ -18,30 +17,17 @@ import {
|
|
|
18
17
|
type IJsonCodec,
|
|
19
18
|
makeDiscontinuedCodecAndSchema,
|
|
20
19
|
} from "../codec/index.js";
|
|
21
|
-
import type {
|
|
22
|
-
ChangeEncodingContext,
|
|
23
|
-
EncodedRevisionTag,
|
|
24
|
-
RevisionTag,
|
|
25
|
-
SchemaAndPolicy,
|
|
26
|
-
} from "../core/index.js";
|
|
27
|
-
import type { IdentifierHealingConfig } from "../util/index.js";
|
|
20
|
+
import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../core/index.js";
|
|
28
21
|
|
|
29
22
|
import type { SummaryData } from "./editManager.js";
|
|
23
|
+
import type {
|
|
24
|
+
EditManagerDecodingContext,
|
|
25
|
+
EditManagerEncodingContext,
|
|
26
|
+
} from "./editManagerCodecsCommons.js";
|
|
30
27
|
import { makeV1toV4andV6CodecWithVersion } from "./editManagerCodecsV1toV4.js";
|
|
31
28
|
import { makeSharedBranchesCodecWithVersion } from "./editManagerCodecsVSharedBranches.js";
|
|
32
29
|
import { EditManagerFormatVersion } from "./editManagerFormatCommons.js";
|
|
33
30
|
|
|
34
|
-
/**
|
|
35
|
-
* Context required for encoding/decoding the {@link EditManager}'s {@link SummaryData}.
|
|
36
|
-
*/
|
|
37
|
-
export interface EditManagerEncodingContext {
|
|
38
|
-
idCompressor: IIdCompressor;
|
|
39
|
-
readonly schema?: SchemaAndPolicy;
|
|
40
|
-
readonly isSummary: boolean;
|
|
41
|
-
/** See {@link IdentifierHealingConfig}. */
|
|
42
|
-
readonly healing?: IdentifierHealingConfig;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
31
|
/**
|
|
46
32
|
* Codec name used to identify the {@link EditManager} codec, see {@link makeEditManagerCodecBuilder}.
|
|
47
33
|
*/
|
|
@@ -72,14 +58,16 @@ export function makeEditManagerCodecBuilder<TChangeset>(): VersionDispatchingCod
|
|
|
72
58
|
SummaryData<TChangeset>,
|
|
73
59
|
EditManagerEncodingContext,
|
|
74
60
|
EditManagerFormatVersion,
|
|
75
|
-
typeof editManagerCodecName
|
|
61
|
+
typeof editManagerCodecName,
|
|
62
|
+
EditManagerDecodingContext
|
|
76
63
|
> {
|
|
77
64
|
// See EditManagerFormatVersion and its members for documentation on what changed in each version.
|
|
78
65
|
const versions: CodecVersion<
|
|
79
66
|
SummaryData<TChangeset>,
|
|
80
67
|
EditManagerEncodingContext,
|
|
81
68
|
EditManagerFormatVersion,
|
|
82
|
-
EditManagerCodecOptions<TChangeset
|
|
69
|
+
EditManagerCodecOptions<TChangeset>,
|
|
70
|
+
EditManagerDecodingContext
|
|
83
71
|
>[] = [
|
|
84
72
|
makeDiscontinuedCodecAndSchema(EditManagerFormatVersion.v1, "2.73.0"),
|
|
85
73
|
makeDiscontinuedCodecAndSchema(EditManagerFormatVersion.v2, "2.73.0"),
|
|
@@ -9,6 +9,7 @@ import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
|
|
|
9
9
|
import type { IJsonCodec } from "../codec/index.js";
|
|
10
10
|
import type {
|
|
11
11
|
ChangeEncodingContext,
|
|
12
|
+
ChangeDecodingContext,
|
|
12
13
|
EncodedRevisionTag,
|
|
13
14
|
RevisionTag,
|
|
14
15
|
SchemaAndPolicy,
|
|
@@ -39,6 +40,17 @@ export interface EditManagerEncodingContext {
|
|
|
39
40
|
* but it is carried explicitly so downstream codecs can read it.
|
|
40
41
|
*/
|
|
41
42
|
readonly isSummary: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Context required for decoding the {@link EditManager}'s {@link SummaryData}.
|
|
47
|
+
* @remarks
|
|
48
|
+
* Unlike {@link EditManagerEncodingContext}, this carries {@link IdentifierHealingConfig} (used only
|
|
49
|
+
* on decode) and omits `schema` (only consulted when encoding).
|
|
50
|
+
*/
|
|
51
|
+
export interface EditManagerDecodingContext {
|
|
52
|
+
readonly idCompressor: IIdCompressor;
|
|
53
|
+
readonly isSummary: boolean;
|
|
42
54
|
/** See {@link IdentifierHealingConfig}. */
|
|
43
55
|
readonly healing?: IdentifierHealingConfig;
|
|
44
56
|
}
|
|
@@ -87,7 +99,7 @@ function decodeCommit<TChangeset, T extends EncodedCommit<JsonCompatibleReadOnly
|
|
|
87
99
|
ChangeEncodingContext
|
|
88
100
|
>,
|
|
89
101
|
commit: T,
|
|
90
|
-
context:
|
|
102
|
+
context: ChangeDecodingContext,
|
|
91
103
|
) {
|
|
92
104
|
const revision = revisionTagCodec.decode(commit.revision, {
|
|
93
105
|
originatorId: commit.sessionId,
|
|
@@ -192,7 +204,7 @@ export function decodeSharedBranch<TChangeset>(
|
|
|
192
204
|
ChangeEncodingContext
|
|
193
205
|
>,
|
|
194
206
|
json: EncodedSharedBranch<TChangeset>,
|
|
195
|
-
context:
|
|
207
|
+
context: EditManagerDecodingContext,
|
|
196
208
|
originatorId: SessionId | undefined,
|
|
197
209
|
): SharedBranchSummaryData<TChangeset> {
|
|
198
210
|
// TODO: sort out EncodedCommit vs Commit, and make this type check without type assertion.
|
|
@@ -3,34 +3,23 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
|
-
|
|
8
6
|
import type { CodecAndSchema, IJsonCodec, Versioned } from "../codec/index.js";
|
|
9
|
-
import type {
|
|
10
|
-
ChangeEncodingContext,
|
|
11
|
-
EncodedRevisionTag,
|
|
12
|
-
RevisionTag,
|
|
13
|
-
SchemaAndPolicy,
|
|
14
|
-
} from "../core/index.js";
|
|
7
|
+
import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../core/index.js";
|
|
15
8
|
import {
|
|
16
|
-
type IdentifierHealingConfig,
|
|
17
9
|
type JsonCompatibleReadOnly,
|
|
18
10
|
type JsonCompatibleReadOnlyObject,
|
|
19
11
|
JsonCompatibleReadOnlySchema,
|
|
20
12
|
} from "../util/index.js";
|
|
21
13
|
|
|
22
14
|
import type { SummaryData } from "./editManager.js";
|
|
23
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
decodeSharedBranch,
|
|
17
|
+
encodeSharedBranch,
|
|
18
|
+
type EditManagerDecodingContext,
|
|
19
|
+
type EditManagerEncodingContext,
|
|
20
|
+
} from "./editManagerCodecsCommons.js";
|
|
24
21
|
import { EncodedEditManager } from "./editManagerFormatV1toV4.js";
|
|
25
22
|
|
|
26
|
-
export interface EditManagerEncodingContext {
|
|
27
|
-
idCompressor: IIdCompressor;
|
|
28
|
-
readonly schema?: SchemaAndPolicy;
|
|
29
|
-
readonly isSummary: boolean;
|
|
30
|
-
/** See {@link IdentifierHealingConfig}. */
|
|
31
|
-
readonly healing?: IdentifierHealingConfig;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
23
|
/**
|
|
35
24
|
* Create the provided version of the {@link EditManager} codec (which encodes it's {@link SummaryData}).
|
|
36
25
|
* @remarks
|
|
@@ -53,10 +42,18 @@ export function makeV1toV4andV6CodecWithVersion<TChangeset>(
|
|
|
53
42
|
ChangeEncodingContext
|
|
54
43
|
>,
|
|
55
44
|
version: EncodedEditManager<TChangeset>["version"],
|
|
56
|
-
): CodecAndSchema<
|
|
45
|
+
): CodecAndSchema<
|
|
46
|
+
SummaryData<TChangeset>,
|
|
47
|
+
EditManagerEncodingContext,
|
|
48
|
+
EditManagerDecodingContext
|
|
49
|
+
> {
|
|
57
50
|
const schema = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);
|
|
58
51
|
|
|
59
|
-
const codec: CodecAndSchema<
|
|
52
|
+
const codec: CodecAndSchema<
|
|
53
|
+
SummaryData<TChangeset>,
|
|
54
|
+
EditManagerEncodingContext,
|
|
55
|
+
EditManagerDecodingContext
|
|
56
|
+
> = {
|
|
60
57
|
schema,
|
|
61
58
|
encode: (
|
|
62
59
|
data: SummaryData<TChangeset>,
|
|
@@ -80,7 +77,7 @@ export function makeV1toV4andV6CodecWithVersion<TChangeset>(
|
|
|
80
77
|
},
|
|
81
78
|
decode: (
|
|
82
79
|
json: EncodedEditManager<TChangeset> & JsonCompatibleReadOnly,
|
|
83
|
-
context:
|
|
80
|
+
context: EditManagerDecodingContext,
|
|
84
81
|
): SummaryData<TChangeset> => {
|
|
85
82
|
return {
|
|
86
83
|
main: decodeSharedBranch(
|
|
@@ -4,17 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
8
7
|
|
|
9
8
|
import type { CodecAndSchema, IJsonCodec } from "../codec/index.js";
|
|
10
|
-
import type {
|
|
11
|
-
ChangeEncodingContext,
|
|
12
|
-
EncodedRevisionTag,
|
|
13
|
-
RevisionTag,
|
|
14
|
-
SchemaAndPolicy,
|
|
15
|
-
} from "../core/index.js";
|
|
9
|
+
import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../core/index.js";
|
|
16
10
|
import {
|
|
17
|
-
type IdentifierHealingConfig,
|
|
18
11
|
type JsonCompatibleReadOnly,
|
|
19
12
|
type JsonCompatibleReadOnlyObject,
|
|
20
13
|
JsonCompatibleReadOnlySchema,
|
|
@@ -23,18 +16,15 @@ import {
|
|
|
23
16
|
|
|
24
17
|
import type { BranchId } from "./branch.js";
|
|
25
18
|
import type { SharedBranchSummaryData, SummaryData } from "./editManager.js";
|
|
26
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
decodeSharedBranch,
|
|
21
|
+
encodeSharedBranch,
|
|
22
|
+
type EditManagerDecodingContext,
|
|
23
|
+
type EditManagerEncodingContext,
|
|
24
|
+
} from "./editManagerCodecsCommons.js";
|
|
27
25
|
import type { EncodedSharedBranch } from "./editManagerFormatCommons.js";
|
|
28
26
|
import { EncodedEditManager } from "./editManagerFormatVSharedBranches.js";
|
|
29
27
|
|
|
30
|
-
export interface EditManagerEncodingContext {
|
|
31
|
-
idCompressor: IIdCompressor;
|
|
32
|
-
readonly schema?: SchemaAndPolicy;
|
|
33
|
-
readonly isSummary: boolean;
|
|
34
|
-
/** See {@link IdentifierHealingConfig}. */
|
|
35
|
-
readonly healing?: IdentifierHealingConfig;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
28
|
export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
39
29
|
changeCodec: IJsonCodec<
|
|
40
30
|
TChangeset,
|
|
@@ -49,10 +39,18 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
|
49
39
|
ChangeEncodingContext
|
|
50
40
|
>,
|
|
51
41
|
version: EncodedEditManager<TChangeset>["version"],
|
|
52
|
-
): CodecAndSchema<
|
|
42
|
+
): CodecAndSchema<
|
|
43
|
+
SummaryData<TChangeset>,
|
|
44
|
+
EditManagerEncodingContext,
|
|
45
|
+
EditManagerDecodingContext
|
|
46
|
+
> {
|
|
53
47
|
const schema = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);
|
|
54
48
|
|
|
55
|
-
const codec: CodecAndSchema<
|
|
49
|
+
const codec: CodecAndSchema<
|
|
50
|
+
SummaryData<TChangeset>,
|
|
51
|
+
EditManagerEncodingContext,
|
|
52
|
+
EditManagerDecodingContext
|
|
53
|
+
> = {
|
|
56
54
|
schema,
|
|
57
55
|
encode: (data: SummaryData<TChangeset>, context: EditManagerEncodingContext) => {
|
|
58
56
|
const mainBranch = encodeSharedBranch(
|
|
@@ -90,7 +88,7 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
|
90
88
|
},
|
|
91
89
|
decode: (
|
|
92
90
|
json: EncodedEditManager<TChangeset> & JsonCompatibleReadOnlyObject,
|
|
93
|
-
context:
|
|
91
|
+
context: EditManagerDecodingContext,
|
|
94
92
|
): SummaryData<TChangeset> => {
|
|
95
93
|
const mainBranch = decodeSharedBranch(
|
|
96
94
|
changeCodec,
|
|
@@ -15,11 +15,14 @@ import type {
|
|
|
15
15
|
import type { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
|
|
16
16
|
|
|
17
17
|
import type { IJsonCodec } from "../codec/index.js";
|
|
18
|
-
import type {
|
|
18
|
+
import type { ChangeFamilyEditor, SchemaAndPolicy } from "../core/index.js";
|
|
19
19
|
import type { IdentifierHealingConfig, JsonCompatibleReadOnly } from "../util/index.js";
|
|
20
20
|
|
|
21
21
|
import type { EditManager, SummaryData } from "./editManager.js";
|
|
22
|
-
import type {
|
|
22
|
+
import type {
|
|
23
|
+
EditManagerDecodingContext,
|
|
24
|
+
EditManagerEncodingContext,
|
|
25
|
+
} from "./editManagerCodecsCommons.js";
|
|
23
26
|
import type {
|
|
24
27
|
Summarizable,
|
|
25
28
|
SummaryElementParser,
|
|
@@ -65,7 +68,7 @@ function minVersionToEditManagerSummaryFormatVersion(
|
|
|
65
68
|
/**
|
|
66
69
|
* Provides methods for summarizing and loading an `EditManager`
|
|
67
70
|
*/
|
|
68
|
-
export class EditManagerSummarizer<TChangeset>
|
|
71
|
+
export class EditManagerSummarizer<TChangeset, TChangeProcessingContext>
|
|
69
72
|
extends VersionedSummarizer<EditManagerSummaryFormatVersion>
|
|
70
73
|
implements Summarizable
|
|
71
74
|
{
|
|
@@ -74,13 +77,14 @@ export class EditManagerSummarizer<TChangeset>
|
|
|
74
77
|
private readonly editManager: EditManager<
|
|
75
78
|
ChangeFamilyEditor,
|
|
76
79
|
TChangeset,
|
|
77
|
-
|
|
80
|
+
TChangeProcessingContext
|
|
78
81
|
>,
|
|
79
82
|
private readonly codec: IJsonCodec<
|
|
80
83
|
SummaryData<TChangeset>,
|
|
81
84
|
JsonCompatibleReadOnly,
|
|
82
85
|
JsonCompatibleReadOnly,
|
|
83
|
-
EditManagerEncodingContext
|
|
86
|
+
EditManagerEncodingContext,
|
|
87
|
+
EditManagerDecodingContext
|
|
84
88
|
>,
|
|
85
89
|
private readonly idCompressor: IIdCompressor,
|
|
86
90
|
minVersionForCollab: MinimumVersionForCollab,
|
|
@@ -109,7 +113,6 @@ export class EditManagerSummarizer<TChangeset>
|
|
|
109
113
|
idCompressor: this.idCompressor,
|
|
110
114
|
schema: this.schemaAndPolicy,
|
|
111
115
|
isSummary: true,
|
|
112
|
-
healing: this.healing,
|
|
113
116
|
};
|
|
114
117
|
const jsonCompatible = this.codec.encode(this.editManager.getSummaryData(), context);
|
|
115
118
|
const dataString = stringify(jsonCompatible);
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
JsonCompatibleReadOnlySchema,
|
|
18
18
|
} from "../util/index.js";
|
|
19
19
|
|
|
20
|
-
import type { MessageEncodingContext } from "./messageCodecs.js";
|
|
20
|
+
import type { MessageDecodingContext, MessageEncodingContext } from "./messageCodecs.js";
|
|
21
21
|
import type { MessageFormatVersion } from "./messageFormat.js";
|
|
22
22
|
import { Message } from "./messageFormatV1ToV4.js";
|
|
23
23
|
import type { DecodedMessage } from "./messageTypes.js";
|
|
@@ -36,7 +36,7 @@ export function makeV1ToV4CodecWithVersion<TChangeset>(
|
|
|
36
36
|
| typeof MessageFormatVersion.v3
|
|
37
37
|
| typeof MessageFormatVersion.v4
|
|
38
38
|
| typeof MessageFormatVersion.v6,
|
|
39
|
-
): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext> {
|
|
39
|
+
): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext, MessageDecodingContext> {
|
|
40
40
|
const schema = Message(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);
|
|
41
41
|
return {
|
|
42
42
|
schema,
|
|
@@ -70,7 +70,7 @@ export function makeV1ToV4CodecWithVersion<TChangeset>(
|
|
|
70
70
|
},
|
|
71
71
|
decode: (
|
|
72
72
|
encoded: Message & JsonCompatibleReadOnlyObject & Versioned,
|
|
73
|
-
context:
|
|
73
|
+
context: MessageDecodingContext,
|
|
74
74
|
): DecodedMessage<TChangeset> => {
|
|
75
75
|
const { revision: encodedRevision, originatorId, changeset } = encoded;
|
|
76
76
|
|
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
import type { JsonCompatibleReadOnlyObject } from "../util/index.js";
|
|
18
18
|
|
|
19
19
|
import { decodeBranchId, encodeBranchId } from "./branchIdCodec.js";
|
|
20
|
-
import type { MessageEncodingContext } from "./messageCodecs.js";
|
|
20
|
+
import type { MessageDecodingContext, MessageEncodingContext } from "./messageCodecs.js";
|
|
21
21
|
import type { MessageFormatVersion } from "./messageFormat.js";
|
|
22
22
|
import { Message } from "./messageFormatVSharedBranches.js";
|
|
23
23
|
import type { DecodedMessage } from "./messageTypes.js";
|
|
@@ -79,7 +79,7 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
|
|
|
79
79
|
},
|
|
80
80
|
decode: (
|
|
81
81
|
encoded: Message & JsonCompatibleReadOnlyObject & Versioned,
|
|
82
|
-
context:
|
|
82
|
+
context: MessageDecodingContext,
|
|
83
83
|
): DecodedMessage<TChangeset> => {
|
|
84
84
|
const {
|
|
85
85
|
revision: encodedRevision,
|
|
@@ -35,6 +35,14 @@ export interface MessageEncodingContext {
|
|
|
35
35
|
schema?: SchemaAndPolicy;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Context required for decoding a message. Unlike {@link MessageEncodingContext}, no schema is
|
|
40
|
+
* needed: message decoding is schema-agnostic.
|
|
41
|
+
*/
|
|
42
|
+
export interface MessageDecodingContext {
|
|
43
|
+
idCompressor: IIdCompressor;
|
|
44
|
+
}
|
|
45
|
+
|
|
38
46
|
/**
|
|
39
47
|
* Codec name used to identify the message codec, see {@link makeMessageCodecBuilder}.
|
|
40
48
|
*/
|
|
@@ -65,14 +73,16 @@ export function makeMessageCodecBuilder<TChangeset>(): VersionDispatchingCodecBu
|
|
|
65
73
|
DecodedMessage<TChangeset>,
|
|
66
74
|
MessageEncodingContext,
|
|
67
75
|
MessageFormatVersion | undefined,
|
|
68
|
-
typeof messageCodecName
|
|
76
|
+
typeof messageCodecName,
|
|
77
|
+
MessageDecodingContext
|
|
69
78
|
> {
|
|
70
79
|
// See MessageFormatVersion and its members for documentation on what changed in each version.
|
|
71
80
|
const versions: CodecVersion<
|
|
72
81
|
DecodedMessage<TChangeset>,
|
|
73
82
|
MessageEncodingContext,
|
|
74
83
|
MessageFormatVersion | undefined,
|
|
75
|
-
MessageCodecBuilderOptions<TChangeset
|
|
84
|
+
MessageCodecBuilderOptions<TChangeset>,
|
|
85
|
+
MessageDecodingContext
|
|
76
86
|
>[] = [
|
|
77
87
|
// The "undefined" wire format (no version field) is discontinued.
|
|
78
88
|
makeDiscontinuedCodecAndSchema(undefined, "2.73.0"),
|
|
@@ -95,12 +95,19 @@ export interface EnrichmentConfig<TChange> {
|
|
|
95
95
|
* Generic shared tree, which needs to be configured with indexes, field kinds and other configuration.
|
|
96
96
|
*/
|
|
97
97
|
@breakingClass
|
|
98
|
-
export class SharedTreeCore<
|
|
98
|
+
export class SharedTreeCore<
|
|
99
|
+
TEditor extends ChangeFamilyEditor,
|
|
100
|
+
TChange,
|
|
101
|
+
TChangeProcessingContext,
|
|
102
|
+
>
|
|
99
103
|
extends VersionedSummarizer<SharedTreeSummaryFormatVersion>
|
|
100
104
|
implements WithBreakable, Summarizable
|
|
101
105
|
{
|
|
102
|
-
private readonly editManager: EditManager<TEditor, TChange,
|
|
103
|
-
private readonly summarizables: readonly [
|
|
106
|
+
private readonly editManager: EditManager<TEditor, TChange, TChangeProcessingContext>;
|
|
107
|
+
private readonly summarizables: readonly [
|
|
108
|
+
EditManagerSummarizer<TChange, TChangeProcessingContext>,
|
|
109
|
+
...Summarizable[],
|
|
110
|
+
];
|
|
104
111
|
/**
|
|
105
112
|
* The sequence number that this instance is at.
|
|
106
113
|
* This number is artificial in that it is made up by this instance as opposed to being provided by the runtime.
|
|
@@ -147,7 +154,7 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
147
154
|
public readonly submitLocalMessage: (content: unknown, localOpMetadata?: unknown) => void,
|
|
148
155
|
logger: ITelemetryBaseLogger | undefined,
|
|
149
156
|
summarizables: readonly Summarizable[],
|
|
150
|
-
protected readonly changeFamily: ChangeFamily<TEditor, TChange>,
|
|
157
|
+
protected readonly changeFamily: ChangeFamily<TEditor, TChange, TChangeProcessingContext>,
|
|
151
158
|
options: SharedTreeCoreOptionsInternal,
|
|
152
159
|
changeFormatVersionForEditManager: DependentFormatVersion<EditManagerFormatVersion>,
|
|
153
160
|
changeFormatVersionForMessage: DependentFormatVersion<MessageFormatVersion>,
|
|
@@ -519,7 +526,7 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
519
526
|
}
|
|
520
527
|
}
|
|
521
528
|
|
|
522
|
-
public getLocalBranch(): SharedTreeBranch<TEditor, TChange> {
|
|
529
|
+
public getLocalBranch(): SharedTreeBranch<TEditor, TChange, TChangeProcessingContext> {
|
|
523
530
|
return this.editManager.getLocalBranch("main");
|
|
524
531
|
}
|
|
525
532
|
|
|
@@ -545,7 +552,9 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
545
552
|
this.editManager.addNewBranch(branchId, branchName);
|
|
546
553
|
}
|
|
547
554
|
|
|
548
|
-
public getSharedBranch(
|
|
555
|
+
public getSharedBranch(
|
|
556
|
+
branchId: BranchId,
|
|
557
|
+
): SharedTreeBranch<TEditor, TChange, TChangeProcessingContext> {
|
|
549
558
|
return this.editManager.getLocalBranch(branchId);
|
|
550
559
|
}
|
|
551
560
|
|