@fluidframework/tree 2.4.0-297385 → 2.4.0-299707
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dependency-cruiser-known-violations.json +0 -14
- package/api-report/tree.alpha.api.md +100 -0
- package/dist/alpha.d.ts +20 -1
- package/dist/codec/codec.d.ts +4 -4
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/noopValidator.d.ts +1 -1
- package/dist/codec/noopValidator.js +1 -1
- package/dist/codec/noopValidator.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +159 -2
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +54 -12
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/external-utilities/typeboxValidator.d.ts +1 -1
- package/dist/external-utilities/typeboxValidator.js +1 -1
- package/dist/external-utilities/typeboxValidator.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +4 -0
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +38 -6
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +0 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +46 -49
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/treeCompressionUtils.d.ts +1 -1
- package/dist/feature-libraries/treeCompressionUtils.js +1 -1
- package/dist/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +1 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.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/index.d.ts +2 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +5 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +1 -14
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +24 -9
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +20 -8
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts +29 -0
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -0
- package/dist/simple-tree/api/conciseTree.js +25 -0
- package/dist/simple-tree/api/conciseTree.js.map +1 -0
- package/dist/simple-tree/api/customTree.d.ts +44 -0
- package/dist/simple-tree/api/customTree.d.ts.map +1 -0
- package/dist/simple-tree/api/customTree.js +63 -0
- package/dist/simple-tree/api/customTree.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +6 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +5 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +41 -26
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +43 -15
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +1 -2
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +8 -8
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -2
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +78 -0
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/storedSchema.js +107 -0
- package/dist/simple-tree/api/storedSchema.js.map +1 -0
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +5 -5
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/{typesUnsafe.d.ts → api/typesUnsafe.d.ts} +14 -5
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -0
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -0
- package/dist/simple-tree/api/verboseTree.d.ts +6 -20
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +10 -48
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +1 -2
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +9 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +14 -1
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +3 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/flexList.d.ts.map +1 -0
- package/dist/simple-tree/flexList.js.map +1 -0
- package/dist/simple-tree/index.d.ts +3 -4
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +5 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +2 -3
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +3 -4
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +2 -1
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +5 -5
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +13 -15
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.js +3 -3
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +2 -1
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/treeFactory.d.ts +1 -0
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +1 -0
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/utils.d.ts +10 -8
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js.map +1 -1
- package/docs/main/detached-trees.md +8 -8
- package/lib/alpha.d.ts +20 -1
- package/lib/codec/codec.d.ts +4 -4
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/noopValidator.d.ts +1 -1
- package/lib/codec/noopValidator.js +1 -1
- package/lib/codec/noopValidator.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +159 -2
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +54 -12
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/external-utilities/typeboxValidator.d.ts +1 -1
- package/lib/external-utilities/typeboxValidator.js +1 -1
- package/lib/external-utilities/typeboxValidator.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +4 -0
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +36 -5
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +0 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +0 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/treeCompressionUtils.d.ts +1 -1
- package/lib/feature-libraries/treeCompressionUtils.js +1 -1
- package/lib/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/lib/index.d.ts +6 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +1 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.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/index.d.ts +2 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +2 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +2 -15
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +24 -9
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +19 -8
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts +29 -0
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -0
- package/lib/simple-tree/api/conciseTree.js +21 -0
- package/lib/simple-tree/api/conciseTree.js.map +1 -0
- package/lib/simple-tree/api/customTree.d.ts +44 -0
- package/lib/simple-tree/api/customTree.d.ts.map +1 -0
- package/lib/simple-tree/api/customTree.js +59 -0
- package/lib/simple-tree/api/customTree.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +6 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +41 -26
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js +43 -15
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +1 -2
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +1 -1
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -2
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +78 -0
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/storedSchema.js +101 -0
- package/lib/simple-tree/api/storedSchema.js.map +1 -0
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +3 -3
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/{typesUnsafe.d.ts → api/typesUnsafe.d.ts} +14 -5
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -0
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -0
- package/lib/simple-tree/api/verboseTree.d.ts +6 -20
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +11 -49
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +1 -2
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +9 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +12 -0
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +3 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/flexList.d.ts.map +1 -0
- package/lib/simple-tree/flexList.js.map +1 -0
- package/lib/simple-tree/index.d.ts +3 -4
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -3
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +1 -2
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +1 -2
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +2 -1
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +1 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +1 -3
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.js +3 -3
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +2 -1
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/treeFactory.d.ts +1 -0
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +1 -0
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/utils.d.ts +10 -8
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js.map +1 -1
- package/package.json +26 -25
- package/src/codec/codec.ts +4 -4
- package/src/codec/noopValidator.ts +1 -1
- package/src/core/tree/anchorSet.ts +63 -13
- package/src/external-utilities/typeboxValidator.ts +1 -1
- package/src/feature-libraries/flex-tree/lazyField.ts +44 -7
- package/src/feature-libraries/index.ts +0 -10
- package/src/feature-libraries/treeCompressionUtils.ts +1 -1
- package/src/index.ts +17 -6
- package/src/internalTypes.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +5 -0
- package/src/shared-tree/schematizingTreeView.ts +7 -16
- package/src/shared-tree/sharedTree.ts +52 -22
- package/src/simple-tree/api/conciseTree.ts +58 -0
- package/src/simple-tree/api/customTree.ts +119 -0
- package/src/simple-tree/api/index.ts +34 -1
- package/src/simple-tree/api/schemaCreationUtilities.ts +55 -36
- package/src/simple-tree/api/schemaFactory.ts +4 -6
- package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -2
- package/src/simple-tree/api/storedSchema.ts +126 -0
- package/src/simple-tree/api/treeNodeApi.ts +3 -8
- package/src/simple-tree/{typesUnsafe.ts → api/typesUnsafe.ts} +15 -5
- package/src/simple-tree/api/verboseTree.ts +21 -76
- package/src/simple-tree/arrayNode.ts +1 -1
- package/src/simple-tree/core/index.ts +1 -0
- package/src/simple-tree/core/treeNodeKernel.ts +13 -0
- package/src/simple-tree/core/unhydratedFlexTree.ts +6 -1
- package/src/simple-tree/index.ts +26 -20
- package/src/simple-tree/mapNode.ts +1 -1
- package/src/simple-tree/objectNode.ts +1 -1
- package/src/simple-tree/schemaTypes.ts +2 -6
- package/src/simple-tree/toFlexSchema.ts +1 -3
- package/src/simple-tree/toMapTree.ts +3 -3
- package/src/simple-tree/treeNodeValid.ts +2 -1
- package/src/treeFactory.ts +1 -0
- package/src/util/utils.ts +10 -8
- package/dist/feature-libraries/flex-tree/unboxed.d.ts +0 -12
- package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +0 -1
- package/dist/feature-libraries/flex-tree/unboxed.js +0 -20
- package/dist/feature-libraries/flex-tree/unboxed.js.map +0 -1
- package/dist/feature-libraries/typed-schema/flexList.d.ts.map +0 -1
- package/dist/feature-libraries/typed-schema/flexList.js.map +0 -1
- package/dist/feature-libraries/typed-schema/index.d.ts +0 -7
- package/dist/feature-libraries/typed-schema/index.d.ts.map +0 -1
- package/dist/feature-libraries/typed-schema/index.js +0 -12
- package/dist/feature-libraries/typed-schema/index.js.map +0 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -14
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +0 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +0 -7
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +0 -1
- package/dist/simple-tree/proxyBinding.d.ts +0 -15
- package/dist/simple-tree/proxyBinding.d.ts.map +0 -1
- package/dist/simple-tree/proxyBinding.js +0 -22
- package/dist/simple-tree/proxyBinding.js.map +0 -1
- package/dist/simple-tree/typesUnsafe.d.ts.map +0 -1
- package/dist/simple-tree/typesUnsafe.js.map +0 -1
- package/lib/feature-libraries/flex-tree/unboxed.d.ts +0 -12
- package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +0 -1
- package/lib/feature-libraries/flex-tree/unboxed.js +0 -16
- package/lib/feature-libraries/flex-tree/unboxed.js.map +0 -1
- package/lib/feature-libraries/typed-schema/flexList.d.ts.map +0 -1
- package/lib/feature-libraries/typed-schema/flexList.js.map +0 -1
- package/lib/feature-libraries/typed-schema/index.d.ts +0 -7
- package/lib/feature-libraries/typed-schema/index.d.ts.map +0 -1
- package/lib/feature-libraries/typed-schema/index.js +0 -6
- package/lib/feature-libraries/typed-schema/index.js.map +0 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -14
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +0 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +0 -6
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +0 -1
- package/lib/simple-tree/proxyBinding.d.ts +0 -15
- package/lib/simple-tree/proxyBinding.d.ts.map +0 -1
- package/lib/simple-tree/proxyBinding.js +0 -18
- package/lib/simple-tree/proxyBinding.js.map +0 -1
- package/lib/simple-tree/typesUnsafe.d.ts.map +0 -1
- package/lib/simple-tree/typesUnsafe.js.map +0 -1
- package/src/feature-libraries/flex-tree/unboxed.ts +0 -24
- package/src/feature-libraries/typed-schema/README.md +0 -6
- package/src/feature-libraries/typed-schema/index.ts +0 -16
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +0 -14
- package/src/simple-tree/proxyBinding.ts +0 -20
- /package/dist/simple-tree/{typesUnsafe.js → api/typesUnsafe.js} +0 -0
- /package/dist/{feature-libraries/typed-schema → simple-tree}/flexList.d.ts +0 -0
- /package/dist/{feature-libraries/typed-schema → simple-tree}/flexList.js +0 -0
- /package/lib/simple-tree/{typesUnsafe.js → api/typesUnsafe.js} +0 -0
- /package/lib/{feature-libraries/typed-schema → simple-tree}/flexList.d.ts +0 -0
- /package/lib/{feature-libraries/typed-schema → simple-tree}/flexList.js +0 -0
- /package/src/simple-tree/{ProxyBinding.md → core/TreeNodeBinding.md} +0 -0
- /package/src/{feature-libraries/typed-schema → simple-tree}/flexList.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/tree",
|
|
3
|
-
"version": "2.4.0-
|
|
3
|
+
"version": "2.4.0-299707",
|
|
4
4
|
"description": "Distributed tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -71,11 +71,13 @@
|
|
|
71
71
|
"cache-dir": "nyc/.cache",
|
|
72
72
|
"exclude": [
|
|
73
73
|
"src/test/**/*.*ts",
|
|
74
|
+
"dist/test/**/*.*js",
|
|
74
75
|
"lib/test/**/*.*js"
|
|
75
76
|
],
|
|
76
77
|
"exclude-after-remap": false,
|
|
77
78
|
"include": [
|
|
78
79
|
"src/**/*.*ts",
|
|
80
|
+
"dist/**/*.*js",
|
|
79
81
|
"lib/**/*.*js"
|
|
80
82
|
],
|
|
81
83
|
"report-dir": "nyc/report",
|
|
@@ -87,38 +89,38 @@
|
|
|
87
89
|
"temp-directory": "nyc/.nyc_output"
|
|
88
90
|
},
|
|
89
91
|
"dependencies": {
|
|
90
|
-
"@fluid-internal/client-utils": "2.4.0-
|
|
91
|
-
"@fluidframework/container-runtime": "2.4.0-
|
|
92
|
-
"@fluidframework/core-interfaces": "2.4.0-
|
|
93
|
-
"@fluidframework/core-utils": "2.4.0-
|
|
94
|
-
"@fluidframework/datastore-definitions": "2.4.0-
|
|
95
|
-
"@fluidframework/driver-definitions": "2.4.0-
|
|
96
|
-
"@fluidframework/id-compressor": "2.4.0-
|
|
97
|
-
"@fluidframework/runtime-definitions": "2.4.0-
|
|
98
|
-
"@fluidframework/runtime-utils": "2.4.0-
|
|
99
|
-
"@fluidframework/shared-object-base": "2.4.0-
|
|
100
|
-
"@fluidframework/telemetry-utils": "2.4.0-
|
|
92
|
+
"@fluid-internal/client-utils": "2.4.0-299707",
|
|
93
|
+
"@fluidframework/container-runtime": "2.4.0-299707",
|
|
94
|
+
"@fluidframework/core-interfaces": "2.4.0-299707",
|
|
95
|
+
"@fluidframework/core-utils": "2.4.0-299707",
|
|
96
|
+
"@fluidframework/datastore-definitions": "2.4.0-299707",
|
|
97
|
+
"@fluidframework/driver-definitions": "2.4.0-299707",
|
|
98
|
+
"@fluidframework/id-compressor": "2.4.0-299707",
|
|
99
|
+
"@fluidframework/runtime-definitions": "2.4.0-299707",
|
|
100
|
+
"@fluidframework/runtime-utils": "2.4.0-299707",
|
|
101
|
+
"@fluidframework/shared-object-base": "2.4.0-299707",
|
|
102
|
+
"@fluidframework/telemetry-utils": "2.4.0-299707",
|
|
101
103
|
"@sinclair/typebox": "^0.32.29",
|
|
102
104
|
"@tylerbu/sorted-btree-es6": "^1.8.0",
|
|
103
105
|
"@ungap/structured-clone": "^1.2.0",
|
|
104
106
|
"uuid": "^9.0.0"
|
|
105
107
|
},
|
|
106
108
|
"devDependencies": {
|
|
107
|
-
"@arethetypeswrong/cli": "^0.
|
|
109
|
+
"@arethetypeswrong/cli": "^0.16.4",
|
|
108
110
|
"@biomejs/biome": "~1.8.3",
|
|
109
|
-
"@fluid-internal/mocha-test-setup": "2.4.0-
|
|
110
|
-
"@fluid-private/stochastic-test-utils": "2.4.0-
|
|
111
|
-
"@fluid-private/test-dds-utils": "2.4.0-
|
|
112
|
-
"@fluid-private/test-drivers": "2.4.0-
|
|
111
|
+
"@fluid-internal/mocha-test-setup": "2.4.0-299707",
|
|
112
|
+
"@fluid-private/stochastic-test-utils": "2.4.0-299707",
|
|
113
|
+
"@fluid-private/test-dds-utils": "2.4.0-299707",
|
|
114
|
+
"@fluid-private/test-drivers": "2.4.0-299707",
|
|
113
115
|
"@fluid-tools/benchmark": "^0.50.0",
|
|
114
|
-
"@fluid-tools/build-cli": "^0.
|
|
116
|
+
"@fluid-tools/build-cli": "^0.48.0",
|
|
115
117
|
"@fluidframework/build-common": "^2.0.3",
|
|
116
|
-
"@fluidframework/build-tools": "^0.
|
|
117
|
-
"@fluidframework/container-definitions": "2.4.0-
|
|
118
|
-
"@fluidframework/container-loader": "2.4.0-
|
|
118
|
+
"@fluidframework/build-tools": "^0.48.0",
|
|
119
|
+
"@fluidframework/container-definitions": "2.4.0-299707",
|
|
120
|
+
"@fluidframework/container-loader": "2.4.0-299707",
|
|
119
121
|
"@fluidframework/eslint-config-fluid": "^5.4.0",
|
|
120
|
-
"@fluidframework/test-runtime-utils": "2.4.0-
|
|
121
|
-
"@fluidframework/test-utils": "2.4.0-
|
|
122
|
+
"@fluidframework/test-runtime-utils": "2.4.0-299707",
|
|
123
|
+
"@fluidframework/test-utils": "2.4.0-299707",
|
|
122
124
|
"@fluidframework/tree-previous": "npm:@fluidframework/tree@~2.3.0",
|
|
123
125
|
"@microsoft/api-extractor": "7.47.8",
|
|
124
126
|
"@types/diff": "^3.5.1",
|
|
@@ -139,7 +141,6 @@
|
|
|
139
141
|
"eslint": "~8.55.0",
|
|
140
142
|
"eslint-config-prettier": "~9.0.0",
|
|
141
143
|
"mocha": "^10.2.0",
|
|
142
|
-
"mocha-json-output-reporter": "^2.0.1",
|
|
143
144
|
"mocha-multi-reporters": "^1.5.1",
|
|
144
145
|
"moment": "^2.21.0",
|
|
145
146
|
"prettier": "~3.0.3",
|
|
@@ -242,7 +243,7 @@
|
|
|
242
243
|
"test:mocha:esm": "mocha",
|
|
243
244
|
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
244
245
|
"test:snapshots:regen": "pnpm test:mocha:esm --snapshot",
|
|
245
|
-
"test:stress": "cross-env FUZZ_TEST_COUNT=20 FUZZ_STRESS_RUN=
|
|
246
|
+
"test:stress": "cross-env FUZZ_TEST_COUNT=20 FUZZ_STRESS_RUN=normal mocha --ignore \"lib/test/memory/**/*\" --recursive \"lib/test/**/*.spec.js\"",
|
|
246
247
|
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
|
|
247
248
|
"typetests:gen": "flub generate typetests --dir . -v",
|
|
248
249
|
"typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
|
package/src/codec/codec.ts
CHANGED
|
@@ -35,18 +35,18 @@ export interface IDecoder<TDecoded, TEncoded, TContext> {
|
|
|
35
35
|
/**
|
|
36
36
|
* Validates data complies with some particular schema.
|
|
37
37
|
* Implementations are typically created by a {@link JsonValidator}.
|
|
38
|
-
* @
|
|
38
|
+
* @alpha
|
|
39
39
|
*/
|
|
40
40
|
export interface SchemaValidationFunction<Schema extends TSchema> {
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Returns whether the data matches a schema.
|
|
43
43
|
*/
|
|
44
44
|
check(data: unknown): data is Static<Schema>;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* JSON schema validator compliant with draft 6 schema. See https://json-schema.org.
|
|
49
|
-
* @
|
|
49
|
+
* @alpha
|
|
50
50
|
*/
|
|
51
51
|
export interface JsonValidator {
|
|
52
52
|
/**
|
|
@@ -63,7 +63,7 @@ export interface JsonValidator {
|
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Options relating to handling of persisted data.
|
|
66
|
-
* @
|
|
66
|
+
* @alpha
|
|
67
67
|
*/
|
|
68
68
|
export interface ICodecOptions {
|
|
69
69
|
/**
|
|
@@ -11,7 +11,7 @@ import type { JsonValidator } from "./codec.js";
|
|
|
11
11
|
* A {@link JsonValidator} implementation which performs no validation and accepts all data as valid.
|
|
12
12
|
* @privateRemarks Having this as an option unifies opting out of validation with selection of
|
|
13
13
|
* validators, simplifying code performing validation.
|
|
14
|
-
* @
|
|
14
|
+
* @alpha
|
|
15
15
|
*/
|
|
16
16
|
export const noopValidator: JsonValidator = {
|
|
17
17
|
compile: <Schema extends TSchema>() => ({ check: (data): data is Static<Schema> => true }),
|
|
@@ -233,6 +233,13 @@ export interface AnchorNode extends UpPath<AnchorNode>, Listenable<AnchorEvents>
|
|
|
233
233
|
*/
|
|
234
234
|
child(key: FieldKey, index: number): UpPath<AnchorNode>;
|
|
235
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Gets the child AnchorNode if already exists.
|
|
238
|
+
*
|
|
239
|
+
* Does NOT add a ref, so the returned AnchorNode must be used with care.
|
|
240
|
+
*/
|
|
241
|
+
childIfAnchored(key: FieldKey, index: number): AnchorNode | undefined;
|
|
242
|
+
|
|
236
243
|
/**
|
|
237
244
|
* Gets a child AnchorNode (creating it if needed), and an Anchor owning a ref to it.
|
|
238
245
|
* Caller is responsible for freeing the returned Anchor, and must not use the AnchorNode after that.
|
|
@@ -413,8 +420,10 @@ export class AnchorSet implements Listenable<AnchorSetRootEvents>, AnchorLocator
|
|
|
413
420
|
|
|
414
421
|
/**
|
|
415
422
|
* Finds a path node if it already exists.
|
|
423
|
+
*
|
|
424
|
+
* Does not add a ref!
|
|
416
425
|
*/
|
|
417
|
-
|
|
426
|
+
public find(path: UpPath): PathNode | undefined {
|
|
418
427
|
if (path instanceof PathNode) {
|
|
419
428
|
if (path.anchorSet === this) {
|
|
420
429
|
return path;
|
|
@@ -422,7 +431,7 @@ export class AnchorSet implements Listenable<AnchorSetRootEvents>, AnchorLocator
|
|
|
422
431
|
}
|
|
423
432
|
const parent = path.parent ?? this.root;
|
|
424
433
|
const parentPath = this.find(parent);
|
|
425
|
-
return parentPath?.
|
|
434
|
+
return parentPath?.childIfAnchored(path.parentField, path.parentIndex);
|
|
426
435
|
}
|
|
427
436
|
|
|
428
437
|
/**
|
|
@@ -452,7 +461,7 @@ export class AnchorSet implements Listenable<AnchorSetRootEvents>, AnchorLocator
|
|
|
452
461
|
while ((wrapWith = stack.pop()) !== undefined) {
|
|
453
462
|
if (path === undefined || path instanceof PathNode) {
|
|
454
463
|
// If path already has an anchor, get an anchor for it's child if there is one:
|
|
455
|
-
const child = (path ?? this.root).
|
|
464
|
+
const child = (path ?? this.root).childIfAnchored(
|
|
456
465
|
wrapWith.parentField,
|
|
457
466
|
wrapWith.parentIndex,
|
|
458
467
|
);
|
|
@@ -1210,7 +1219,11 @@ class PathNode extends ReferenceCountedBase implements UpPath<PathNode>, AnchorN
|
|
|
1210
1219
|
public child(key: FieldKey, index: number): UpPath<AnchorNode> {
|
|
1211
1220
|
// Fast path: if child exists, return it.
|
|
1212
1221
|
return (
|
|
1213
|
-
this.
|
|
1222
|
+
this.childIfAnchored(key, index) ?? {
|
|
1223
|
+
parent: this,
|
|
1224
|
+
parentField: key,
|
|
1225
|
+
parentIndex: index,
|
|
1226
|
+
}
|
|
1214
1227
|
);
|
|
1215
1228
|
}
|
|
1216
1229
|
|
|
@@ -1271,8 +1284,7 @@ class PathNode extends ReferenceCountedBase implements UpPath<PathNode>, AnchorN
|
|
|
1271
1284
|
field = [];
|
|
1272
1285
|
this.children.set(key, field);
|
|
1273
1286
|
}
|
|
1274
|
-
|
|
1275
|
-
let child = field.find((c) => c.parentIndex === index);
|
|
1287
|
+
let child = binaryFind(field, index);
|
|
1276
1288
|
if (child === undefined) {
|
|
1277
1289
|
child = new PathNode(this.anchorSet, key, index, this);
|
|
1278
1290
|
field.push(child);
|
|
@@ -1284,16 +1296,11 @@ class PathNode extends ReferenceCountedBase implements UpPath<PathNode>, AnchorN
|
|
|
1284
1296
|
return child;
|
|
1285
1297
|
}
|
|
1286
1298
|
|
|
1287
|
-
|
|
1288
|
-
* Gets a child if it exists.
|
|
1289
|
-
* Does NOT add a ref.
|
|
1290
|
-
*/
|
|
1291
|
-
public tryGetChild(key: FieldKey, index: number): PathNode | undefined {
|
|
1299
|
+
public childIfAnchored(key: FieldKey, index: number): PathNode | undefined {
|
|
1292
1300
|
assert(this.status === Status.Alive, 0x40d /* PathNode must be alive */);
|
|
1293
1301
|
const field = this.children.get(key);
|
|
1294
1302
|
|
|
1295
|
-
|
|
1296
|
-
return field?.find((c) => c.parentIndex === index);
|
|
1303
|
+
return field === undefined ? undefined : binaryFind(field, index);
|
|
1297
1304
|
}
|
|
1298
1305
|
|
|
1299
1306
|
/**
|
|
@@ -1343,3 +1350,46 @@ class PathNode extends ReferenceCountedBase implements UpPath<PathNode>, AnchorN
|
|
|
1343
1350
|
}
|
|
1344
1351
|
}
|
|
1345
1352
|
}
|
|
1353
|
+
|
|
1354
|
+
/**
|
|
1355
|
+
* Find a child PathNode by index using a binary search.
|
|
1356
|
+
* @param sorted - array of PathNode's sorted by parentIndex.
|
|
1357
|
+
* @param index - index being looked for.
|
|
1358
|
+
* @returns child with the requested parentIndex, or undefined.
|
|
1359
|
+
* @privateRemarks
|
|
1360
|
+
* This function is very commonly used with small arrays (length 0 or one for all non sequence fields),
|
|
1361
|
+
* and is currently a hot path due to how flex tree leaves to excessive cursor to anchor and anchor to cursor translations,
|
|
1362
|
+
* both of which walk paths down the AnchorSet.
|
|
1363
|
+
* Additionally current usages tends to fully populate the anchor tree leading the correct array index to be the requested parent index.
|
|
1364
|
+
* This makes the performance of this performance both important in small cases and easy to overly tune to the current usage patterns.
|
|
1365
|
+
* This lead to not implementing a general purpose reusable binary search.
|
|
1366
|
+
* Once this function is not so heavily overused due to inefficient patterns in flex-tree,
|
|
1367
|
+
* replacing it with a standard binary search is likely fine.
|
|
1368
|
+
* Until then, care and benchmarking should be used when messing with this function.
|
|
1369
|
+
*/
|
|
1370
|
+
function binaryFind(sorted: readonly PathNode[], index: number): PathNode | undefined {
|
|
1371
|
+
// Try guessing the list is not sparse as a starter:
|
|
1372
|
+
const guess = sorted[index];
|
|
1373
|
+
if (guess !== undefined && guess.parentIndex === index) {
|
|
1374
|
+
return guess;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
// inclusive
|
|
1378
|
+
let min = 0;
|
|
1379
|
+
// exclusive
|
|
1380
|
+
let max = sorted.length;
|
|
1381
|
+
|
|
1382
|
+
while (min !== max) {
|
|
1383
|
+
const mid = Math.floor((min + max) / 2);
|
|
1384
|
+
const item = sorted[mid]!;
|
|
1385
|
+
const found = item.parentIndex;
|
|
1386
|
+
if (found === index) {
|
|
1387
|
+
return item; // Found the target, return it.
|
|
1388
|
+
} else if (found > index) {
|
|
1389
|
+
max = mid; // Continue search on lower half.
|
|
1390
|
+
} else {
|
|
1391
|
+
min = mid + 1; // Continue search on left half.
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
return undefined; // If we reach here, target is not in array (or array was not sorted)
|
|
1395
|
+
}
|
|
@@ -19,7 +19,7 @@ import type { JsonValidator } from "../codec/index.js";
|
|
|
19
19
|
*
|
|
20
20
|
* Defining this validator in its own file also helps to ensure it is tree-shakeable.
|
|
21
21
|
*
|
|
22
|
-
* @
|
|
22
|
+
* @alpha
|
|
23
23
|
*/
|
|
24
24
|
export const typeboxValidator: JsonValidator = {
|
|
25
25
|
compile: <Schema extends TSchema>(schema: Schema) => {
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
7
8
|
|
|
8
9
|
import {
|
|
10
|
+
type AnchorNode,
|
|
9
11
|
CursorLocationType,
|
|
10
12
|
type ExclusiveMapTree,
|
|
11
13
|
type FieldAnchor,
|
|
@@ -51,9 +53,7 @@ import {
|
|
|
51
53
|
tryMoveCursorToAnchorSymbol,
|
|
52
54
|
} from "./lazyEntity.js";
|
|
53
55
|
import { type LazyTreeNode, makeTree } from "./lazyNode.js";
|
|
54
|
-
import { unboxedFlexNode } from "./unboxed.js";
|
|
55
56
|
import { indexForAt, treeStatusFromAnchorCache } from "./utilities.js";
|
|
56
|
-
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
57
57
|
import { cursorForMapTreeField, cursorForMapTreeNode } from "../mapTreeCursor.js";
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -196,7 +196,7 @@ export abstract class LazyField extends LazyEntity<FieldAnchor> implements FlexT
|
|
|
196
196
|
|
|
197
197
|
public atIndex(index: number): FlexTreeUnknownUnboxed {
|
|
198
198
|
return inCursorNode(this[cursorSymbol], index, (cursor) =>
|
|
199
|
-
unboxedFlexNode(this.context, cursor),
|
|
199
|
+
unboxedFlexNode(this.context, cursor, this[anchorSymbol]),
|
|
200
200
|
);
|
|
201
201
|
}
|
|
202
202
|
|
|
@@ -222,7 +222,7 @@ export abstract class LazyField extends LazyEntity<FieldAnchor> implements FlexT
|
|
|
222
222
|
|
|
223
223
|
public [Symbol.iterator](): IterableIterator<FlexTreeUnknownUnboxed> {
|
|
224
224
|
return iterateCursorField(this[cursorSymbol], (cursor) =>
|
|
225
|
-
unboxedFlexNode(this.context, cursor),
|
|
225
|
+
unboxedFlexNode(this.context, cursor, this[anchorSymbol]),
|
|
226
226
|
);
|
|
227
227
|
}
|
|
228
228
|
|
|
@@ -259,9 +259,7 @@ export class LazySequence extends LazyField implements FlexTreeSequenceField {
|
|
|
259
259
|
return undefined;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
return
|
|
263
|
-
unboxedFlexNode(this.context, cursor),
|
|
264
|
-
);
|
|
262
|
+
return this.atIndex(finalIndex);
|
|
265
263
|
}
|
|
266
264
|
public get asArray(): readonly FlexTreeUnknownUnboxed[] {
|
|
267
265
|
return this.map((x) => x);
|
|
@@ -352,3 +350,42 @@ const builderList: [FieldKindIdentifier, Builder][] = [
|
|
|
352
350
|
];
|
|
353
351
|
|
|
354
352
|
const kindToClass: ReadonlyMap<FieldKindIdentifier, Builder> = new Map(builderList);
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Returns the flex tree node, or the value if it has one.
|
|
356
|
+
*/
|
|
357
|
+
export function unboxedFlexNode(
|
|
358
|
+
context: Context,
|
|
359
|
+
cursor: ITreeSubscriptionCursor,
|
|
360
|
+
fieldAnchor: FieldAnchor,
|
|
361
|
+
): FlexTreeUnknownUnboxed {
|
|
362
|
+
const value = cursor.value;
|
|
363
|
+
if (value !== undefined) {
|
|
364
|
+
return value;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// Try accessing cached child node via anchors.
|
|
368
|
+
// This avoids O(depth) related costs from makeTree in the cached case.
|
|
369
|
+
const anchor = fieldAnchor.parent;
|
|
370
|
+
let child: AnchorNode | undefined;
|
|
371
|
+
if (anchor !== undefined) {
|
|
372
|
+
const anchorNode = context.checkout.forest.anchors.locate(anchor);
|
|
373
|
+
assert(anchorNode !== undefined, "missing anchor");
|
|
374
|
+
child = anchorNode.childIfAnchored(fieldAnchor.fieldKey, cursor.fieldIndex);
|
|
375
|
+
} else {
|
|
376
|
+
child = context.checkout.forest.anchors.find({
|
|
377
|
+
parent: undefined,
|
|
378
|
+
parentField: fieldAnchor.fieldKey,
|
|
379
|
+
parentIndex: cursor.fieldIndex,
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (child !== undefined) {
|
|
384
|
+
const cached = child.slots.get(flexTreeSlot);
|
|
385
|
+
if (cached !== undefined) {
|
|
386
|
+
return cached;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
return makeTree(context, cursor);
|
|
391
|
+
}
|
|
@@ -79,16 +79,6 @@ export {
|
|
|
79
79
|
isNeverTree,
|
|
80
80
|
} from "./modular-schema/index.js";
|
|
81
81
|
|
|
82
|
-
export {
|
|
83
|
-
type Unenforced,
|
|
84
|
-
markEager,
|
|
85
|
-
type LazyItem,
|
|
86
|
-
type FlexListToUnion,
|
|
87
|
-
type ExtractItemType,
|
|
88
|
-
isLazy,
|
|
89
|
-
type FlexList,
|
|
90
|
-
} from "./typed-schema/index.js";
|
|
91
|
-
|
|
92
82
|
export { mapRootChanges } from "./deltaUtils.js";
|
|
93
83
|
|
|
94
84
|
export {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Selects which heuristics to use when encoding tree content.
|
|
8
8
|
* All encoding options here are compatible with the same decoder:
|
|
9
9
|
* the selection here does not impact compatibility.
|
|
10
|
-
* @
|
|
10
|
+
* @alpha
|
|
11
11
|
*/
|
|
12
12
|
export enum TreeCompressionStrategy {
|
|
13
13
|
/**
|
package/src/index.ts
CHANGED
|
@@ -40,9 +40,7 @@ export {
|
|
|
40
40
|
} from "./events/index.js";
|
|
41
41
|
|
|
42
42
|
export {
|
|
43
|
-
type LazyItem,
|
|
44
43
|
TreeStatus,
|
|
45
|
-
type Unenforced,
|
|
46
44
|
TreeCompressionStrategy,
|
|
47
45
|
} from "./feature-libraries/index.js";
|
|
48
46
|
|
|
@@ -58,6 +56,7 @@ export {
|
|
|
58
56
|
type NodeInDocumentConstraint,
|
|
59
57
|
type RunTransaction,
|
|
60
58
|
rollback,
|
|
59
|
+
type ForestOptions,
|
|
61
60
|
getBranch,
|
|
62
61
|
type TreeBranch,
|
|
63
62
|
type TreeBranchFork,
|
|
@@ -121,12 +120,11 @@ export {
|
|
|
121
120
|
// Recursive Schema APIs
|
|
122
121
|
type ValidateRecursiveSchema,
|
|
123
122
|
type FixRecursiveArraySchema,
|
|
124
|
-
// experimental @
|
|
123
|
+
// experimental @alpha APIs:
|
|
125
124
|
adaptEnum,
|
|
126
125
|
enumFromStrings,
|
|
127
126
|
singletonSchema,
|
|
128
127
|
typedObjectValues,
|
|
129
|
-
type EmptyObject,
|
|
130
128
|
// test recursive schema for checking that d.ts files handles schema correctly
|
|
131
129
|
test_RecursiveObject,
|
|
132
130
|
test_RecursiveObject_base,
|
|
@@ -134,6 +132,8 @@ export {
|
|
|
134
132
|
// Beta APIs
|
|
135
133
|
TreeBeta,
|
|
136
134
|
type TreeChangeEventsBeta,
|
|
135
|
+
extractPersistedSchema,
|
|
136
|
+
comparePersistedSchema,
|
|
137
137
|
// Back to normal types
|
|
138
138
|
type JsonTreeSchema,
|
|
139
139
|
type JsonSchemaId,
|
|
@@ -149,10 +149,19 @@ export {
|
|
|
149
149
|
type JsonSchemaType,
|
|
150
150
|
type JsonLeafSchemaType,
|
|
151
151
|
getJsonSchema,
|
|
152
|
+
type LazyItem,
|
|
153
|
+
type Unenforced,
|
|
152
154
|
} from "./simple-tree/index.js";
|
|
153
|
-
export {
|
|
155
|
+
export {
|
|
156
|
+
SharedTree,
|
|
157
|
+
configuredSharedTree,
|
|
158
|
+
} from "./treeFactory.js";
|
|
154
159
|
|
|
155
|
-
export type {
|
|
160
|
+
export type {
|
|
161
|
+
ICodecOptions,
|
|
162
|
+
JsonValidator,
|
|
163
|
+
SchemaValidationFunction,
|
|
164
|
+
} from "./codec/index.js";
|
|
156
165
|
export { noopValidator } from "./codec/index.js";
|
|
157
166
|
export { typeboxValidator } from "./external-utilities/index.js";
|
|
158
167
|
|
|
@@ -177,3 +186,5 @@ export {
|
|
|
177
186
|
// These would be put in `internalTypes` except doing so tents to cause errors like:
|
|
178
187
|
// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.
|
|
179
188
|
export type { MapNodeInsertableData } from "./simple-tree/index.js";
|
|
189
|
+
|
|
190
|
+
export type { JsonCompatible, JsonCompatibleObject } from "./util/index.js";
|
package/src/internalTypes.ts
CHANGED
|
@@ -34,6 +34,6 @@ export type {
|
|
|
34
34
|
NodeFromSchemaUnsafe,
|
|
35
35
|
ReadonlyMapInlined,
|
|
36
36
|
} from "./simple-tree/index.js";
|
|
37
|
-
export type { FlexList, FlexListToUnion, ExtractItemType } from "./
|
|
37
|
+
export type { FlexList, FlexListToUnion, ExtractItemType } from "./simple-tree/index.js";
|
|
38
38
|
|
|
39
39
|
export type { TreeApi } from "./shared-tree/index.js";
|
package/src/packageVersion.ts
CHANGED
package/src/shared-tree/index.ts
CHANGED
|
@@ -13,6 +13,9 @@ export {
|
|
|
13
13
|
type SharedTreeContentSnapshot,
|
|
14
14
|
type SharedTreeFormatOptions,
|
|
15
15
|
SharedTreeFormatVersion,
|
|
16
|
+
buildConfiguredForest,
|
|
17
|
+
defaultSharedTreeOptions,
|
|
18
|
+
type ForestOptions,
|
|
16
19
|
} from "./sharedTree.js";
|
|
17
20
|
|
|
18
21
|
export {
|
|
@@ -29,6 +32,8 @@ export {
|
|
|
29
32
|
|
|
30
33
|
export { type TreeStoredContent } from "./schematizeTree.js";
|
|
31
34
|
|
|
35
|
+
export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
36
|
+
|
|
32
37
|
export { CheckoutFlexTreeView } from "./checkoutFlexTreeView.js";
|
|
33
38
|
|
|
34
39
|
export type { ISharedTreeEditor, ISchemaEditor } from "./sharedTreeEditBuilder.js";
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
type TreeViewConfiguration,
|
|
42
42
|
mapTreeFromNodeData,
|
|
43
43
|
prepareContentForHydration,
|
|
44
|
+
comparePersistedSchemaInternal,
|
|
44
45
|
toStoredSchema,
|
|
45
46
|
} from "../simple-tree/index.js";
|
|
46
47
|
import { Breakable, breakingClass, disposeSymbol, type WithBreakable } from "../util/index.js";
|
|
@@ -225,22 +226,12 @@ export class SchematizingSimpleTreeView<in out TRootSchema extends ImplicitField
|
|
|
225
226
|
private update(): void {
|
|
226
227
|
this.disposeView();
|
|
227
228
|
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
const canView =
|
|
235
|
-
result.write === Compatibility.Compatible && result.read === Compatibility.Compatible;
|
|
236
|
-
const canUpgrade = result.read === Compatibility.Compatible;
|
|
237
|
-
const isEquivalent = canView && canUpgrade;
|
|
238
|
-
const compatibility: SchemaCompatibilityStatus = {
|
|
239
|
-
canView,
|
|
240
|
-
canUpgrade,
|
|
241
|
-
isEquivalent,
|
|
242
|
-
canInitialize: canInitialize(this.checkout),
|
|
243
|
-
};
|
|
229
|
+
const compatibility = comparePersistedSchemaInternal(
|
|
230
|
+
this.checkout.storedSchema,
|
|
231
|
+
this.viewSchema,
|
|
232
|
+
canInitialize(this.checkout),
|
|
233
|
+
);
|
|
234
|
+
|
|
244
235
|
let lastRoot =
|
|
245
236
|
this.compatibility.canView && this.view !== undefined ? this.root : undefined;
|
|
246
237
|
this.currentCompatibility = compatibility;
|