@fluidframework/tree 2.4.0-297027 → 2.4.0-299374
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/.dependency-cruiser-known-violations.json +0 -14
- package/.vscode/settings.json +9 -1
- package/api-report/tree.alpha.api.md +178 -21
- package/api-report/tree.beta.api.md +46 -21
- package/api-report/tree.legacy.alpha.api.md +46 -21
- package/api-report/tree.legacy.public.api.md +46 -21
- package/api-report/tree.public.api.md +46 -21
- package/dist/alpha.d.ts +29 -1
- package/dist/beta.d.ts +2 -0
- package/dist/codec/codec.d.ts +4 -4
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/noopValidator.d.ts +1 -1
- package/dist/codec/noopValidator.js +1 -1
- package/dist/codec/noopValidator.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +2 -2
- 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 +3 -2
- package/dist/core/change-family/editBuilder.d.ts.map +1 -1
- package/dist/core/change-family/editBuilder.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +2 -1
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/utils.js +1 -1
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +159 -2
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +54 -12
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/external-utilities/typeboxValidator.d.ts +1 -1
- package/dist/external-utilities/typeboxValidator.js +1 -1
- package/dist/external-utilities/typeboxValidator.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +4 -3
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +41 -30
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -6
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +4 -0
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +38 -6
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +0 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +46 -49
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +4 -4
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -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/modularChangeFamily.d.ts +12 -8
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +179 -60
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts +10 -9
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +9 -7
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +3 -10
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -8
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +32 -20
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts +6 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +25 -9
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +17 -16
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +19 -11
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/dist/feature-libraries/treeCompressionUtils.d.ts +1 -1
- package/dist/feature-libraries/treeCompressionUtils.js +1 -1
- package/dist/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +2 -2
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/legacy.d.ts +2 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +2 -0
- package/dist/shared-tree/index.d.ts +2 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +5 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +1 -14
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +24 -9
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +21 -9
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +4 -4
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -2
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +15 -11
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApi.d.ts +6 -6
- package/dist/shared-tree/treeApi.d.ts.map +1 -1
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +4 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +2 -3
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +10 -11
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts +5 -5
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +4 -4
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +1 -1
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +2 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts +29 -0
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -0
- package/dist/simple-tree/api/conciseTree.js +25 -0
- package/dist/simple-tree/api/conciseTree.js.map +1 -0
- package/dist/simple-tree/api/customTree.d.ts +44 -0
- package/dist/simple-tree/api/customTree.d.ts.map +1 -0
- package/dist/simple-tree/api/customTree.js +63 -0
- package/dist/simple-tree/api/customTree.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +7 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +5 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +41 -26
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +43 -15
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +1 -2
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +8 -8
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -2
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +78 -0
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/storedSchema.js +107 -0
- package/dist/simple-tree/api/storedSchema.js.map +1 -0
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/dist/simple-tree/api/tree.d.ts +12 -3
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +5 -5
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/{typesUnsafe.d.ts → api/typesUnsafe.d.ts} +58 -10
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -0
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -0
- package/dist/simple-tree/api/verboseTree.d.ts +6 -20
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +10 -48
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +14 -3
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +1 -2
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +9 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +14 -1
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +6 -5
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +3 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +3 -1
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/flexList.d.ts.map +1 -0
- package/dist/simple-tree/flexList.js.map +1 -0
- package/dist/simple-tree/index.d.ts +6 -7
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +5 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +2 -3
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +3 -4
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +60 -7
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +11 -6
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +13 -15
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +4 -2
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +3 -3
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +2 -1
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/treeFactory.d.ts +1 -0
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +1 -0
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/utils.d.ts +10 -8
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js.map +1 -1
- package/docs/main/detached-trees.md +8 -8
- package/lib/alpha.d.ts +29 -1
- package/lib/beta.d.ts +2 -0
- package/lib/codec/codec.d.ts +4 -4
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/noopValidator.d.ts +1 -1
- package/lib/codec/noopValidator.js +1 -1
- package/lib/codec/noopValidator.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +2 -2
- 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 +3 -2
- package/lib/core/change-family/editBuilder.d.ts.map +1 -1
- package/lib/core/change-family/editBuilder.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +2 -1
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/utils.js +1 -1
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +159 -2
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +54 -12
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/external-utilities/typeboxValidator.d.ts +1 -1
- package/lib/external-utilities/typeboxValidator.js +1 -1
- package/lib/external-utilities/typeboxValidator.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +4 -3
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +41 -30
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -6
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +4 -0
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +36 -5
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +0 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +0 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +4 -4
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -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/modularChangeFamily.d.ts +12 -8
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +180 -61
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts +10 -9
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +9 -7
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +3 -10
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -8
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +32 -20
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts +6 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +25 -9
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +17 -16
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +19 -11
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/lib/feature-libraries/treeCompressionUtils.d.ts +1 -1
- package/lib/feature-libraries/treeCompressionUtils.js +1 -1
- package/lib/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/lib/index.d.ts +6 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +2 -2
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/legacy.d.ts +2 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +2 -0
- package/lib/shared-tree/index.d.ts +2 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +2 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +2 -15
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +24 -9
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +20 -9
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +4 -4
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -2
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +15 -11
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApi.d.ts +6 -6
- package/lib/shared-tree/treeApi.d.ts.map +1 -1
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +5 -4
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +2 -3
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +11 -12
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts +5 -5
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +4 -4
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +2 -2
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +2 -2
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts +29 -0
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -0
- package/lib/simple-tree/api/conciseTree.js +21 -0
- package/lib/simple-tree/api/conciseTree.js.map +1 -0
- package/lib/simple-tree/api/customTree.d.ts +44 -0
- package/lib/simple-tree/api/customTree.d.ts.map +1 -0
- package/lib/simple-tree/api/customTree.js +59 -0
- package/lib/simple-tree/api/customTree.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +7 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +41 -26
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js +43 -15
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +1 -2
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +1 -1
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -2
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +78 -0
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/storedSchema.js +101 -0
- package/lib/simple-tree/api/storedSchema.js.map +1 -0
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/lib/simple-tree/api/tree.d.ts +12 -3
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +3 -3
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/{typesUnsafe.d.ts → api/typesUnsafe.d.ts} +58 -10
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -0
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -0
- package/lib/simple-tree/api/verboseTree.d.ts +6 -20
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +11 -49
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +14 -3
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +1 -2
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +9 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +12 -0
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +6 -5
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +3 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +3 -1
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/flexList.d.ts.map +1 -0
- package/lib/simple-tree/flexList.js.map +1 -0
- package/lib/simple-tree/index.d.ts +6 -7
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +3 -4
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +1 -2
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +1 -2
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +60 -7
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +6 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +1 -3
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +4 -2
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +3 -3
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +2 -1
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/treeFactory.d.ts +1 -0
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +1 -0
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/utils.d.ts +10 -8
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js.map +1 -1
- package/package.json +44 -27
- package/src/codec/codec.ts +4 -4
- package/src/codec/noopValidator.ts +1 -1
- package/src/core/change-family/changeFamily.ts +5 -2
- package/src/core/change-family/editBuilder.ts +3 -2
- package/src/core/rebase/changeRebaser.ts +6 -1
- package/src/core/rebase/utils.ts +1 -1
- package/src/core/tree/anchorSet.ts +63 -13
- package/src/external-utilities/typeboxValidator.ts +1 -1
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +92 -47
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +7 -7
- package/src/feature-libraries/flex-tree/lazyField.ts +44 -7
- package/src/feature-libraries/index.ts +0 -10
- package/src/feature-libraries/mitigatedChangeFamily.ts +11 -4
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +1 -0
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +218 -175
- package/src/feature-libraries/optional-field/optionalField.ts +21 -17
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -10
- package/src/feature-libraries/sequence-field/compose.ts +67 -58
- package/src/feature-libraries/sequence-field/invert.ts +30 -6
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +65 -19
- package/src/feature-libraries/treeCompressionUtils.ts +1 -1
- package/src/index.ts +26 -6
- package/src/internalTypes.ts +4 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +5 -0
- package/src/shared-tree/schematizingTreeView.ts +7 -16
- package/src/shared-tree/sharedTree.ts +55 -23
- package/src/shared-tree/sharedTreeChangeFamily.ts +5 -1
- package/src/shared-tree/sharedTreeEditBuilder.ts +23 -12
- package/src/shared-tree/treeApi.ts +19 -9
- package/src/shared-tree/treeCheckout.ts +7 -6
- package/src/shared-tree-core/branch.ts +11 -14
- package/src/shared-tree-core/defaultResubmitMachine.ts +4 -4
- package/src/shared-tree-core/editManager.ts +2 -1
- package/src/shared-tree-core/sharedTreeCore.ts +4 -2
- package/src/simple-tree/api/conciseTree.ts +58 -0
- package/src/simple-tree/api/customTree.ts +119 -0
- package/src/simple-tree/api/index.ts +39 -1
- package/src/simple-tree/api/schemaCreationUtilities.ts +55 -36
- package/src/simple-tree/api/schemaFactory.ts +4 -6
- package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -2
- package/src/simple-tree/api/storedSchema.ts +126 -0
- package/src/simple-tree/api/tree.ts +24 -2
- package/src/simple-tree/api/treeNodeApi.ts +3 -8
- package/src/simple-tree/{typesUnsafe.ts → api/typesUnsafe.ts} +95 -21
- package/src/simple-tree/api/verboseTree.ts +21 -76
- package/src/simple-tree/arrayNode.ts +35 -15
- package/src/simple-tree/core/index.ts +1 -0
- package/src/simple-tree/core/treeNodeKernel.ts +13 -0
- package/src/simple-tree/core/treeNodeSchema.ts +7 -5
- package/src/simple-tree/core/unhydratedFlexTree.ts +6 -1
- package/src/simple-tree/core/withType.ts +10 -1
- package/src/simple-tree/index.ts +41 -21
- package/src/simple-tree/mapNode.ts +1 -1
- package/src/simple-tree/objectNode.ts +1 -1
- package/src/simple-tree/schemaTypes.ts +70 -11
- package/src/simple-tree/toFlexSchema.ts +1 -3
- package/src/simple-tree/toMapTree.ts +7 -4
- package/src/simple-tree/treeNodeValid.ts +2 -1
- package/src/treeFactory.ts +1 -0
- package/src/util/utils.ts +10 -8
- package/dist/feature-libraries/flex-tree/unboxed.d.ts +0 -12
- package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +0 -1
- package/dist/feature-libraries/flex-tree/unboxed.js +0 -20
- package/dist/feature-libraries/flex-tree/unboxed.js.map +0 -1
- package/dist/feature-libraries/typed-schema/flexList.d.ts.map +0 -1
- package/dist/feature-libraries/typed-schema/flexList.js.map +0 -1
- package/dist/feature-libraries/typed-schema/index.d.ts +0 -7
- package/dist/feature-libraries/typed-schema/index.d.ts.map +0 -1
- package/dist/feature-libraries/typed-schema/index.js +0 -12
- package/dist/feature-libraries/typed-schema/index.js.map +0 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -14
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +0 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +0 -7
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +0 -1
- package/dist/simple-tree/proxyBinding.d.ts +0 -15
- package/dist/simple-tree/proxyBinding.d.ts.map +0 -1
- package/dist/simple-tree/proxyBinding.js +0 -22
- package/dist/simple-tree/proxyBinding.js.map +0 -1
- package/dist/simple-tree/typesUnsafe.d.ts.map +0 -1
- package/dist/simple-tree/typesUnsafe.js.map +0 -1
- package/lib/feature-libraries/flex-tree/unboxed.d.ts +0 -12
- package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +0 -1
- package/lib/feature-libraries/flex-tree/unboxed.js +0 -16
- package/lib/feature-libraries/flex-tree/unboxed.js.map +0 -1
- package/lib/feature-libraries/typed-schema/flexList.d.ts.map +0 -1
- package/lib/feature-libraries/typed-schema/flexList.js.map +0 -1
- package/lib/feature-libraries/typed-schema/index.d.ts +0 -7
- package/lib/feature-libraries/typed-schema/index.d.ts.map +0 -1
- package/lib/feature-libraries/typed-schema/index.js +0 -6
- package/lib/feature-libraries/typed-schema/index.js.map +0 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -14
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +0 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +0 -6
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +0 -1
- package/lib/simple-tree/proxyBinding.d.ts +0 -15
- package/lib/simple-tree/proxyBinding.d.ts.map +0 -1
- package/lib/simple-tree/proxyBinding.js +0 -18
- package/lib/simple-tree/proxyBinding.js.map +0 -1
- package/lib/simple-tree/typesUnsafe.d.ts.map +0 -1
- package/lib/simple-tree/typesUnsafe.js.map +0 -1
- package/src/feature-libraries/flex-tree/unboxed.ts +0 -24
- package/src/feature-libraries/typed-schema/README.md +0 -6
- package/src/feature-libraries/typed-schema/index.ts +0 -16
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +0 -14
- package/src/simple-tree/proxyBinding.ts +0 -20
- /package/dist/simple-tree/{typesUnsafe.js → api/typesUnsafe.js} +0 -0
- /package/dist/{feature-libraries/typed-schema → simple-tree}/flexList.d.ts +0 -0
- /package/dist/{feature-libraries/typed-schema → simple-tree}/flexList.js +0 -0
- /package/lib/simple-tree/{typesUnsafe.js → api/typesUnsafe.js} +0 -0
- /package/lib/{feature-libraries/typed-schema → simple-tree}/flexList.d.ts +0 -0
- /package/lib/{feature-libraries/typed-schema → simple-tree}/flexList.js +0 -0
- /package/src/simple-tree/{ProxyBinding.md → core/TreeNodeBinding.md} +0 -0
- /package/src/{feature-libraries/typed-schema → simple-tree}/flexList.ts +0 -0
package/src/index.ts
CHANGED
|
@@ -40,9 +40,7 @@ export {
|
|
|
40
40
|
} from "./events/index.js";
|
|
41
41
|
|
|
42
42
|
export {
|
|
43
|
-
type LazyItem,
|
|
44
43
|
TreeStatus,
|
|
45
|
-
type Unenforced,
|
|
46
44
|
TreeCompressionStrategy,
|
|
47
45
|
} from "./feature-libraries/index.js";
|
|
48
46
|
|
|
@@ -58,6 +56,7 @@ export {
|
|
|
58
56
|
type NodeInDocumentConstraint,
|
|
59
57
|
type RunTransaction,
|
|
60
58
|
rollback,
|
|
59
|
+
type ForestOptions,
|
|
61
60
|
getBranch,
|
|
62
61
|
type TreeBranch,
|
|
63
62
|
type TreeBranchFork,
|
|
@@ -115,18 +114,25 @@ export {
|
|
|
115
114
|
type InsertableObjectFromSchemaRecordUnsafe,
|
|
116
115
|
type InsertableTreeFieldFromImplicitFieldUnsafe,
|
|
117
116
|
type FieldSchemaUnsafe,
|
|
117
|
+
type TreeNodeSchemaClassUnsafe,
|
|
118
118
|
// System types (not in Internal types for various reasons, like doc links or cannot be named errors).
|
|
119
119
|
type typeSchemaSymbol,
|
|
120
120
|
type TreeNodeSchemaNonClass,
|
|
121
121
|
// Recursive Schema APIs
|
|
122
122
|
type ValidateRecursiveSchema,
|
|
123
123
|
type FixRecursiveArraySchema,
|
|
124
|
-
// experimental @
|
|
124
|
+
// experimental @alpha APIs:
|
|
125
125
|
adaptEnum,
|
|
126
126
|
enumFromStrings,
|
|
127
127
|
singletonSchema,
|
|
128
128
|
typedObjectValues,
|
|
129
|
-
type
|
|
129
|
+
type UnsafeUnknownSchema,
|
|
130
|
+
type TreeViewAlpha,
|
|
131
|
+
type InsertableField,
|
|
132
|
+
type Insertable,
|
|
133
|
+
type InsertableContent,
|
|
134
|
+
type FactoryContent,
|
|
135
|
+
type FactoryContentObject,
|
|
130
136
|
// test recursive schema for checking that d.ts files handles schema correctly
|
|
131
137
|
test_RecursiveObject,
|
|
132
138
|
test_RecursiveObject_base,
|
|
@@ -134,6 +140,8 @@ export {
|
|
|
134
140
|
// Beta APIs
|
|
135
141
|
TreeBeta,
|
|
136
142
|
type TreeChangeEventsBeta,
|
|
143
|
+
extractPersistedSchema,
|
|
144
|
+
comparePersistedSchema,
|
|
137
145
|
// Back to normal types
|
|
138
146
|
type JsonTreeSchema,
|
|
139
147
|
type JsonSchemaId,
|
|
@@ -149,10 +157,20 @@ export {
|
|
|
149
157
|
type JsonSchemaType,
|
|
150
158
|
type JsonLeafSchemaType,
|
|
151
159
|
getJsonSchema,
|
|
160
|
+
type LazyItem,
|
|
161
|
+
type Unenforced,
|
|
162
|
+
type ReadonlyArrayNode,
|
|
152
163
|
} from "./simple-tree/index.js";
|
|
153
|
-
export {
|
|
164
|
+
export {
|
|
165
|
+
SharedTree,
|
|
166
|
+
configuredSharedTree,
|
|
167
|
+
} from "./treeFactory.js";
|
|
154
168
|
|
|
155
|
-
export type {
|
|
169
|
+
export type {
|
|
170
|
+
ICodecOptions,
|
|
171
|
+
JsonValidator,
|
|
172
|
+
SchemaValidationFunction,
|
|
173
|
+
} from "./codec/index.js";
|
|
156
174
|
export { noopValidator } from "./codec/index.js";
|
|
157
175
|
export { typeboxValidator } from "./external-utilities/index.js";
|
|
158
176
|
|
|
@@ -177,3 +195,5 @@ export {
|
|
|
177
195
|
// These would be put in `internalTypes` except doing so tents to cause errors like:
|
|
178
196
|
// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.
|
|
179
197
|
export type { MapNodeInsertableData } from "./simple-tree/index.js";
|
|
198
|
+
|
|
199
|
+
export type { JsonCompatible, JsonCompatibleObject } from "./util/index.js";
|
package/src/internalTypes.ts
CHANGED
|
@@ -33,7 +33,10 @@ export type {
|
|
|
33
33
|
NodeBuilderDataUnsafe,
|
|
34
34
|
NodeFromSchemaUnsafe,
|
|
35
35
|
ReadonlyMapInlined,
|
|
36
|
+
TreeNodeSchemaUnsafe,
|
|
37
|
+
AllowedTypesUnsafe,
|
|
38
|
+
TreeNodeSchemaNonClassUnsafe,
|
|
36
39
|
} from "./simple-tree/index.js";
|
|
37
|
-
export type { FlexList, FlexListToUnion, ExtractItemType } from "./
|
|
40
|
+
export type { FlexList, FlexListToUnion, ExtractItemType } from "./simple-tree/index.js";
|
|
38
41
|
|
|
39
42
|
export type { TreeApi } from "./shared-tree/index.js";
|
package/src/packageVersion.ts
CHANGED
package/src/shared-tree/index.ts
CHANGED
|
@@ -13,6 +13,9 @@ export {
|
|
|
13
13
|
type SharedTreeContentSnapshot,
|
|
14
14
|
type SharedTreeFormatOptions,
|
|
15
15
|
SharedTreeFormatVersion,
|
|
16
|
+
buildConfiguredForest,
|
|
17
|
+
defaultSharedTreeOptions,
|
|
18
|
+
type ForestOptions,
|
|
16
19
|
} from "./sharedTree.js";
|
|
17
20
|
|
|
18
21
|
export {
|
|
@@ -29,6 +32,8 @@ export {
|
|
|
29
32
|
|
|
30
33
|
export { type TreeStoredContent } from "./schematizeTree.js";
|
|
31
34
|
|
|
35
|
+
export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
36
|
+
|
|
32
37
|
export { CheckoutFlexTreeView } from "./checkoutFlexTreeView.js";
|
|
33
38
|
|
|
34
39
|
export type { ISharedTreeEditor, ISchemaEditor } from "./sharedTreeEditBuilder.js";
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
type TreeViewConfiguration,
|
|
42
42
|
mapTreeFromNodeData,
|
|
43
43
|
prepareContentForHydration,
|
|
44
|
+
comparePersistedSchemaInternal,
|
|
44
45
|
toStoredSchema,
|
|
45
46
|
} from "../simple-tree/index.js";
|
|
46
47
|
import { Breakable, breakingClass, disposeSymbol, type WithBreakable } from "../util/index.js";
|
|
@@ -225,22 +226,12 @@ export class SchematizingSimpleTreeView<in out TRootSchema extends ImplicitField
|
|
|
225
226
|
private update(): void {
|
|
226
227
|
this.disposeView();
|
|
227
228
|
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
const canView =
|
|
235
|
-
result.write === Compatibility.Compatible && result.read === Compatibility.Compatible;
|
|
236
|
-
const canUpgrade = result.read === Compatibility.Compatible;
|
|
237
|
-
const isEquivalent = canView && canUpgrade;
|
|
238
|
-
const compatibility: SchemaCompatibilityStatus = {
|
|
239
|
-
canView,
|
|
240
|
-
canUpgrade,
|
|
241
|
-
isEquivalent,
|
|
242
|
-
canInitialize: canInitialize(this.checkout),
|
|
243
|
-
};
|
|
229
|
+
const compatibility = comparePersistedSchemaInternal(
|
|
230
|
+
this.checkout.storedSchema,
|
|
231
|
+
this.viewSchema,
|
|
232
|
+
canInitialize(this.checkout),
|
|
233
|
+
);
|
|
234
|
+
|
|
244
235
|
let lastRoot =
|
|
245
236
|
this.compatibility.canView && this.view !== undefined ? this.root : undefined;
|
|
246
237
|
this.currentCompatibility = compatibility;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
|
+
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import type {
|
|
8
8
|
IChannelAttributes,
|
|
9
9
|
IChannelFactory,
|
|
@@ -16,10 +16,13 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
|
16
16
|
|
|
17
17
|
import { type ICodecOptions, noopValidator } from "../codec/index.js";
|
|
18
18
|
import {
|
|
19
|
+
type IEditableForest,
|
|
19
20
|
type JsonableTree,
|
|
20
21
|
RevisionTagCodec,
|
|
22
|
+
type TaggedChange,
|
|
21
23
|
type TreeStoredSchema,
|
|
22
24
|
TreeStoredSchemaRepository,
|
|
25
|
+
type TreeStoredSchemaSubscription,
|
|
23
26
|
makeDetachedFieldIndex,
|
|
24
27
|
moveToDetachedField,
|
|
25
28
|
} from "../core/index.js";
|
|
@@ -66,6 +69,7 @@ import {
|
|
|
66
69
|
createTreeCheckout,
|
|
67
70
|
} from "./treeCheckout.js";
|
|
68
71
|
import { breakingClass, throwIfBroken } from "../util/index.js";
|
|
72
|
+
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
69
73
|
|
|
70
74
|
/**
|
|
71
75
|
* Copy of data from an {@link ISharedTree} at some point in time.
|
|
@@ -149,6 +153,30 @@ function getCodecVersions(formatVersion: number): ExplicitCodecVersions {
|
|
|
149
153
|
return versions;
|
|
150
154
|
}
|
|
151
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Build and return a forest of the requested type.
|
|
158
|
+
*/
|
|
159
|
+
export function buildConfiguredForest(
|
|
160
|
+
type: ForestType,
|
|
161
|
+
schema: TreeStoredSchemaSubscription,
|
|
162
|
+
idCompressor: IIdCompressor,
|
|
163
|
+
): IEditableForest {
|
|
164
|
+
switch (type) {
|
|
165
|
+
case ForestType.Optimized:
|
|
166
|
+
return buildChunkedForest(
|
|
167
|
+
makeTreeChunker(schema, defaultSchemaPolicy),
|
|
168
|
+
undefined,
|
|
169
|
+
idCompressor,
|
|
170
|
+
);
|
|
171
|
+
case ForestType.Reference:
|
|
172
|
+
return buildForest();
|
|
173
|
+
case ForestType.Expensive:
|
|
174
|
+
return buildForest(undefined, true);
|
|
175
|
+
default:
|
|
176
|
+
unreachableCase(type);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
152
180
|
/**
|
|
153
181
|
* Shared tree, configured with a good set of indexes and field kinds which will maintain compatibility over time.
|
|
154
182
|
*
|
|
@@ -181,16 +209,7 @@ export class SharedTree
|
|
|
181
209
|
const options = { ...defaultSharedTreeOptions, ...optionsParam };
|
|
182
210
|
const codecVersions = getCodecVersions(options.formatVersion);
|
|
183
211
|
const schema = new TreeStoredSchemaRepository();
|
|
184
|
-
const forest =
|
|
185
|
-
options.forest === ForestType.Optimized
|
|
186
|
-
? buildChunkedForest(
|
|
187
|
-
makeTreeChunker(schema, defaultSchemaPolicy),
|
|
188
|
-
undefined,
|
|
189
|
-
runtime.idCompressor,
|
|
190
|
-
)
|
|
191
|
-
: options.forest === ForestType.Reference
|
|
192
|
-
? buildForest()
|
|
193
|
-
: buildForest(undefined, true);
|
|
212
|
+
const forest = buildConfiguredForest(options.forest, schema, runtime.idCompressor);
|
|
194
213
|
const revisionTagCodec = new RevisionTagCodec(runtime.idCompressor);
|
|
195
214
|
const removedRoots = makeDetachedFieldIndex(
|
|
196
215
|
"repair",
|
|
@@ -263,7 +282,8 @@ export class SharedTree
|
|
|
263
282
|
schema,
|
|
264
283
|
defaultSchemaPolicy,
|
|
265
284
|
new DefaultResubmitMachine(
|
|
266
|
-
|
|
285
|
+
(change: TaggedChange<SharedTreeChange>) =>
|
|
286
|
+
changeFamily.rebaser.invert(change, true, this.mintRevisionTag()),
|
|
267
287
|
changeEnricher,
|
|
268
288
|
),
|
|
269
289
|
changeEnricher,
|
|
@@ -348,7 +368,7 @@ export function getBranch(treeOrView: ITree | TreeView<ImplicitFieldSchema>): Tr
|
|
|
348
368
|
* Format versions supported by SharedTree.
|
|
349
369
|
*
|
|
350
370
|
* Each version documents a required minimum version of the \@fluidframework/tree package.
|
|
351
|
-
* @
|
|
371
|
+
* @alpha
|
|
352
372
|
*/
|
|
353
373
|
export const SharedTreeFormatVersion = {
|
|
354
374
|
/**
|
|
@@ -374,26 +394,38 @@ export const SharedTreeFormatVersion = {
|
|
|
374
394
|
* Format versions supported by SharedTree.
|
|
375
395
|
*
|
|
376
396
|
* Each version documents a required minimum version of the \@fluidframework/tree package.
|
|
377
|
-
* @
|
|
397
|
+
* @alpha
|
|
378
398
|
* @privateRemarks
|
|
379
399
|
* See packages/dds/tree/docs/main/compatibility.md for information on how to add support for a new format.
|
|
400
|
+
*
|
|
401
|
+
* TODO: Before this gets promoted past Alpha,
|
|
402
|
+
* a separate abstraction more suited for use in the public API should be adopted rather than reusing the same types used internally.
|
|
403
|
+
* Such an abstraction should probably be in the form of a Fluid-Framework wide compatibility enum.
|
|
380
404
|
*/
|
|
381
405
|
export type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;
|
|
382
406
|
|
|
383
407
|
/**
|
|
384
|
-
*
|
|
408
|
+
* Configuration options for SharedTree.
|
|
409
|
+
* @alpha
|
|
385
410
|
*/
|
|
386
411
|
export type SharedTreeOptions = Partial<ICodecOptions> &
|
|
387
|
-
Partial<SharedTreeFormatOptions> &
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
412
|
+
Partial<SharedTreeFormatOptions> &
|
|
413
|
+
ForestOptions;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Configuration options for SharedTree's internal tree storage.
|
|
417
|
+
* @alpha
|
|
418
|
+
*/
|
|
419
|
+
export interface ForestOptions {
|
|
420
|
+
/**
|
|
421
|
+
* The {@link ForestType} indicating which forest type should be created for the SharedTree.
|
|
422
|
+
*/
|
|
423
|
+
readonly forest?: ForestType;
|
|
424
|
+
}
|
|
393
425
|
|
|
394
426
|
/**
|
|
395
427
|
* Options for configuring the persisted format SharedTree uses.
|
|
396
|
-
* @
|
|
428
|
+
* @alpha
|
|
397
429
|
*/
|
|
398
430
|
export interface SharedTreeFormatOptions {
|
|
399
431
|
/**
|
|
@@ -417,7 +449,7 @@ export interface SharedTreeFormatOptions {
|
|
|
417
449
|
|
|
418
450
|
/**
|
|
419
451
|
* Used to distinguish between different forest types.
|
|
420
|
-
* @
|
|
452
|
+
* @alpha
|
|
421
453
|
*/
|
|
422
454
|
export enum ForestType {
|
|
423
455
|
/**
|
|
@@ -79,10 +79,12 @@ export class SharedTreeChangeFamily
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
public buildEditor(
|
|
82
|
-
|
|
82
|
+
mintRevisionTag: () => RevisionTag,
|
|
83
|
+
changeReceiver: (change: TaggedChange<SharedTreeChange>) => void,
|
|
83
84
|
): SharedTreeEditBuilder {
|
|
84
85
|
return new SharedTreeEditBuilder(
|
|
85
86
|
this.modularChangeFamily,
|
|
87
|
+
mintRevisionTag,
|
|
86
88
|
changeReceiver,
|
|
87
89
|
this.idCompressor,
|
|
88
90
|
);
|
|
@@ -120,6 +122,7 @@ export class SharedTreeChangeFamily
|
|
|
120
122
|
public invert(
|
|
121
123
|
change: TaggedChange<SharedTreeChange>,
|
|
122
124
|
isRollback: boolean,
|
|
125
|
+
revision: RevisionTag,
|
|
123
126
|
): SharedTreeChange {
|
|
124
127
|
const invertInnerChange: (
|
|
125
128
|
innerChange: SharedTreeChange["changes"][number],
|
|
@@ -131,6 +134,7 @@ export class SharedTreeChangeFamily
|
|
|
131
134
|
innerChange: this.modularChangeFamily.invert(
|
|
132
135
|
mapTaggedChange(change, innerChange.innerChange),
|
|
133
136
|
isRollback,
|
|
137
|
+
revision,
|
|
134
138
|
),
|
|
135
139
|
};
|
|
136
140
|
case "schema": {
|
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
ChangeFamilyEditor,
|
|
9
|
+
RevisionTag,
|
|
10
|
+
TaggedChange,
|
|
11
|
+
TreeStoredSchema,
|
|
12
|
+
} from "../core/index.js";
|
|
8
13
|
import {
|
|
9
14
|
DefaultEditBuilder,
|
|
10
15
|
type IDefaultEditBuilder,
|
|
@@ -48,14 +53,17 @@ export class SharedTreeEditBuilder
|
|
|
48
53
|
|
|
49
54
|
public constructor(
|
|
50
55
|
modularChangeFamily: ModularChangeFamily,
|
|
51
|
-
|
|
56
|
+
mintRevisionTag: () => RevisionTag,
|
|
57
|
+
private readonly changeReceiver: (change: TaggedChange<SharedTreeChange>) => void,
|
|
52
58
|
idCompressor?: IIdCompressor,
|
|
53
59
|
) {
|
|
54
60
|
super(
|
|
55
61
|
modularChangeFamily,
|
|
56
|
-
|
|
62
|
+
mintRevisionTag,
|
|
63
|
+
(taggedChange) =>
|
|
57
64
|
changeReceiver({
|
|
58
|
-
|
|
65
|
+
...taggedChange,
|
|
66
|
+
change: { changes: [{ type: "data", innerChange: taggedChange.change }] },
|
|
59
67
|
}),
|
|
60
68
|
idCompressor,
|
|
61
69
|
);
|
|
@@ -63,15 +71,18 @@ export class SharedTreeEditBuilder
|
|
|
63
71
|
this.schema = {
|
|
64
72
|
setStoredSchema: (oldSchema, newSchema) => {
|
|
65
73
|
this.changeReceiver({
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
revision: mintRevisionTag(),
|
|
75
|
+
change: {
|
|
76
|
+
changes: [
|
|
77
|
+
{
|
|
78
|
+
type: "schema",
|
|
79
|
+
innerChange: {
|
|
80
|
+
schema: { new: newSchema, old: oldSchema },
|
|
81
|
+
isInverse: false,
|
|
82
|
+
},
|
|
72
83
|
},
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
],
|
|
85
|
+
},
|
|
75
86
|
});
|
|
76
87
|
},
|
|
77
88
|
};
|
|
@@ -78,7 +78,10 @@ export interface RunTransaction {
|
|
|
78
78
|
* If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.
|
|
79
79
|
* If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
// TODO: TreeView is invariant over the schema, so to accept any view, `any` is the only real option unless a non generic (or covariant) base type for view is introduced (which is planned).
|
|
82
|
+
// This use of any is actually type safe as it is only used as a constraint, and the actual strongly typed view (TView) is passed to the callback.
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
|
+
<TView extends TreeView<any>, TResult>(
|
|
82
85
|
tree: TView,
|
|
83
86
|
transaction: (root: TView["root"]) => TResult,
|
|
84
87
|
): TResult;
|
|
@@ -123,7 +126,9 @@ export interface RunTransaction {
|
|
|
123
126
|
* If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.
|
|
124
127
|
* If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.
|
|
125
128
|
*/
|
|
126
|
-
|
|
129
|
+
// See comment on previous overload about use of any here.
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
131
|
+
<TView extends TreeView<any>, TResult>(
|
|
127
132
|
tree: TView,
|
|
128
133
|
transaction: (root: TView["root"]) => TResult | typeof rollback,
|
|
129
134
|
): TResult | typeof rollback;
|
|
@@ -161,10 +166,9 @@ export interface RunTransaction {
|
|
|
161
166
|
* If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.
|
|
162
167
|
* If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.
|
|
163
168
|
*/
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
): void;
|
|
169
|
+
// See comment on previous overload about use of any here.
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
171
|
+
<TView extends TreeView<any>>(tree: TView, transaction: (root: TView["root"]) => void): void;
|
|
168
172
|
/**
|
|
169
173
|
* Apply one or more edits to the tree as a single atomic unit.
|
|
170
174
|
* @param node - The node that will be passed to `transaction`.
|
|
@@ -211,7 +215,9 @@ export interface RunTransaction {
|
|
|
211
215
|
* If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.
|
|
212
216
|
* If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.
|
|
213
217
|
*/
|
|
214
|
-
|
|
218
|
+
// See comment on previous overload about use of any here.
|
|
219
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
220
|
+
<TView extends TreeView<any>, TResult>(
|
|
215
221
|
tree: TView,
|
|
216
222
|
transaction: (root: TView["root"]) => TResult,
|
|
217
223
|
preconditions?: readonly TransactionConstraint[],
|
|
@@ -264,7 +270,9 @@ export interface RunTransaction {
|
|
|
264
270
|
* If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.
|
|
265
271
|
* If the transaction is rolled back (whether by an error or by returning the {@link RunTransaction.rollback} | rollback value), a corresponding change event will also be emitted for the rollback.
|
|
266
272
|
*/
|
|
267
|
-
|
|
273
|
+
// See comment on previous overload about use of any here.
|
|
274
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
275
|
+
<TView extends TreeView<any>, TResult>(
|
|
268
276
|
tree: TView,
|
|
269
277
|
transaction: (root: TView["root"]) => TResult | typeof rollback,
|
|
270
278
|
preconditions?: readonly TransactionConstraint[],
|
|
@@ -313,7 +321,9 @@ export interface RunTransaction {
|
|
|
313
321
|
* If the transaction function throws an error then the transaction will be automatically rolled back (discarding any changes made to the tree so far) before the error is propagated up from this function.
|
|
314
322
|
* If the transaction is rolled back, a corresponding change event will also be emitted for the rollback.
|
|
315
323
|
*/
|
|
316
|
-
|
|
324
|
+
// See comment on previous overload about use of any here.
|
|
325
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
326
|
+
<TView extends TreeView<any>>(
|
|
317
327
|
tree: TView,
|
|
318
328
|
transaction: (root: TView["root"]) => void,
|
|
319
329
|
preconditions?: readonly TransactionConstraint[],
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
TreeStoredSchemaRepository,
|
|
33
33
|
type TreeStoredSchemaSubscription,
|
|
34
34
|
combineVisitors,
|
|
35
|
-
makeAnonChange,
|
|
36
35
|
makeDetachedFieldIndex,
|
|
37
36
|
rebaseChange,
|
|
38
37
|
rootFieldKey,
|
|
@@ -785,15 +784,17 @@ export class TreeCheckout implements ITreeCheckoutFork {
|
|
|
785
784
|
const revertibleBranch = this.revertibleCommitBranches.get(revision);
|
|
786
785
|
assert(revertibleBranch !== undefined, 0x7cc /* expected to find a revertible commit */);
|
|
787
786
|
const commitToRevert = revertibleBranch.getHead();
|
|
787
|
+
const revisionForInvert = this.mintRevisionTag();
|
|
788
788
|
|
|
789
|
-
let change =
|
|
790
|
-
this.changeFamily.rebaser.invert(
|
|
789
|
+
let change = tagChange(
|
|
790
|
+
this.changeFamily.rebaser.invert(commitToRevert, false, revisionForInvert),
|
|
791
|
+
revisionForInvert,
|
|
791
792
|
);
|
|
792
793
|
|
|
793
794
|
const headCommit = this._branch.getHead();
|
|
794
795
|
// Rebase the inverted change onto any commits that occurred after the undoable commits.
|
|
795
796
|
if (commitToRevert !== headCommit) {
|
|
796
|
-
change =
|
|
797
|
+
change = tagChange(
|
|
797
798
|
rebaseChange(
|
|
798
799
|
this.changeFamily.rebaser,
|
|
799
800
|
change,
|
|
@@ -801,12 +802,12 @@ export class TreeCheckout implements ITreeCheckoutFork {
|
|
|
801
802
|
headCommit,
|
|
802
803
|
this.mintRevisionTag,
|
|
803
804
|
).change,
|
|
805
|
+
revisionForInvert,
|
|
804
806
|
);
|
|
805
807
|
}
|
|
806
808
|
|
|
807
809
|
this._branch.apply(
|
|
808
|
-
change
|
|
809
|
-
this.mintRevisionTag(),
|
|
810
|
+
change,
|
|
810
811
|
kind === CommitKind.Default || kind === CommitKind.Redo
|
|
811
812
|
? CommitKind.Undo
|
|
812
813
|
: CommitKind.Redo,
|
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
makeAnonChange,
|
|
19
19
|
mintCommit,
|
|
20
20
|
rebaseBranch,
|
|
21
|
-
tagChange,
|
|
22
21
|
tagRollbackInverse,
|
|
23
22
|
type RebaseStatsWithDuration,
|
|
24
23
|
} from "../core/index.js";
|
|
@@ -224,8 +223,8 @@ export class SharedTreeBranch<
|
|
|
224
223
|
>,
|
|
225
224
|
) {
|
|
226
225
|
super();
|
|
227
|
-
this.editor = this.changeFamily.buildEditor((change) =>
|
|
228
|
-
this.apply(change
|
|
226
|
+
this.editor = this.changeFamily.buildEditor(mintRevisionTag, (change) =>
|
|
227
|
+
this.apply(change),
|
|
229
228
|
);
|
|
230
229
|
this.unsubscribeBranchTrimmer = branchTrimmer?.on("ancestryTrimmed", (commit) => {
|
|
231
230
|
this.emit("ancestryTrimmed", commit);
|
|
@@ -243,37 +242,35 @@ export class SharedTreeBranch<
|
|
|
243
242
|
|
|
244
243
|
/**
|
|
245
244
|
* Apply a change to this branch.
|
|
246
|
-
* @param
|
|
247
|
-
* @param revision - the revision of the new head commit of the branch that contains `change`
|
|
245
|
+
* @param taggedChange - the change to apply
|
|
248
246
|
* @param kind - the kind of change to apply
|
|
249
247
|
* @returns the change that was applied and the new head commit of the branch
|
|
250
248
|
*/
|
|
251
249
|
public apply(
|
|
252
|
-
|
|
253
|
-
revision: RevisionTag,
|
|
250
|
+
taggedChange: TaggedChange<TChange>,
|
|
254
251
|
kind: CommitKind = CommitKind.Default,
|
|
255
252
|
): [change: TChange, newCommit: GraphCommit<TChange>] {
|
|
256
253
|
this.assertNotDisposed();
|
|
257
254
|
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
const revisionTag = taggedChange.revision;
|
|
256
|
+
assert(revisionTag !== undefined, "Revision tag must be provided");
|
|
260
257
|
|
|
261
258
|
const newHead = mintCommit(this.head, {
|
|
262
|
-
revision,
|
|
263
|
-
change:
|
|
259
|
+
revision: revisionTag,
|
|
260
|
+
change: taggedChange.change,
|
|
264
261
|
});
|
|
265
262
|
|
|
266
263
|
const changeEvent = {
|
|
267
264
|
type: "append",
|
|
268
265
|
kind,
|
|
269
|
-
change:
|
|
266
|
+
change: taggedChange,
|
|
270
267
|
newCommits: [newHead],
|
|
271
268
|
} as const;
|
|
272
269
|
|
|
273
270
|
this.emit("beforeChange", changeEvent);
|
|
274
271
|
this.head = newHead;
|
|
275
272
|
this.emit("afterChange", changeEvent);
|
|
276
|
-
return [
|
|
273
|
+
return [taggedChange.change, newHead];
|
|
277
274
|
}
|
|
278
275
|
|
|
279
276
|
/**
|
|
@@ -371,7 +368,7 @@ export class SharedTreeBranch<
|
|
|
371
368
|
const commit =
|
|
372
369
|
commits[i] ?? fail("This wont run because we are iterating through commits");
|
|
373
370
|
const inverse = this.changeFamily.rebaser.changeRevision(
|
|
374
|
-
this.changeFamily.rebaser.invert(commit, true),
|
|
371
|
+
this.changeFamily.rebaser.invert(commit, true, revision),
|
|
375
372
|
revision,
|
|
376
373
|
commit.revision,
|
|
377
374
|
);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert, oob } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import type {
|
|
7
|
+
import type { GraphCommit, TaggedChange } from "../core/index.js";
|
|
8
8
|
import { disposeSymbol } from "../util/index.js";
|
|
9
9
|
import type { ChangeEnricherReadonlyCheckout, ResubmitMachine } from "./index.js";
|
|
10
10
|
|
|
@@ -36,9 +36,9 @@ export class DefaultResubmitMachine<TChange> implements ResubmitMachine<TChange>
|
|
|
36
36
|
|
|
37
37
|
public constructor(
|
|
38
38
|
/**
|
|
39
|
-
* A function that can
|
|
39
|
+
* A function that can create a rollback for a given change.
|
|
40
40
|
*/
|
|
41
|
-
private readonly
|
|
41
|
+
private readonly makeRollback: (change: TaggedChange<TChange>) => TChange,
|
|
42
42
|
/**
|
|
43
43
|
* Change enricher that represent the tip of the top-level local branch (i.e., the branch on which in-flight
|
|
44
44
|
* commits are applied and automatically rebased).
|
|
@@ -75,7 +75,7 @@ export class DefaultResubmitMachine<TChange> implements ResubmitMachine<TChange>
|
|
|
75
75
|
// Roll back the checkout to the state before the oldest commit
|
|
76
76
|
for (let iCommit = toResubmit.length - 1; iCommit >= 0; iCommit -= 1) {
|
|
77
77
|
const commit = toResubmit[iCommit] ?? oob();
|
|
78
|
-
const rollback = this.
|
|
78
|
+
const rollback = this.makeRollback(commit);
|
|
79
79
|
// WARNING: it's not currently possible to roll back past a schema change (see AB#7265).
|
|
80
80
|
// Either we have to make it possible to do so, or this logic will have to change to work
|
|
81
81
|
// forwards from an earlier fork instead of backwards.
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
mintCommit,
|
|
18
18
|
rebaseChange,
|
|
19
19
|
type RebaseStatsWithDuration,
|
|
20
|
+
tagChange,
|
|
20
21
|
} from "../core/index.js";
|
|
21
22
|
import { type Mutable, brand, fail, getOrCreate, mapIterable } from "../util/index.js";
|
|
22
23
|
|
|
@@ -642,7 +643,7 @@ export class EditManager<
|
|
|
642
643
|
...newChangeFullyRebased.telemetryProperties,
|
|
643
644
|
});
|
|
644
645
|
|
|
645
|
-
peerLocalBranch.apply(newCommit.change, newCommit.revision);
|
|
646
|
+
peerLocalBranch.apply(tagChange(newCommit.change, newCommit.revision));
|
|
646
647
|
this.pushCommitToTrunk(sequenceId, {
|
|
647
648
|
...newCommit,
|
|
648
649
|
change: newChangeFullyRebased.change,
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
RevisionTagCodec,
|
|
33
33
|
type SchemaAndPolicy,
|
|
34
34
|
type SchemaPolicy,
|
|
35
|
+
type TaggedChange,
|
|
35
36
|
type TreeStoredSchemaRepository,
|
|
36
37
|
} from "../core/index.js";
|
|
37
38
|
import {
|
|
@@ -271,7 +272,8 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
271
272
|
this.resubmitMachine =
|
|
272
273
|
resubmitMachine ??
|
|
273
274
|
new DefaultResubmitMachine(
|
|
274
|
-
|
|
275
|
+
(change: TaggedChange<TChange>) =>
|
|
276
|
+
changeFamily.rebaser.invert(change, true, this.mintRevisionTag()),
|
|
275
277
|
changeEnricher,
|
|
276
278
|
);
|
|
277
279
|
this.commitEnricher = new BranchCommitEnricher(changeFamily.rebaser, changeEnricher);
|
|
@@ -446,7 +448,7 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
446
448
|
const {
|
|
447
449
|
commit: { revision, change },
|
|
448
450
|
} = this.messageCodec.decode(content, { idCompressor: this.idCompressor });
|
|
449
|
-
this.editManager.localBranch.apply(change, revision);
|
|
451
|
+
this.editManager.localBranch.apply({ change, revision });
|
|
450
452
|
}
|
|
451
453
|
|
|
452
454
|
public override getGCData(fullGC?: boolean): IGarbageCollectionData {
|