@fluidframework/tree 2.81.1 → 2.82.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 +125 -0
- package/api-report/tree.alpha.api.md +54 -22
- package/api-report/tree.beta.api.md +150 -1
- package/api-report/tree.legacy.beta.api.md +150 -1
- package/api-report/tree.legacy.public.api.md +1 -0
- package/api-report/tree.public.api.md +1 -0
- package/dist/alpha.d.ts +8 -2
- package/dist/beta.d.ts +3 -0
- package/dist/codec/codec.d.ts +17 -8
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +8 -1
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +1 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +4 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +3 -2
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +4 -2
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +23 -3
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +30 -16
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/formatV1.d.ts +2 -2
- package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
- package/dist/core/schema-stored/formatV1.js +0 -5
- package/dist/core/schema-stored/formatV1.js.map +1 -1
- package/dist/core/schema-stored/formatV2.d.ts +11 -10
- package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
- package/dist/core/schema-stored/formatV2.js +1 -6
- package/dist/core/schema-stored/formatV2.js.map +1 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/delta.d.ts +9 -7
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/deltaUtil.js +1 -1
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/visitDelta.js +2 -2
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/extensibleSchemaUnion.d.ts +72 -0
- package/dist/extensibleSchemaUnion.d.ts.map +1 -0
- package/dist/extensibleSchemaUnion.js +79 -0
- package/dist/extensibleSchemaUnion.js.map +1 -0
- package/dist/feature-libraries/changeAtomIdBTree.d.ts +4 -2
- package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
- package/dist/feature-libraries/changeAtomIdBTree.js +9 -1
- package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -3
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +20 -21
- package/dist/feature-libraries/default-schema/defaultFieldKinds.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/forest-summary/codec.d.ts +2 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +5 -2
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +1 -39
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.js +1 -2
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV1.d.ts +1 -39
- package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV2.d.ts +1 -39
- package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +4 -3
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +42 -22
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.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 +2 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -5
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +11 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +30 -7
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +38 -27
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +10 -127
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -4
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +3 -79
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
- 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/requiredField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/requiredField.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +4 -4
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +2 -2
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -16
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +36 -13
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +1 -0
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +10 -0
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +25 -9
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +8 -32
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +11 -3
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +38 -4
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.d.ts +4 -4
- package/dist/shared-tree/tree.js +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +20 -0
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +39 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js +2 -2
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +14 -3
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +59 -16
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/versionedSummarizer.js +1 -1
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +3 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +9 -0
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +16 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +10 -0
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +81 -6
- 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/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +63 -0
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +43 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/index.js +2 -1
- package/dist/simple-tree/node-kinds/array/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/index.js +2 -1
- package/dist/simple-tree/node-kinds/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/tableSchema.d.ts +71 -48
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +200 -98
- package/dist/tableSchema.js.map +1 -1
- package/dist/text/textDomainFormatted.js +1 -1
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/util/bTreeUtils.d.ts +30 -4
- package/dist/util/bTreeUtils.d.ts.map +1 -1
- package/dist/util/bTreeUtils.js +29 -17
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/breakable.d.ts.map +1 -1
- package/dist/util/breakable.js +2 -1
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +6 -3
- package/dist/util/index.js.map +1 -1
- package/dist/util/opaque.d.ts.map +1 -1
- package/dist/util/opaque.js.map +1 -1
- package/dist/util/rangeMap.d.ts +3 -2
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +7 -1
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/readSnapshotBlob.d.ts +1 -1
- package/dist/util/readSnapshotBlob.d.ts.map +1 -1
- package/dist/util/readSnapshotBlob.js.map +1 -1
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/utils.d.ts +20 -16
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +49 -17
- package/dist/util/utils.js.map +1 -1
- package/eslint.config.mts +0 -9
- package/lib/alpha.d.ts +8 -2
- package/lib/beta.d.ts +3 -0
- package/lib/codec/codec.d.ts +17 -8
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +6 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +1 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +3 -2
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +23 -3
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +27 -15
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/formatV1.d.ts +2 -2
- package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
- package/lib/core/schema-stored/formatV1.js +0 -5
- package/lib/core/schema-stored/formatV1.js.map +1 -1
- package/lib/core/schema-stored/formatV2.d.ts +11 -10
- package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
- package/lib/core/schema-stored/formatV2.js +1 -6
- package/lib/core/schema-stored/formatV2.js.map +1 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +2 -0
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/delta.d.ts +9 -7
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/deltaUtil.js +1 -1
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/visitDelta.js +2 -2
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/extensibleSchemaUnion.d.ts +72 -0
- package/lib/extensibleSchemaUnion.d.ts.map +1 -0
- package/lib/extensibleSchemaUnion.js +76 -0
- package/lib/extensibleSchemaUnion.js.map +1 -0
- package/lib/feature-libraries/changeAtomIdBTree.d.ts +4 -2
- package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
- package/lib/feature-libraries/changeAtomIdBTree.js +7 -0
- package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -3
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +4 -5
- package/lib/feature-libraries/default-schema/defaultFieldKinds.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/forest-summary/codec.d.ts +2 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +6 -3
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +1 -39
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.js +2 -3
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV1.d.ts +1 -39
- package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV2.d.ts +1 -39
- package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +3 -3
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +41 -21
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.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 +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -6
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +11 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +29 -6
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +41 -30
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +10 -127
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -4
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +3 -79
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
- 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/requiredField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/requiredField.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +4 -4
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +2 -2
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -16
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -3
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +3 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +36 -13
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +1 -0
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +10 -0
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +25 -9
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +10 -34
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +11 -3
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +39 -5
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.d.ts +4 -4
- package/lib/shared-tree/tree.js +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +20 -0
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +39 -3
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js +2 -2
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +14 -3
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +61 -18
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/versionedSummarizer.js +1 -1
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +9 -0
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js +14 -0
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +10 -0
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +81 -6
- 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/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +63 -0
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +41 -0
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/index.js +1 -1
- package/lib/simple-tree/node-kinds/array/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/index.js +1 -1
- package/lib/simple-tree/node-kinds/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/tableSchema.d.ts +71 -48
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +201 -99
- package/lib/tableSchema.js.map +1 -1
- package/lib/text/textDomainFormatted.js +1 -1
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/util/bTreeUtils.d.ts +30 -4
- package/lib/util/bTreeUtils.d.ts.map +1 -1
- package/lib/util/bTreeUtils.js +27 -16
- package/lib/util/bTreeUtils.js.map +1 -1
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js.map +1 -1
- package/lib/util/breakable.d.ts.map +1 -1
- package/lib/util/breakable.js +2 -1
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/opaque.d.ts.map +1 -1
- package/lib/util/opaque.js.map +1 -1
- package/lib/util/rangeMap.d.ts +3 -2
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +7 -1
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/readSnapshotBlob.d.ts +1 -1
- package/lib/util/readSnapshotBlob.d.ts.map +1 -1
- package/lib/util/readSnapshotBlob.js.map +1 -1
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/utils.d.ts +20 -16
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +44 -15
- package/lib/util/utils.js.map +1 -1
- package/package.json +22 -22
- package/src/codec/codec.ts +30 -11
- package/src/codec/index.ts +2 -0
- package/src/codec/versioned/codec.ts +9 -13
- package/src/core/index.ts +3 -1
- package/src/core/rebase/changeRebaser.ts +3 -2
- package/src/core/rebase/index.ts +3 -1
- package/src/core/rebase/types.ts +51 -13
- package/src/core/schema-stored/formatV1.ts +2 -4
- package/src/core/schema-stored/formatV2.ts +9 -7
- package/src/core/schema-stored/index.ts +2 -0
- package/src/core/schema-stored/schema.ts +4 -1
- package/src/core/tree/anchorSet.ts +1 -3
- package/src/core/tree/delta.ts +9 -7
- package/src/core/tree/deltaUtil.ts +1 -1
- package/src/core/tree/visitDelta.ts +2 -2
- package/src/extensibleSchemaUnion.ts +135 -0
- package/src/feature-libraries/changeAtomIdBTree.ts +17 -2
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +5 -6
- package/src/feature-libraries/default-schema/index.ts +0 -1
- package/src/feature-libraries/forest-summary/codec.ts +7 -2
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +15 -3
- package/src/feature-libraries/forest-summary/formatCommon.ts +2 -3
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +4 -5
- package/src/feature-libraries/index.ts +3 -2
- package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +57 -31
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +1 -1
- package/src/feature-libraries/modular-schema/index.ts +4 -1
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +7 -6
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +32 -7
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +54 -33
- package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +2 -4
- package/src/feature-libraries/optional-field/optionalField.ts +1 -1
- package/src/feature-libraries/optional-field/requiredField.ts +2 -4
- package/src/feature-libraries/schema-index/codec.ts +1 -1
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +1 -1
- package/src/feature-libraries/sequence-field/invert.ts +2 -2
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +17 -10
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +1 -1
- package/src/index.ts +12 -7
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +42 -6
- package/src/shared-tree/index.ts +2 -0
- package/src/shared-tree/schematizingTreeView.ts +63 -18
- package/src/shared-tree/sharedTree.ts +19 -37
- package/src/shared-tree/sharedTreeChangeCodecs.ts +43 -9
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeCheckout.ts +50 -3
- package/src/shared-tree-core/editManagerSummarizer.ts +1 -1
- package/src/shared-tree-core/messageCodecV1ToV4.ts +4 -3
- package/src/shared-tree-core/transaction.ts +125 -23
- package/src/shared-tree-core/versionedSummarizer.ts +3 -2
- package/src/simple-tree/api/index.ts +1 -0
- package/src/simple-tree/api/schemaCreationUtilities.ts +35 -5
- package/src/simple-tree/api/simpleTreeIndex.ts +1 -1
- package/src/simple-tree/api/transactionTypes.ts +10 -0
- package/src/simple-tree/api/tree.ts +88 -6
- package/src/simple-tree/core/treeNodeSchema.ts +5 -8
- package/src/simple-tree/index.ts +3 -0
- package/src/simple-tree/leafNodeSchema.ts +3 -2
- package/src/simple-tree/node-kinds/array/arrayNode.ts +86 -0
- package/src/simple-tree/node-kinds/array/index.ts +2 -0
- package/src/simple-tree/node-kinds/index.ts +2 -0
- package/src/simple-tree/node-kinds/object/objectNode.ts +19 -18
- package/src/tableSchema.ts +280 -140
- package/src/text/textDomainFormatted.ts +1 -1
- package/src/util/bTreeUtils.ts +45 -26
- package/src/util/brand.ts +4 -12
- package/src/util/brandedMap.ts +2 -6
- package/src/util/breakable.ts +3 -2
- package/src/util/index.ts +9 -3
- package/src/util/opaque.ts +2 -6
- package/src/util/rangeMap.ts +11 -5
- package/src/util/readSnapshotBlob.ts +3 -3
- package/src/util/typeCheck.ts +11 -9
- package/src/util/utils.ts +57 -28
- package/biome.jsonc +0 -4
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { TreeAlpha, Tree } from "./shared-tree/index.js";
|
|
7
|
+
import type {
|
|
8
|
+
TreeNodeSchema,
|
|
9
|
+
TreeNodeFromImplicitAllowedTypes,
|
|
10
|
+
TreeFieldFromImplicitField,
|
|
11
|
+
ImplicitFieldSchema,
|
|
12
|
+
InsertableTreeFieldFromImplicitField,
|
|
13
|
+
SchemaFactoryBeta,
|
|
14
|
+
} from "./simple-tree/index.js";
|
|
15
|
+
import {
|
|
16
|
+
createCustomizedFluidFrameworkScopedFactory,
|
|
17
|
+
eraseSchemaDetailsSubclassable,
|
|
18
|
+
SchemaFactory,
|
|
19
|
+
TreeBeta,
|
|
20
|
+
} from "./simple-tree/index.js";
|
|
21
|
+
import type { UnionToIntersection } from "./util/index.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Utilities for creating extensible schema unions.
|
|
25
|
+
* @remarks
|
|
26
|
+
* Use {@link ExtensibleSchemaUnion.extensibleSchemaUnion} to create the union schema.
|
|
27
|
+
*
|
|
28
|
+
* Unlike a schema union created using {@link SchemaStaticsBeta.staged | staged} allowed types, this union allows for unknown future types to exist in addition to the known types.
|
|
29
|
+
* This allows for faster roll-outs of new types without waiting for old clients to be updated to be aware of them.
|
|
30
|
+
* This does mean however that old clients may see types they do not know about, which are simply exposed as `undefined` children.
|
|
31
|
+
*
|
|
32
|
+
* `staged` types are lower overhead, and might gain support for `unknown` types in the future, so prefer them when possible.
|
|
33
|
+
* This is simply an alternative for when future compatibility with unknown types is required.
|
|
34
|
+
* It is built on top of the existing {@link ObjectSchemaOptions.allowUnknownOptionalFields | allowUnknownOptionalFields} feature.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const sf = new SchemaFactoryBeta("extensibleSchemaUnionExample.items");
|
|
39
|
+
* class ItemA extends sf.object("A", { x: sf.string }) {}
|
|
40
|
+
* class ItemB extends sf.object("B", { x: sf.number }) {}
|
|
41
|
+
*
|
|
42
|
+
* class AnyItem extends ExtensibleSchemaUnion.extensibleSchemaUnion(
|
|
43
|
+
* [ItemA, ItemB], // Future versions may add more members here
|
|
44
|
+
* sf,
|
|
45
|
+
* "ExtensibleUnion",
|
|
46
|
+
* ) {}
|
|
47
|
+
* // Instances of the union are created using `create`.
|
|
48
|
+
* const anyItem = AnyItem.create(new ItemA({ x: "hello" }));
|
|
49
|
+
* // Reading the content from the union is done via `child`,
|
|
50
|
+
* // which can be `undefined` to handle the case where a future version of this schema allows a type unknown to the current version.
|
|
51
|
+
* const childNode: ItemA | ItemB | undefined = anyItem.child;
|
|
52
|
+
* // To determine which member of the union was present, its schema can be inspected:
|
|
53
|
+
* const aSchema = Tree.schema(childNode ?? assert.fail("No child"));
|
|
54
|
+
* assert.equal(aSchema, ItemA);
|
|
55
|
+
* ```
|
|
56
|
+
* @alpha
|
|
57
|
+
*/
|
|
58
|
+
export namespace ExtensibleSchemaUnion {
|
|
59
|
+
/**
|
|
60
|
+
* Members for classes created by {@link ExtensibleSchemaUnion.extensibleSchemaUnion}.
|
|
61
|
+
* @alpha
|
|
62
|
+
*/
|
|
63
|
+
export interface Members<T> {
|
|
64
|
+
/**
|
|
65
|
+
* The child wrapped by this node, which is has one of the type allowed by the union,
|
|
66
|
+
* or `undefined` if the type is one which was added to the union by a future version of this schema.
|
|
67
|
+
*/
|
|
68
|
+
readonly child: T | undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Statics for classes created by {@link ExtensibleSchemaUnion.extensibleSchemaUnion}.
|
|
73
|
+
* @alpha
|
|
74
|
+
*/
|
|
75
|
+
export interface Statics<T extends readonly TreeNodeSchema[]> {
|
|
76
|
+
/**
|
|
77
|
+
* Create a {@link TreeNode} with `this` schema which wraps the provided child to create the union.
|
|
78
|
+
*/
|
|
79
|
+
create<TThis extends TreeNodeSchema>(
|
|
80
|
+
this: TThis,
|
|
81
|
+
child: TreeNodeFromImplicitAllowedTypes<T>,
|
|
82
|
+
): TreeFieldFromImplicitField<TThis>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Create an extensible schema union which currently supports the types in `types`,
|
|
87
|
+
* but tolerates collaboration with future versions that may include additional types.
|
|
88
|
+
* @remarks
|
|
89
|
+
* See {@link ExtensibleSchemaUnion} for an example use.
|
|
90
|
+
* @alpha
|
|
91
|
+
*/
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
93
|
+
export function extensibleSchemaUnion<
|
|
94
|
+
const T extends readonly TreeNodeSchema[],
|
|
95
|
+
const TScope extends string,
|
|
96
|
+
const TName extends string,
|
|
97
|
+
>(types: T, inputSchemaFactory: SchemaFactoryBeta<TScope>, name: TName) {
|
|
98
|
+
const record: Record<string, ImplicitFieldSchema> = {};
|
|
99
|
+
for (const type of types) {
|
|
100
|
+
record[`_${type.identifier}`] = SchemaFactory.optional(type, { key: type.identifier });
|
|
101
|
+
}
|
|
102
|
+
const schemaFactory = createCustomizedFluidFrameworkScopedFactory(
|
|
103
|
+
inputSchemaFactory,
|
|
104
|
+
"extensibleSchemaUnion",
|
|
105
|
+
);
|
|
106
|
+
class Union
|
|
107
|
+
extends schemaFactory.object(name, record, { allowUnknownOptionalFields: true })
|
|
108
|
+
implements Members<TreeNodeFromImplicitAllowedTypes<T>>
|
|
109
|
+
{
|
|
110
|
+
public get child(): TreeNodeFromImplicitAllowedTypes<T> | undefined {
|
|
111
|
+
for (const [_key, child] of TreeAlpha.children(this)) {
|
|
112
|
+
return child as TreeNodeFromImplicitAllowedTypes<T>;
|
|
113
|
+
}
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public static create<TThis extends TreeNodeSchema>(
|
|
118
|
+
this: TThis,
|
|
119
|
+
child: TreeNodeFromImplicitAllowedTypes<T>,
|
|
120
|
+
): TreeFieldFromImplicitField<TThis> {
|
|
121
|
+
const schema = Tree.schema(child);
|
|
122
|
+
return TreeBeta.create(this, {
|
|
123
|
+
[`_${schema.identifier}`]: child,
|
|
124
|
+
} as unknown as InsertableTreeFieldFromImplicitField<
|
|
125
|
+
TThis,
|
|
126
|
+
UnionToIntersection<TThis>
|
|
127
|
+
>);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return eraseSchemaDetailsSubclassable<
|
|
131
|
+
Members<TreeNodeFromImplicitAllowedTypes<T>>,
|
|
132
|
+
Statics<T>
|
|
133
|
+
>()(Union);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
compareChangesetLocalIds,
|
|
8
|
+
comparePartialRevisions,
|
|
9
|
+
type ChangeAtomId,
|
|
10
|
+
type ChangesetLocalId,
|
|
11
|
+
type RevisionTag,
|
|
12
|
+
} from "../core/index.js";
|
|
13
|
+
import { createTupleComparator, newTupleBTree, type TupleBTree } from "../util/index.js";
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
16
|
* A BTree which uses ChangeAtomId flattened into a tuple as the key.
|
|
@@ -16,6 +22,15 @@ export type ChangeAtomIdBTree<V> = TupleBTree<
|
|
|
16
22
|
V
|
|
17
23
|
>;
|
|
18
24
|
|
|
25
|
+
/** Creates a new {@link ChangeAtomIdBTree} */
|
|
26
|
+
export function newChangeAtomIdBTree<V>(
|
|
27
|
+
entries?: [readonly [RevisionTag | undefined, ChangesetLocalId], V][],
|
|
28
|
+
): ChangeAtomIdBTree<V> {
|
|
29
|
+
return newTupleBTree(compareKeys, entries);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const compareKeys = createTupleComparator([comparePartialRevisions, compareChangesetLocalIds]);
|
|
33
|
+
|
|
19
34
|
export function getFromChangeAtomIdMap<T>(
|
|
20
35
|
map: ChangeAtomIdBTree<T>,
|
|
21
36
|
id: ChangeAtomId,
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
forbiddenFieldKindIdentifier,
|
|
13
13
|
Multiplicity,
|
|
14
14
|
} from "../../core/index.js";
|
|
15
|
-
import { brand, type Brand } from "../../util/index.js";
|
|
16
15
|
import { identifierFieldIdentifier } from "../fieldKindIdentifiers.js";
|
|
17
16
|
import {
|
|
18
17
|
type FieldChangeDelta,
|
|
@@ -22,6 +21,7 @@ import {
|
|
|
22
21
|
type FieldKindConfigurationEntry,
|
|
23
22
|
FlexFieldKind,
|
|
24
23
|
type FullSchemaPolicy,
|
|
24
|
+
ModularChangeFormatVersion,
|
|
25
25
|
type ToDelta,
|
|
26
26
|
referenceFreeFieldChangeRebaser,
|
|
27
27
|
} from "../modular-schema/index.js";
|
|
@@ -107,9 +107,9 @@ export const forbidden: Forbidden = new FlexFieldKind(
|
|
|
107
107
|
export const fieldKindConfigurations: ReadonlyMap<
|
|
108
108
|
ModularChangeFormatVersion,
|
|
109
109
|
FieldKindConfiguration
|
|
110
|
-
> = new Map([
|
|
110
|
+
> = new Map<ModularChangeFormatVersion, FieldKindConfiguration>([
|
|
111
111
|
[
|
|
112
|
-
|
|
112
|
+
ModularChangeFormatVersion.v3,
|
|
113
113
|
new Map<FieldKindIdentifier, FieldKindConfigurationEntry>([
|
|
114
114
|
[required.identifier, { kind: required, formatVersion: 2 }],
|
|
115
115
|
[optional.identifier, { kind: optional, formatVersion: 2 }],
|
|
@@ -119,7 +119,7 @@ export const fieldKindConfigurations: ReadonlyMap<
|
|
|
119
119
|
]),
|
|
120
120
|
],
|
|
121
121
|
[
|
|
122
|
-
|
|
122
|
+
ModularChangeFormatVersion.v4,
|
|
123
123
|
new Map<FieldKindIdentifier, FieldKindConfigurationEntry>([
|
|
124
124
|
[required.identifier, { kind: required, formatVersion: 2 }],
|
|
125
125
|
[optional.identifier, { kind: optional, formatVersion: 2 }],
|
|
@@ -129,7 +129,7 @@ export const fieldKindConfigurations: ReadonlyMap<
|
|
|
129
129
|
]),
|
|
130
130
|
],
|
|
131
131
|
[
|
|
132
|
-
|
|
132
|
+
ModularChangeFormatVersion.v5,
|
|
133
133
|
new Map<FieldKindIdentifier, FieldKindConfigurationEntry>([
|
|
134
134
|
[required.identifier, { kind: required, formatVersion: 2 }],
|
|
135
135
|
[optional.identifier, { kind: optional, formatVersion: 2 }],
|
|
@@ -140,7 +140,6 @@ export const fieldKindConfigurations: ReadonlyMap<
|
|
|
140
140
|
],
|
|
141
141
|
]);
|
|
142
142
|
|
|
143
|
-
export type ModularChangeFormatVersion = Brand<3 | 4 | 5, "ModularChangeFormatVersion">;
|
|
144
143
|
export function getCodecTreeForModularChangeFormat(
|
|
145
144
|
version: ModularChangeFormatVersion,
|
|
146
145
|
): CodecTree {
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
makeVersionedValidatedCodec,
|
|
19
19
|
} from "../../codec/index.js";
|
|
20
20
|
import type { FieldKey, ITreeCursorSynchronous } from "../../core/index.js";
|
|
21
|
-
import { brand } from "../../util/index.js";
|
|
21
|
+
import { brand, type JsonCompatibleReadOnly } from "../../util/index.js";
|
|
22
22
|
import type { FieldBatchCodec, FieldBatchEncodingContext } from "../chunked-forest/index.js";
|
|
23
23
|
|
|
24
24
|
import {
|
|
@@ -32,7 +32,12 @@ import {
|
|
|
32
32
|
* Uses field cursors
|
|
33
33
|
*/
|
|
34
34
|
export type FieldSet = ReadonlyMap<FieldKey, ITreeCursorSynchronous>;
|
|
35
|
-
export type ForestCodec = IJsonCodec<
|
|
35
|
+
export type ForestCodec = IJsonCodec<
|
|
36
|
+
FieldSet,
|
|
37
|
+
Format,
|
|
38
|
+
JsonCompatibleReadOnly,
|
|
39
|
+
FieldBatchEncodingContext
|
|
40
|
+
>;
|
|
36
41
|
|
|
37
42
|
/**
|
|
38
43
|
* Convert a MinimumVersionForCollab to a ForestFormatVersion.
|
|
@@ -32,7 +32,11 @@ import {
|
|
|
32
32
|
type SummaryElementParser,
|
|
33
33
|
type SummaryElementStringifier,
|
|
34
34
|
} from "../../shared-tree-core/index.js";
|
|
35
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
idAllocatorFromMaxId,
|
|
37
|
+
readAndParseSnapshotBlob,
|
|
38
|
+
type JsonCompatibleReadOnly,
|
|
39
|
+
} from "../../util/index.js";
|
|
36
40
|
// eslint-disable-next-line import-x/no-internal-modules
|
|
37
41
|
import { chunkFieldSingle, defaultChunkPolicy } from "../chunked-forest/chunkTree.js";
|
|
38
42
|
import {
|
|
@@ -211,7 +215,12 @@ export class ForestSummarizer
|
|
|
211
215
|
// TODO: this code is parsing data without an optional validator, this should be defined in a typebox schema as part of the
|
|
212
216
|
// forest summary format.
|
|
213
217
|
const fields = this.codec.decode(
|
|
214
|
-
await readAndParseSnapshotBlob(
|
|
218
|
+
(await readAndParseSnapshotBlob(
|
|
219
|
+
forestSummaryRootContentKey,
|
|
220
|
+
services,
|
|
221
|
+
parse,
|
|
222
|
+
// TODO: this type cast assumes there are no handles, which should probably be enforced at runtime or the need for this cast should be removed altogether.
|
|
223
|
+
)) as JsonCompatibleReadOnly,
|
|
215
224
|
{
|
|
216
225
|
...this.encoderContext,
|
|
217
226
|
incrementalEncoderDecoder: this.incrementalSummaryBuilder,
|
|
@@ -230,7 +239,10 @@ export class ForestSummarizer
|
|
|
230
239
|
id: buildId,
|
|
231
240
|
trees: chunked,
|
|
232
241
|
});
|
|
233
|
-
fieldChanges.push([
|
|
242
|
+
fieldChanges.push([
|
|
243
|
+
fieldKey,
|
|
244
|
+
{ marks: [{ count: chunked.topLevelLength, attach: buildId }] },
|
|
245
|
+
]);
|
|
234
246
|
}
|
|
235
247
|
|
|
236
248
|
assert(this.forest.isEmpty, 0x797 /* forest must be empty */);
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
import { type Static, Type } from "@sinclair/typebox";
|
|
7
7
|
|
|
8
8
|
import { schemaFormatV1 } from "../../core/index.js";
|
|
9
|
-
import { strictEnum, type Values } from "../../util/index.js";
|
|
10
|
-
import { EncodedFieldBatch } from "../chunked-forest/index.js";
|
|
9
|
+
import { strictEnum, type Values, JsonCompatibleReadOnlySchema } from "../../util/index.js";
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* The format version for the forest.
|
|
@@ -30,7 +29,7 @@ export const FormatCommon = (
|
|
|
30
29
|
{
|
|
31
30
|
version: Type.Literal(version),
|
|
32
31
|
keys: Type.Array(schemaFormatV1.FieldKeySchema),
|
|
33
|
-
fields:
|
|
32
|
+
fields: JsonCompatibleReadOnlySchema, // Uses field batch codec
|
|
34
33
|
},
|
|
35
34
|
{ additionalProperties: false },
|
|
36
35
|
);
|
|
@@ -276,9 +276,7 @@ export class ForestIncrementalSummaryBuilder implements IncrementalEncoderDecode
|
|
|
276
276
|
*/
|
|
277
277
|
public async load(args: {
|
|
278
278
|
services: IChannelStorageService;
|
|
279
|
-
readAndParseChunk:
|
|
280
|
-
chunkBlobPath: string,
|
|
281
|
-
) => Promise<T>;
|
|
279
|
+
readAndParseChunk: (chunkBlobPath: string) => Promise<JsonCompatible<IFluidHandle>>;
|
|
282
280
|
}): Promise<void> {
|
|
283
281
|
const forestTree = args.services.getSnapshotTree?.();
|
|
284
282
|
// Snapshot tree should be available when loading forest's contents. However, it is an optional function
|
|
@@ -303,8 +301,9 @@ export class ForestIncrementalSummaryBuilder implements IncrementalEncoderDecode
|
|
|
303
301
|
`SharedTree: Cannot find contents for incremental chunk ${chunkContentsPath}`,
|
|
304
302
|
);
|
|
305
303
|
}
|
|
306
|
-
const chunkContents =
|
|
307
|
-
|
|
304
|
+
const chunkContents = (await args.readAndParseChunk(
|
|
305
|
+
chunkContentsPath,
|
|
306
|
+
)) as EncodedFieldBatch; // TODO: this should use a codec to validate the data instead of just type casting.
|
|
308
307
|
this.loadedChunksMap.set(chunkReferenceId, {
|
|
309
308
|
encodedContents: chunkContents,
|
|
310
309
|
summaryPath: chunkSubTreePath,
|
|
@@ -48,8 +48,8 @@ export {
|
|
|
48
48
|
jsonableTreeFromForest,
|
|
49
49
|
} from "./treeTextCursor.js";
|
|
50
50
|
|
|
51
|
-
// Split this up into separate import and export for compatibility with API-Extractor.
|
|
52
51
|
import * as SequenceField from "./sequence-field/index.js";
|
|
52
|
+
// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor) or named exports (changes public API)
|
|
53
53
|
export { SequenceField };
|
|
54
54
|
|
|
55
55
|
export {
|
|
@@ -89,6 +89,7 @@ export {
|
|
|
89
89
|
type FieldKindConfigurationEntry,
|
|
90
90
|
isNeverTree,
|
|
91
91
|
DefaultRevisionReplacer,
|
|
92
|
+
ModularChangeFormatVersion,
|
|
92
93
|
} from "./modular-schema/index.js";
|
|
93
94
|
|
|
94
95
|
export { mapRootChanges } from "./deltaUtils.js";
|
|
@@ -139,7 +140,6 @@ export {
|
|
|
139
140
|
intoDelta,
|
|
140
141
|
relevantRemovedRoots,
|
|
141
142
|
getCodecTreeForModularChangeFormat,
|
|
142
|
-
type ModularChangeFormatVersion,
|
|
143
143
|
} from "./default-schema/index.js";
|
|
144
144
|
|
|
145
145
|
export {
|
|
@@ -210,6 +210,7 @@ export {
|
|
|
210
210
|
|
|
211
211
|
export {
|
|
212
212
|
type ChangeAtomIdBTree,
|
|
213
|
+
newChangeAtomIdBTree,
|
|
213
214
|
getFromChangeAtomIdMap,
|
|
214
215
|
setInChangeAtomIdMap,
|
|
215
216
|
} from "./changeAtomIdBTree.js";
|
|
@@ -3,28 +3,38 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { assert, fail } from "@fluidframework/core-utils/internal";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
newChangeAtomIdRangeMap,
|
|
10
|
+
offsetChangeAtomId,
|
|
11
|
+
type ChangeAtomId,
|
|
12
|
+
type ChangeAtomIdRangeMap,
|
|
13
|
+
type ChangesetLocalId,
|
|
14
|
+
type RevisionReplacer,
|
|
15
|
+
type RevisionTag,
|
|
11
16
|
} from "../../core/index.js";
|
|
12
|
-
import { brand, brandConst, newTupleBTree, type Mutable } from "../../util/index.js";
|
|
13
17
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
brand,
|
|
19
|
+
brandConst,
|
|
20
|
+
newIntegerRangeMap,
|
|
21
|
+
type RangeMap,
|
|
22
|
+
type Mutable,
|
|
23
|
+
} from "../../util/index.js";
|
|
24
|
+
|
|
25
|
+
const offsetChangesetLocalId = (value: ChangesetLocalId, offset: number): ChangesetLocalId =>
|
|
26
|
+
brand(value + offset);
|
|
18
27
|
|
|
19
28
|
export class DefaultRevisionReplacer implements RevisionReplacer {
|
|
20
29
|
/**
|
|
21
30
|
* Mapping from (obsolete revision tag, original local id) to the updated local id.
|
|
22
31
|
*/
|
|
23
|
-
private readonly updatedLocalIds:
|
|
32
|
+
private readonly updatedLocalIds: ChangeAtomIdRangeMap<ChangesetLocalId> =
|
|
33
|
+
newChangeAtomIdRangeMap(offsetChangesetLocalId);
|
|
24
34
|
/**
|
|
25
35
|
* The set of local IDs already used in the scope of the updated revision.
|
|
26
36
|
*/
|
|
27
|
-
private readonly localIds:
|
|
37
|
+
private readonly localIds: RangeMap<ChangesetLocalId, true> = newIntegerRangeMap();
|
|
28
38
|
/**
|
|
29
39
|
* The maximum local ID seen so far in the scope of the updated revision.
|
|
30
40
|
*/
|
|
@@ -39,29 +49,45 @@ export class DefaultRevisionReplacer implements RevisionReplacer {
|
|
|
39
49
|
return this.obsoleteRevisions.has(revision);
|
|
40
50
|
}
|
|
41
51
|
|
|
42
|
-
public getUpdatedAtomId<T extends ChangeAtomId>(id: T): T {
|
|
52
|
+
public getUpdatedAtomId<T extends ChangeAtomId>(id: T, count: number = 1): T {
|
|
53
|
+
assert(count >= 1, 0xcc9 /* Count must be at least 1 */);
|
|
43
54
|
if (this.isObsolete(id.revision)) {
|
|
44
55
|
const updated: Mutable<T> = { ...id, revision: this.updatedRevision };
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
let continuingOutputId: ChangesetLocalId | undefined;
|
|
57
|
+
let remainderCount = count;
|
|
58
|
+
let remainderStart = id;
|
|
59
|
+
while (remainderCount > 0) {
|
|
60
|
+
const prior = this.updatedLocalIds.getFirst(remainderStart, remainderCount);
|
|
61
|
+
if (prior.value === undefined) {
|
|
62
|
+
const defaultOutputId = continuingOutputId ?? remainderStart.localId;
|
|
63
|
+
const newLocalId =
|
|
64
|
+
this.localIds.getAll(defaultOutputId, prior.length).length > 0
|
|
65
|
+
? // Some of the IDs in this range have already been used in the scope of the updated revision.
|
|
66
|
+
// We need to allocate new local IDs.
|
|
67
|
+
brand<ChangesetLocalId>(this.maxSeen + 1)
|
|
68
|
+
: // This change atom ID uses a local ID that has not yet been used in the scope of the updated revision.
|
|
69
|
+
// We reuse it as is to minimize the number of IDs that need to be updated.
|
|
70
|
+
defaultOutputId;
|
|
71
|
+
|
|
72
|
+
this.maxSeen = brand(Math.max(this.maxSeen, newLocalId + prior.length - 1));
|
|
73
|
+
this.localIds.set(newLocalId, prior.length, true);
|
|
74
|
+
this.updatedLocalIds.set(remainderStart, prior.length, newLocalId);
|
|
75
|
+
if (continuingOutputId === undefined) {
|
|
76
|
+
updated.localId = newLocalId;
|
|
77
|
+
} else if (newLocalId !== continuingOutputId) {
|
|
78
|
+
fail(0xcca /* TODO: Handle non-contiguous ranges */);
|
|
79
|
+
}
|
|
80
|
+
continuingOutputId = offsetChangesetLocalId(newLocalId, prior.length);
|
|
54
81
|
} else {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
82
|
+
if (continuingOutputId === undefined) {
|
|
83
|
+
updated.localId = prior.value;
|
|
84
|
+
} else if (prior.value !== continuingOutputId) {
|
|
85
|
+
fail(0xccb /* TODO: Handle non-contiguous ranges */);
|
|
86
|
+
}
|
|
87
|
+
continuingOutputId = offsetChangesetLocalId(prior.value, prior.length);
|
|
60
88
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} else {
|
|
64
|
-
updated.localId = prior;
|
|
89
|
+
remainderStart = offsetChangeAtomId(remainderStart, prior.length);
|
|
90
|
+
remainderCount -= prior.length;
|
|
65
91
|
}
|
|
66
92
|
return updated;
|
|
67
93
|
}
|
|
@@ -60,7 +60,7 @@ export const genericChangeHandler: FieldChangeHandler<GenericChangeset> = {
|
|
|
60
60
|
markList.push({ count: 1, fields: deltaFromChild(nodeChange) });
|
|
61
61
|
nodeIndex += 1;
|
|
62
62
|
}
|
|
63
|
-
return { local: markList };
|
|
63
|
+
return { local: { marks: markList } };
|
|
64
64
|
},
|
|
65
65
|
relevantRemovedRoots,
|
|
66
66
|
isEmpty: (change: GenericChangeset): boolean => change.length === 0,
|
|
@@ -74,7 +74,10 @@ export {
|
|
|
74
74
|
relevantRemovedRoots,
|
|
75
75
|
updateRefreshers,
|
|
76
76
|
} from "./modularChangeFamily.js";
|
|
77
|
-
export {
|
|
77
|
+
export {
|
|
78
|
+
ModularChangeFormatVersion,
|
|
79
|
+
makeModularChangeCodecFamily,
|
|
80
|
+
} from "./modularChangeCodecs.js";
|
|
78
81
|
export type {
|
|
79
82
|
FieldKindConfiguration,
|
|
80
83
|
FieldKindConfigurationEntry,
|
|
@@ -30,9 +30,8 @@ import {
|
|
|
30
30
|
type Mutable,
|
|
31
31
|
brand,
|
|
32
32
|
idAllocatorFromMaxId,
|
|
33
|
-
newTupleBTree,
|
|
34
33
|
} from "../../util/index.js";
|
|
35
|
-
import type
|
|
34
|
+
import { newChangeAtomIdBTree, type ChangeAtomIdBTree } from "../changeAtomIdBTree.js";
|
|
36
35
|
import {
|
|
37
36
|
type FieldBatchCodec,
|
|
38
37
|
type TreeChunk,
|
|
@@ -364,7 +363,7 @@ export function decodeDetachedNodes(
|
|
|
364
363
|
});
|
|
365
364
|
};
|
|
366
365
|
|
|
367
|
-
const map: ModularChangeset["builds"] =
|
|
366
|
+
const map: ModularChangeset["builds"] = newChangeAtomIdBTree();
|
|
368
367
|
// eslint-disable-next-line unicorn/no-array-for-each -- Codec internals: minimizing changes to serialization logic
|
|
369
368
|
encoded.builds.forEach((build) => {
|
|
370
369
|
// EncodedRevisionTag cannot be an array so this ensures that we can isolate the tuple
|
|
@@ -396,7 +395,9 @@ export function encodeRevisionInfos(
|
|
|
396
395
|
): EncodedRevisionInfo[] | undefined {
|
|
397
396
|
if (context.revision !== undefined) {
|
|
398
397
|
assert(
|
|
398
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- Using optional chaining here would change behavior: `revisions[0]?.rollbackOf === undefined` is true when revisions[0] is undefined, but this check requires revisions[0] to be defined. As currently written, such a change would be safe because context.revision is included in the check and from a couple lines above is confirmed not undefined. But this more verbose form is clearer.
|
|
399
399
|
revisions.length === 1 &&
|
|
400
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
400
401
|
revisions[0] !== undefined &&
|
|
401
402
|
revisions[0].revision === context.revision &&
|
|
402
403
|
revisions[0].rollbackOf === undefined,
|
|
@@ -525,9 +526,9 @@ export function decodeChange(
|
|
|
525
526
|
): Mutable<ModularChangeset> {
|
|
526
527
|
const decoded: Mutable<ModularChangeset> = {
|
|
527
528
|
fieldChanges: new Map(),
|
|
528
|
-
nodeChanges:
|
|
529
|
-
nodeToParent:
|
|
530
|
-
nodeAliases:
|
|
529
|
+
nodeChanges: newChangeAtomIdBTree(),
|
|
530
|
+
nodeToParent: newChangeAtomIdBTree(),
|
|
531
|
+
nodeAliases: newChangeAtomIdBTree(),
|
|
531
532
|
crossFieldKeys: newCrossFieldKeyTable(),
|
|
532
533
|
};
|
|
533
534
|
|
|
@@ -16,6 +16,7 @@ import type {
|
|
|
16
16
|
EncodedRevisionTag,
|
|
17
17
|
RevisionTag,
|
|
18
18
|
} from "../../core/index.js";
|
|
19
|
+
import { strictEnum, type Values } from "../../util/index.js";
|
|
19
20
|
import type { FieldBatchCodec } from "../chunked-forest/index.js";
|
|
20
21
|
import { TreeCompressionStrategy } from "../treeCompressionUtils.js";
|
|
21
22
|
|
|
@@ -25,7 +26,7 @@ import { makeModularChangeCodecV2 } from "./modularChangeCodecV2.js";
|
|
|
25
26
|
import type { ModularChangeset } from "./modularChangeTypes.js";
|
|
26
27
|
|
|
27
28
|
export function makeModularChangeCodecFamily(
|
|
28
|
-
fieldKindConfigurations: ReadonlyMap<
|
|
29
|
+
fieldKindConfigurations: ReadonlyMap<ModularChangeFormatVersion, FieldKindConfiguration>,
|
|
29
30
|
revisionTagCodec: IJsonCodec<
|
|
30
31
|
RevisionTag,
|
|
31
32
|
EncodedRevisionTag,
|
|
@@ -39,11 +40,8 @@ export function makeModularChangeCodecFamily(
|
|
|
39
40
|
return makeCodecFamily(
|
|
40
41
|
Array.from(fieldKindConfigurations.entries(), ([version, fieldKinds]) => {
|
|
41
42
|
switch (version) {
|
|
42
|
-
case
|
|
43
|
-
case
|
|
44
|
-
case 3:
|
|
45
|
-
case 4:
|
|
46
|
-
case 6: {
|
|
43
|
+
case ModularChangeFormatVersion.v3:
|
|
44
|
+
case ModularChangeFormatVersion.v4: {
|
|
47
45
|
return [
|
|
48
46
|
version,
|
|
49
47
|
makeModularChangeCodecV1(
|
|
@@ -55,7 +53,7 @@ export function makeModularChangeCodecFamily(
|
|
|
55
53
|
),
|
|
56
54
|
];
|
|
57
55
|
}
|
|
58
|
-
case
|
|
56
|
+
case ModularChangeFormatVersion.v5: {
|
|
59
57
|
return [
|
|
60
58
|
version,
|
|
61
59
|
makeModularChangeCodecV2(
|
|
@@ -74,3 +72,30 @@ export function makeModularChangeCodecFamily(
|
|
|
74
72
|
}),
|
|
75
73
|
);
|
|
76
74
|
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The format version for `ModularChangeset`.
|
|
78
|
+
*/
|
|
79
|
+
export const ModularChangeFormatVersion = strictEnum("ModularChangeFormatVersion", {
|
|
80
|
+
/**
|
|
81
|
+
* Introduced prior to 2.0 and used beyond.
|
|
82
|
+
* Reading capability must be maintained for backwards compatibility.
|
|
83
|
+
* Writing capability needs to be maintained so long as {@link lowestMinVersionForCollab} is less than 2.2.0.
|
|
84
|
+
*/
|
|
85
|
+
v3: 3,
|
|
86
|
+
/**
|
|
87
|
+
* Introduced in 2.2.0.
|
|
88
|
+
* Was inadvertently made usable for writing in 2.43.0 (through configuredSharedTree) and remains available.
|
|
89
|
+
* Reading capability must be maintained for backwards compatibility.
|
|
90
|
+
* Writing capability could be dropped in favor of {@link ModularChangeFormatVersion.v3},
|
|
91
|
+
* but doing so would make the pattern of writable versions more complex and gain little
|
|
92
|
+
* because the logic for this format is shared with {@link ModularChangeFormatVersion.v3}.
|
|
93
|
+
*/
|
|
94
|
+
v4: 4,
|
|
95
|
+
/**
|
|
96
|
+
* Introduced and made available for writing in 2.80.0
|
|
97
|
+
* Adds support for "no change" constraints.
|
|
98
|
+
*/
|
|
99
|
+
v5: 5,
|
|
100
|
+
});
|
|
101
|
+
export type ModularChangeFormatVersion = Values<typeof ModularChangeFormatVersion>;
|