@fluidframework/tree 2.116.1 → 2.118.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 +202 -0
- package/api-report/tree.alpha.api.md +122 -31
- package/api-report/tree.beta.api.md +50 -9
- package/api-report/tree.legacy.beta.api.md +50 -9
- package/dist/codec/codec.d.ts +18 -0
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +18 -0
- package/dist/codec/codec.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +39 -2
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +37 -2
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +1 -0
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/revertible.d.ts +62 -6
- package/dist/core/revertible.d.ts.map +1 -1
- package/dist/core/revertible.js.map +1 -1
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/entrypoints/beta.d.ts +1 -1
- package/dist/entrypoints/beta.d.ts.map +1 -1
- package/dist/entrypoints/beta.js.map +1 -1
- package/dist/entrypoints/legacy.d.ts +1 -1
- package/dist/entrypoints/legacy.d.ts.map +1 -1
- package/dist/entrypoints/legacy.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/types.d.ts +1 -1
- package/dist/feature-libraries/indexing/types.js.map +1 -1
- package/dist/feature-libraries/schemaChecker.d.ts +9 -19
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +130 -46
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/history.d.ts +22 -0
- package/dist/shared-tree/history.d.ts.map +1 -0
- package/dist/shared-tree/history.js +66 -0
- package/dist/shared-tree/history.js.map +1 -0
- package/dist/shared-tree/schematizingTreeView.d.ts +24 -9
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +61 -11
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -0
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/tree.js +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +8 -20
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +9 -12
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +16 -9
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +122 -25
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.d.ts +3 -2
- package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js +3 -0
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +16 -2
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +20 -2
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitCounter.d.ts +31 -0
- package/dist/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
- package/dist/shared-tree-core/branchCommitCounter.js +79 -0
- package/dist/shared-tree-core/branchCommitCounter.js.map +1 -0
- package/dist/shared-tree-core/customMetadataCodec.d.ts +9 -0
- package/dist/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
- package/dist/shared-tree-core/customMetadataCodec.js +37 -0
- package/dist/shared-tree-core/customMetadataCodec.js.map +1 -0
- package/dist/shared-tree-core/customMetadataFormat.d.ts +18 -0
- package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/customMetadataFormat.js +15 -0
- package/dist/shared-tree-core/customMetadataFormat.js.map +1 -0
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +15 -3
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +5 -0
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +17 -5
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +18 -8
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -3
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +2 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js +12 -3
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +5 -0
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +1 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +6 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +10 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +2 -0
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +4 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +9 -0
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +26 -4
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +4 -4
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +36 -3
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +40 -14
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -2
- 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/schemaCompatibilityTester.d.ts +22 -3
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +140 -10
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +28 -2
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +353 -68
- 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/toStored.d.ts +7 -0
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +2 -2
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/tableSchema.js +10 -10
- package/dist/tableSchema.js.map +1 -1
- package/docs/main/glossary.md +163 -0
- package/lib/codec/codec.d.ts +18 -0
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +18 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +39 -2
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +35 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +1 -0
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/revertible.d.ts +62 -6
- package/lib/core/revertible.d.ts.map +1 -1
- package/lib/core/revertible.js.map +1 -1
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/entrypoints/beta.d.ts +1 -1
- package/lib/entrypoints/beta.d.ts.map +1 -1
- package/lib/entrypoints/beta.js.map +1 -1
- package/lib/entrypoints/legacy.d.ts +1 -1
- package/lib/entrypoints/legacy.d.ts.map +1 -1
- package/lib/entrypoints/legacy.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/types.d.ts +1 -1
- package/lib/feature-libraries/indexing/types.js.map +1 -1
- package/lib/feature-libraries/schemaChecker.d.ts +9 -19
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +133 -49
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/history.d.ts +22 -0
- package/lib/shared-tree/history.d.ts.map +1 -0
- package/lib/shared-tree/history.js +62 -0
- package/lib/shared-tree/history.js.map +1 -0
- package/lib/shared-tree/schematizingTreeView.d.ts +24 -9
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +62 -12
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -0
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/tree.js +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +8 -20
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +9 -12
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +16 -9
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +123 -26
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.d.ts +3 -2
- package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js +3 -0
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +16 -2
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +20 -2
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitCounter.d.ts +31 -0
- package/lib/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
- package/lib/shared-tree-core/branchCommitCounter.js +75 -0
- package/lib/shared-tree-core/branchCommitCounter.js.map +1 -0
- package/lib/shared-tree-core/customMetadataCodec.d.ts +9 -0
- package/lib/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
- package/lib/shared-tree-core/customMetadataCodec.js +32 -0
- package/lib/shared-tree-core/customMetadataCodec.js.map +1 -0
- package/lib/shared-tree-core/customMetadataFormat.d.ts +18 -0
- package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/customMetadataFormat.js +11 -0
- package/lib/shared-tree-core/customMetadataFormat.js.map +1 -0
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +16 -4
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +5 -0
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +17 -5
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +18 -8
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +4 -3
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +2 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +1 -0
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js +12 -3
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +5 -0
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +1 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +6 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +10 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js +2 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +5 -3
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +9 -0
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +27 -5
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +4 -4
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +36 -3
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +40 -14
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -2
- 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/schemaCompatibilityTester.d.ts +22 -3
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +136 -7
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +28 -2
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +353 -68
- 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/toStored.d.ts +7 -0
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +3 -3
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/tableSchema.js +10 -10
- package/lib/tableSchema.js.map +1 -1
- package/package.json +22 -22
- package/src/codec/codec.ts +19 -0
- package/src/core/index.ts +4 -0
- package/src/core/rebase/index.ts +2 -0
- package/src/core/rebase/types.ts +72 -2
- package/src/core/rebase/utils.ts +1 -0
- package/src/core/revertible.ts +67 -6
- package/src/entrypoints/alpha.ts +11 -0
- package/src/entrypoints/beta.ts +3 -0
- package/src/entrypoints/legacy.ts +3 -0
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/indexing/types.ts +1 -1
- package/src/feature-libraries/schemaChecker.ts +198 -82
- package/src/index.ts +11 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/history.ts +99 -0
- package/src/shared-tree/schematizingTreeView.ts +100 -29
- package/src/shared-tree/sharedTree.ts +5 -2
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +17 -35
- package/src/shared-tree/treeCheckout.ts +170 -31
- package/src/shared-tree/unhydratedTreeContext.ts +6 -2
- package/src/shared-tree-core/branch.ts +34 -2
- package/src/shared-tree-core/branchCommitCounter.ts +103 -0
- package/src/shared-tree-core/customMetadataCodec.ts +42 -0
- package/src/shared-tree-core/customMetadataFormat.ts +39 -0
- package/src/shared-tree-core/editManager.ts +22 -3
- package/src/shared-tree-core/editManagerCodecs.ts +12 -0
- package/src/shared-tree-core/editManagerCodecsCommons.ts +41 -15
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +7 -1
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -0
- package/src/shared-tree-core/editManagerFormatCommons.ts +46 -12
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +13 -5
- package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -2
- package/src/shared-tree-core/index.ts +3 -0
- package/src/shared-tree-core/messageCodecV1ToV4.ts +18 -5
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +9 -2
- package/src/shared-tree-core/messageCodecs.ts +12 -0
- package/src/shared-tree-core/messageFormat.ts +6 -0
- package/src/shared-tree-core/messageFormatV1ToV4.ts +21 -3
- package/src/shared-tree-core/messageFormatVSharedBranches.ts +8 -0
- package/src/shared-tree-core/sharedTreeCore.ts +5 -2
- package/src/shared-tree-core/transaction.ts +56 -4
- package/src/simple-tree/api/configuration.ts +4 -4
- package/src/simple-tree/api/discrepancies.ts +100 -5
- package/src/simple-tree/api/index.ts +12 -1
- package/src/simple-tree/api/schemaCompatibilityTester.ts +185 -11
- package/src/simple-tree/api/transactionTypes.ts +29 -2
- package/src/simple-tree/api/tree.ts +384 -68
- package/src/simple-tree/core/toStored.ts +8 -0
- package/src/simple-tree/core/treeNodeValid.ts +3 -1
- package/src/simple-tree/index.ts +9 -0
- package/src/tableSchema.ts +9 -9
- package/docs/main/runtime-schema-upgrade.md +0 -208
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert, fail } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
7
|
+
import { tagSchemaArtifacts, UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
8
|
|
|
9
9
|
import { type FlexTreeNode, isFlexTreeNode } from "../../feature-libraries/index.js";
|
|
10
10
|
|
|
@@ -135,6 +135,7 @@ export abstract class TreeNodeValid<TInput> extends TreeNode {
|
|
|
135
135
|
}) which derived from the same SchemaFactory generated class (${JSON.stringify(
|
|
136
136
|
this.identifier,
|
|
137
137
|
)}). This is invalid.`,
|
|
138
|
+
tagSchemaArtifacts({ schemaIdentifier: this.identifier }),
|
|
138
139
|
);
|
|
139
140
|
}
|
|
140
141
|
|
|
@@ -237,6 +238,7 @@ export function schemaAsTreeNodeValid(
|
|
|
237
238
|
`Schema for ${JSON.stringify(
|
|
238
239
|
schema.identifier,
|
|
239
240
|
)} does not extend a SchemaFactory generated class. This is invalid.`,
|
|
241
|
+
tagSchemaArtifacts({ schemaIdentifier: schema.identifier }),
|
|
240
242
|
);
|
|
241
243
|
}
|
|
242
244
|
|
package/src/simple-tree/index.ts
CHANGED
|
@@ -67,6 +67,7 @@ export {
|
|
|
67
67
|
export { walkFieldSchema } from "./walkFieldSchema.js";
|
|
68
68
|
export type { UnsafeUnknownSchema, Insertable } from "./unsafeUnknownSchema.js";
|
|
69
69
|
export {
|
|
70
|
+
type CommitRevision,
|
|
70
71
|
type ITree,
|
|
71
72
|
type TreeView,
|
|
72
73
|
type ViewableTree,
|
|
@@ -76,6 +77,8 @@ export {
|
|
|
76
77
|
type ITreeViewConfiguration,
|
|
77
78
|
type ITreeViewConfigurationAlpha,
|
|
78
79
|
type SchemaCompatibilityStatus,
|
|
80
|
+
type SchemaCompatibilityStatusBeta,
|
|
81
|
+
type SchemaDiscrepancy,
|
|
79
82
|
type ITreeConfigurationOptions,
|
|
80
83
|
SchemaFactory,
|
|
81
84
|
scoped,
|
|
@@ -136,6 +139,7 @@ export {
|
|
|
136
139
|
type TreeSchemaEncodingOptions,
|
|
137
140
|
getJsonSchema,
|
|
138
141
|
getSimpleSchema,
|
|
142
|
+
type StagedUpgradeStatus,
|
|
139
143
|
type VerboseTreeNode,
|
|
140
144
|
type TreeEncodingOptions,
|
|
141
145
|
type VerboseTree,
|
|
@@ -143,6 +147,7 @@ export {
|
|
|
143
147
|
comparePersistedSchema,
|
|
144
148
|
type ConciseTree,
|
|
145
149
|
checkSchemaCompatibility,
|
|
150
|
+
getSchemaIncompatibilityDetails,
|
|
146
151
|
type Unenforced,
|
|
147
152
|
type System_Unsafe,
|
|
148
153
|
type ArrayNodeCustomizableSchemaUnsafe,
|
|
@@ -159,9 +164,13 @@ export {
|
|
|
159
164
|
type InsertableObjectFromSchemaRecordAlphaUnsafe,
|
|
160
165
|
type TreeViewAlpha,
|
|
161
166
|
type TreeViewBeta,
|
|
167
|
+
type UntypedTreeView,
|
|
162
168
|
type TreeBranch,
|
|
163
169
|
type TreeBranchAlpha,
|
|
170
|
+
type UntypedTreeViewAlpha,
|
|
164
171
|
type TreeBranchEvents,
|
|
172
|
+
type TreeBranchCommitMetadata,
|
|
173
|
+
type TreeBranchHistory,
|
|
165
174
|
getPropertyKeyFromStoredKey,
|
|
166
175
|
getStoredKey,
|
|
167
176
|
tryGetSchema,
|
package/src/tableSchema.ts
CHANGED
|
@@ -1123,19 +1123,14 @@ export namespace System_TableSchema {
|
|
|
1123
1123
|
preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
|
|
1124
1124
|
}): void {
|
|
1125
1125
|
const { applyEdits, preconditions, preconditionsOnRevert } = options;
|
|
1126
|
-
const
|
|
1126
|
+
const context = TreeAlpha.context(this);
|
|
1127
1127
|
|
|
1128
1128
|
// Ensure events are paused until all of the edits are applied.
|
|
1129
1129
|
// This ensures that the user sees the corresponding table-level edit as atomic,
|
|
1130
1130
|
// and ensures they are not spammed with intermediate events.
|
|
1131
1131
|
withBufferedTreeEvents(() => {
|
|
1132
|
-
if (
|
|
1133
|
-
|
|
1134
|
-
// I.e., it is not part of a collaborative session yet.
|
|
1135
|
-
// Therefore, we don't need to run the edits as a transaction.
|
|
1136
|
-
applyEdits();
|
|
1137
|
-
} else {
|
|
1138
|
-
branch.runTransaction(
|
|
1132
|
+
if (context.isView()) {
|
|
1133
|
+
context.runTransaction(
|
|
1139
1134
|
() => {
|
|
1140
1135
|
applyEdits();
|
|
1141
1136
|
if (preconditionsOnRevert !== undefined) {
|
|
@@ -1144,6 +1139,11 @@ export namespace System_TableSchema {
|
|
|
1144
1139
|
},
|
|
1145
1140
|
preconditions === undefined ? undefined : { preconditions },
|
|
1146
1141
|
);
|
|
1142
|
+
} else {
|
|
1143
|
+
// If this node does not have a corresponding view, then it is unhydrated.
|
|
1144
|
+
// I.e., it is not part of a collaborative session yet.
|
|
1145
|
+
// Therefore, we don't need to run the edits as a transaction.
|
|
1146
|
+
applyEdits();
|
|
1147
1147
|
}
|
|
1148
1148
|
});
|
|
1149
1149
|
}
|
|
@@ -1168,7 +1168,7 @@ export namespace System_TableSchema {
|
|
|
1168
1168
|
#buildColumnInDocumentConstraintsForRows(
|
|
1169
1169
|
rows: Iterable<RowValueType>,
|
|
1170
1170
|
): TransactionConstraintAlpha[] | undefined {
|
|
1171
|
-
if (!TreeAlpha.context(this).
|
|
1171
|
+
if (!TreeAlpha.context(this).isView()) {
|
|
1172
1172
|
return undefined;
|
|
1173
1173
|
}
|
|
1174
1174
|
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
# Runtime Schema Upgrade Mechanism
|
|
2
|
-
|
|
3
|
-
> This document was generated by AI. It is intended for consumption by AI agents when working on this feature. Any change to the Runtime Schema Upgrade Mechanism should also update this document so future agents have current design context.
|
|
4
|
-
|
|
5
|
-
## Summary
|
|
6
|
-
|
|
7
|
-
Runtime schema upgrades let an application opt specific staged schema upgrades into stored schema when initializing a document or upgrading its stored schema.
|
|
8
|
-
A staged schema upgrade is a schema upgrade that is declared in view schema but omitted from stored schema unless the application explicitly enables it.
|
|
9
|
-
|
|
10
|
-
Enabled upgrades are provided at view construction time via `stagedUpgradePolicy` in alpha configuration passed to `viewWith`.
|
|
11
|
-
The configured policy is fixed for that view instance and cannot be changed later through view APIs.
|
|
12
|
-
|
|
13
|
-
This keeps the view schema and upgrade policy together in one place: the view configuration.
|
|
14
|
-
Compatibility checking and schema generation both use that same construction-time upgrade set.
|
|
15
|
-
|
|
16
|
-
## Problem
|
|
17
|
-
|
|
18
|
-
### Testing Future Documents
|
|
19
|
-
|
|
20
|
-
Problem: There is currently no easy way to create a test document that simulates a future version having completed a staged schema upgrade.
|
|
21
|
-
Declaring a staged schema upgrade in the view schema is not enough to change the document: `initialize` and `upgradeSchema` only make that upgrade usable when they include it in the stored schema.
|
|
22
|
-
As a result, an application cannot easily test whether the current version works correctly with documents created or upgraded by a future version.
|
|
23
|
-
|
|
24
|
-
Solution: tests construct a view with an alpha configuration that includes selected staged schema upgrades which get applied to the stored schema when calling `initialize` or `upgradeSchema`.
|
|
25
|
-
This makes it possible to create documents whose stored schema matches the state a future version would produce, while still running the test against the current application code.
|
|
26
|
-
|
|
27
|
-
### Production Rollout Control
|
|
28
|
-
|
|
29
|
-
Problem: In production, developers often need to deploy code that can read and write an upgraded schema before they are ready to enable that schema in documents.
|
|
30
|
-
Without a runtime enablement mechanism, code rollout and feature rollout are coupled: once the staged schema upgrade stops being excluded from stored schema, all relevant documents may begin accepting the upgraded shape.
|
|
31
|
-
This is risky for teams that need gradual rollout, monitoring, or fast rollback but do not have sophisticated slow-rollout tooling.
|
|
32
|
-
|
|
33
|
-
Solution: applications derive `stagedUpgradePolicy` from feature flags and include it in view construction options.
|
|
34
|
-
Code rollout can deploy support for the upgraded schema first, and feature rollout can later enable the staged schema upgrade by constructing views with the relevant `SchemaUpgrade` values.
|
|
35
|
-
If the feature needs to be rolled back, applications stop constructing views with those values for documents that have not already been upgraded.
|
|
36
|
-
|
|
37
|
-
The general production rollout process is:
|
|
38
|
-
|
|
39
|
-
1. Deploy code that understands both the current schema and the upgraded schema.
|
|
40
|
-
Views are constructed with alpha configuration that includes `stagedUpgradePolicy`, but the flag initially leaves it as `undefined` (restrictive default).
|
|
41
|
-
2. Enable the feature-rollout control.
|
|
42
|
-
New views are constructed with the relevant `SchemaUpgrade` values enabled.
|
|
43
|
-
3. Existing documents are upgraded through `upgradeSchema`.
|
|
44
|
-
A schema op is sequenced for each upgraded document.
|
|
45
|
-
Once the op is in the document, all clients observe the upgraded stored schema, including clients whose local feature flag is off.
|
|
46
|
-
4. New documents initialized while the control is enabled include the same staged schema upgrades from the start.
|
|
47
|
-
5. If an issue is found, disable the feature-rollout control.
|
|
48
|
-
Callers stop constructing views with the relevant entries for documents that have not yet been upgraded and newly initialized documents do not include those staged schema members.
|
|
49
|
-
Note: this selective rollback plan is currently difficult in practice.
|
|
50
|
-
If a document has already enabled a staged upgrade, later calling `upgradeSchema` from a view configured without that token throws a `UsageError` because the request would narrow stored schema.
|
|
51
|
-
In most deployments it is hard to target only documents that have not already been upgraded, so this step is not generally feasible as written.
|
|
52
|
-
|
|
53
|
-
Documents upgraded before the rollback continue to support the upgraded schema because their stored schema has already changed.
|
|
54
|
-
Documents created after the rollback do not include that upgrade unless the flag is enabled again.
|
|
55
|
-
|
|
56
|
-
## Goals
|
|
57
|
-
|
|
58
|
-
- Allow callers to enable selected staged schema upgrades during `initialize`.
|
|
59
|
-
- Allow callers to enable selected staged schema upgrades during `upgradeSchema`.
|
|
60
|
-
- Make enabling an upgrade granular: only staged schema members associated with the supplied `SchemaUpgrade` values are included in the generated stored schema.
|
|
61
|
-
- Support both production feature-flag rollouts and tests that simulate documents created or upgraded by a future application version.
|
|
62
|
-
- Keep the default behavior unchanged when upgrades are omitted, `undefined`, or empty.
|
|
63
|
-
- Keep view APIs immutable with respect to upgrade enablement after construction.
|
|
64
|
-
- Support an easy integration-test mode that enables all staged upgrades.
|
|
65
|
-
- Support composition/wrapping of generation options.
|
|
66
|
-
|
|
67
|
-
## API Shape
|
|
68
|
-
|
|
69
|
-
The alpha flow sets staged-upgrade policy in view construction:
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
const view = tree.viewWith(
|
|
73
|
-
new TreeViewConfigurationAlpha({
|
|
74
|
-
schema: AppSchema,
|
|
75
|
-
stagedUpgradePolicy: featureFlags.enableFooUpgrade
|
|
76
|
-
? StagedSchemaUpgradePolicy.enabledStagedUpgrades(fooSchemaUpgrade)
|
|
77
|
-
: undefined,
|
|
78
|
-
}),
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
if (view.compatibility.canInitialize) {
|
|
82
|
-
view.initialize(initialContent);
|
|
83
|
-
} else if (view.compatibility.canUpgrade) {
|
|
84
|
-
view.upgradeSchema();
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Key properties of this shape:
|
|
89
|
-
|
|
90
|
-
- The upgrade set is fixed when the view is created.
|
|
91
|
-
- `compatibility.canUpgrade`, `initialize`, and `upgradeSchema` all observe the same configured target.
|
|
92
|
-
|
|
93
|
-
### Accepting `StagedSchemaUpgradePolicy`
|
|
94
|
-
|
|
95
|
-
View construction accepts an optional `StagedSchemaUpgradePolicy` policy object via `TreeViewConfigurationAlpha.stagedUpgradePolicy`.
|
|
96
|
-
This keeps policy selection at view construction time while allowing advanced callers to configure staged-type and staged-optional inclusion directly.
|
|
97
|
-
|
|
98
|
-
The `StagedSchemaUpgradePolicy` namespace provides factory methods:
|
|
99
|
-
|
|
100
|
-
- `.restrictive` — excludes all staged schema members (default when omitted).
|
|
101
|
-
- `.permissive` — includes all staged schema upgrades (useful for testing).
|
|
102
|
-
- `.enabledStagedUpgrades(...upgrades)` — includes only staged members guarded by the specified `SchemaUpgrade` values.
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
const enabled = new Set<SchemaUpgrade>([fooSchemaUpgrade]);
|
|
106
|
-
|
|
107
|
-
const view = tree.viewWith(
|
|
108
|
-
new TreeViewConfigurationAlpha({
|
|
109
|
-
schema: AppSchema,
|
|
110
|
-
stagedUpgradePolicy: {
|
|
111
|
-
includeStaged: (upgrade) => enabled.has(upgrade),
|
|
112
|
-
includeStagedOptional: (upgrade) => enabled.has(upgrade),
|
|
113
|
-
},
|
|
114
|
-
}),
|
|
115
|
-
);
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Custom policy objects conforming to `StagedSchemaUpgradePolicy` are also accepted for advanced use cases.
|
|
119
|
-
|
|
120
|
-
Benefits:
|
|
121
|
-
|
|
122
|
-
- Keeps schema-generation policy explicit and colocated with view construction.
|
|
123
|
-
- Supports layered policy composition (base + local override) without adding mutable view APIs.
|
|
124
|
-
- Preserves single-source-of-truth behavior: compatibility checks and schema generation consume the same resolved policy.
|
|
125
|
-
- Enables broad integration-test scenarios (for example, all staged upgrades enabled) with `StagedSchemaUpgradePolicy.permissive`.
|
|
126
|
-
|
|
127
|
-
Future consideration:
|
|
128
|
-
|
|
129
|
-
- It may be useful to have the view expose the same type, `StagedSchemaUpgradePolicy`, for what is currently in the stored schema
|
|
130
|
-
- That could let callers test whether a specific upgrade is already included.
|
|
131
|
-
- That could clarify that the exposed policy is the default used when no custom options are declared.
|
|
132
|
-
- Callers could build wrapper policies from that baseline instead of reconstructing it.
|
|
133
|
-
|
|
134
|
-
## Why Construction-Time Upgrades?
|
|
135
|
-
|
|
136
|
-
Construction-time configuration keeps staged-upgrade policy colocated with the view schema and avoids mutable runtime policy on the view instance.
|
|
137
|
-
That has practical benefits:
|
|
138
|
-
|
|
139
|
-
- Eliminates ordering concerns between view creation, compatibility reads, and upgrade declaration calls.
|
|
140
|
-
- Prevents accidental policy drift on a long-lived view.
|
|
141
|
-
- Ensures compatibility checks and schema writes always use the same immutable policy for a given view.
|
|
142
|
-
- Makes testing deterministic because each view clearly represents one schema+upgrade configuration.
|
|
143
|
-
|
|
144
|
-
## Initialization Versus Upgrade
|
|
145
|
-
|
|
146
|
-
`initialize(...)` and `upgradeSchema()` both use the configured upgrades but affect different scenarios:
|
|
147
|
-
|
|
148
|
-
- `upgradeSchema()` upgrades existing document stored schema.
|
|
149
|
-
- `initialize(...)` writes initial stored schema and content for new documents.
|
|
150
|
-
|
|
151
|
-
The insertion/validation path for initialization must use the same generated schema target as compatibility and upgrade paths.
|
|
152
|
-
|
|
153
|
-
## Implementation Notes
|
|
154
|
-
|
|
155
|
-
Stored schema generation remains based on `toUpgradeSchema(root, options?)` and `toInitialSchema(root, options?)`.
|
|
156
|
-
The view is responsible for passing `stagedUpgradePolicy` from construction-time configuration to these helpers.
|
|
157
|
-
|
|
158
|
-
`StagedSchemaUpgradePolicy.restrictive` and `StagedSchemaUpgradePolicy.permissive` provide built-in defaults for "none" and "all" staged-upgrade inclusion.
|
|
159
|
-
`StagedSchemaUpgradePolicy.enabledStagedUpgrades(...upgrades)` converts a collection of `SchemaUpgrade` values into generation options.
|
|
160
|
-
The `stagedUpgradePolicy` field on `ITreeViewConfigurationAlpha` is used directly as the source policy for compatibility and schema generation.
|
|
161
|
-
|
|
162
|
-
Behavioral requirements:
|
|
163
|
-
|
|
164
|
-
- No configured options (or `undefined`) means restrictive default behavior.
|
|
165
|
-
- Configured options enable only staged members guarded by matching `SchemaUpgrade` values.
|
|
166
|
-
- `upgradeSchema()` is a no-op when stored schema is already a superset of the configured target.
|
|
167
|
-
- `upgradeSchema()` throws when the configured target is not a valid repo superset of current stored schema.
|
|
168
|
-
|
|
169
|
-
## Testing Strategy
|
|
170
|
-
|
|
171
|
-
Tests should cover both API entry points, the staged schema member kinds that are currently supported, and rollback-oriented production behavior.
|
|
172
|
-
|
|
173
|
-
Generic runtime API tests should cover shared behavior such as creating a view with `stagedUpgradePolicy` and calling `initialize(content)` to accept enabled staged content, while rejecting that content when options are not configured.
|
|
174
|
-
More specialized staged schema tests should exercise configured options with `upgradeSchema()` for each staged schema feature, such as staged allowed types and staged optional fields.
|
|
175
|
-
|
|
176
|
-
When `StagedSchemaUpgradePolicy` is accepted at view construction, tests should also cover custom policy-object configuration paths in addition to the namespace factory methods.
|
|
177
|
-
|
|
178
|
-
For `upgradeSchema`:
|
|
179
|
-
|
|
180
|
-
- Create a document with the current schema.
|
|
181
|
-
- Construct a view with configured upgrades.
|
|
182
|
-
- Call `upgradeSchema()`.
|
|
183
|
-
- Verify the stored schema includes the staged schema members guarded by the configured upgrade token.
|
|
184
|
-
- Verify clients using a view configuration that omits that token observe expected compatibility/upgrade behavior.
|
|
185
|
-
|
|
186
|
-
For `initialize`:
|
|
187
|
-
|
|
188
|
-
- Construct a view with configured upgrades and initialize a new document with `initialize(content)`.
|
|
189
|
-
- Use initial content that requires the upgraded schema.
|
|
190
|
-
- Verify the content is accepted and the stored schema includes the enabled staged schema upgrade.
|
|
191
|
-
- Verify constructing a view without upgrades rejects or excludes content that depends on that upgrade, matching existing restrictive behavior.
|
|
192
|
-
|
|
193
|
-
For feature-flag rollback behavior:
|
|
194
|
-
|
|
195
|
-
- Verify documents created or upgraded while the flag is enabled retain the upgraded stored schema.
|
|
196
|
-
- Verify documents created after the flag is disabled omit the upgraded schema when callers construct views without the corresponding upgrade entry.
|
|
197
|
-
|
|
198
|
-
Schema compatibility helper tests should remain schema-only.
|
|
199
|
-
They can validate compatibility across staged rollout states by comparing stored schema snapshots, but they should not be used as substitutes for runtime tests that sequence schema edits through `initialize` or `upgradeSchema`.
|
|
200
|
-
|
|
201
|
-
## Compatibility Notes
|
|
202
|
-
|
|
203
|
-
Enabling a staged schema upgrade changes document stored schema through the existing schema update mechanism.
|
|
204
|
-
Once the schema change is sequenced, the document state is authoritative.
|
|
205
|
-
Clients should not need their local feature flag to be enabled in order to read a document whose stored schema already includes the upgrade, provided their code version understands that schema.
|
|
206
|
-
|
|
207
|
-
The `upgrades` property names are not persisted.
|
|
208
|
-
Compatibility depends on the schema and the `SchemaUpgrade` values, not on the application-specific flag names used at call sites.
|