@fluid-experimental/tree 2.0.0-internal.8.0.0 → 2.0.0-rc.1.0.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.
Files changed (215) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/api-extractor-lint.json +1 -10
  3. package/api-extractor.json +0 -9
  4. package/api-report/experimental-tree.api.md +131 -130
  5. package/dist/ChangeTypes.d.ts +15 -15
  6. package/dist/ChangeTypes.js +4 -4
  7. package/dist/ChangeTypes.js.map +1 -1
  8. package/dist/Checkout.d.ts +4 -4
  9. package/dist/Checkout.js +3 -3
  10. package/dist/Checkout.js.map +1 -1
  11. package/dist/Common.d.ts +1 -1
  12. package/dist/Common.d.ts.map +1 -1
  13. package/dist/Common.js.map +1 -1
  14. package/dist/EagerCheckout.d.ts +1 -1
  15. package/dist/EagerCheckout.js +1 -1
  16. package/dist/EagerCheckout.js.map +1 -1
  17. package/dist/EditLog.d.ts +3 -2
  18. package/dist/EditLog.d.ts.map +1 -1
  19. package/dist/EditLog.js +3 -5
  20. package/dist/EditLog.js.map +1 -1
  21. package/dist/EditUtilities.d.ts +5 -5
  22. package/dist/EditUtilities.js +2 -2
  23. package/dist/EditUtilities.js.map +1 -1
  24. package/dist/EventTypes.d.ts +1 -1
  25. package/dist/EventTypes.js +1 -1
  26. package/dist/EventTypes.js.map +1 -1
  27. package/dist/Forest.d.ts +4 -4
  28. package/dist/Forest.js +3 -6
  29. package/dist/Forest.js.map +1 -1
  30. package/dist/Identifiers.d.ts +14 -14
  31. package/dist/Identifiers.js.map +1 -1
  32. package/dist/InitialTree.d.ts +1 -1
  33. package/dist/InitialTree.js +1 -1
  34. package/dist/InitialTree.js.map +1 -1
  35. package/dist/LogViewer.d.ts +2 -2
  36. package/dist/LogViewer.js +1 -1
  37. package/dist/LogViewer.js.map +1 -1
  38. package/dist/NodeIdUtilities.d.ts +3 -3
  39. package/dist/NodeIdUtilities.js.map +1 -1
  40. package/dist/PayloadUtilities.d.ts +1 -1
  41. package/dist/PayloadUtilities.js +1 -1
  42. package/dist/PayloadUtilities.js.map +1 -1
  43. package/dist/ReconciliationPath.d.ts +3 -3
  44. package/dist/ReconciliationPath.js.map +1 -1
  45. package/dist/RevisionValueCache.d.ts +1 -1
  46. package/dist/RevisionValueCache.js +2 -2
  47. package/dist/RevisionValueCache.js.map +1 -1
  48. package/dist/RevisionView.d.ts +2 -2
  49. package/dist/RevisionView.js +2 -2
  50. package/dist/RevisionView.js.map +1 -1
  51. package/dist/SharedTree.d.ts +14 -14
  52. package/dist/SharedTree.js +2 -2
  53. package/dist/SharedTree.js.map +1 -1
  54. package/dist/Transaction.d.ts +3 -3
  55. package/dist/Transaction.js +2 -2
  56. package/dist/Transaction.js.map +1 -1
  57. package/dist/TransactionInternal.d.ts +17 -17
  58. package/dist/TransactionInternal.js +3 -3
  59. package/dist/TransactionInternal.js.map +1 -1
  60. package/dist/TreeView.d.ts +7 -7
  61. package/dist/TreeView.js +1 -1
  62. package/dist/TreeView.js.map +1 -1
  63. package/dist/id-compressor/IdCompressor.js +2 -5
  64. package/dist/id-compressor/IdCompressor.js.map +1 -1
  65. package/dist/migration-shim/migrationShim.d.ts +3 -3
  66. package/dist/migration-shim/migrationShim.d.ts.map +1 -1
  67. package/dist/migration-shim/migrationShim.js +9 -5
  68. package/dist/migration-shim/migrationShim.js.map +1 -1
  69. package/dist/migration-shim/migrationShimFactory.d.ts +2 -2
  70. package/dist/migration-shim/migrationShimFactory.d.ts.map +1 -1
  71. package/dist/migration-shim/migrationShimFactory.js.map +1 -1
  72. package/dist/migration-shim/sharedTreeShim.d.ts +4 -4
  73. package/dist/migration-shim/sharedTreeShim.d.ts.map +1 -1
  74. package/dist/migration-shim/sharedTreeShim.js +1 -1
  75. package/dist/migration-shim/sharedTreeShim.js.map +1 -1
  76. package/dist/migration-shim/sharedTreeShimFactory.d.ts +1 -2
  77. package/dist/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
  78. package/dist/migration-shim/sharedTreeShimFactory.js.map +1 -1
  79. package/dist/migration-shim/shimDeltaConnection.d.ts +16 -0
  80. package/dist/migration-shim/shimDeltaConnection.d.ts.map +1 -1
  81. package/dist/migration-shim/shimDeltaConnection.js +16 -2
  82. package/dist/migration-shim/shimDeltaConnection.js.map +1 -1
  83. package/dist/migration-shim/types.d.ts +1 -1
  84. package/dist/migration-shim/types.d.ts.map +1 -1
  85. package/dist/migration-shim/types.js.map +1 -1
  86. package/dist/persisted-types/0.0.2.d.ts +24 -24
  87. package/dist/persisted-types/0.0.2.js +5 -5
  88. package/dist/persisted-types/0.0.2.js.map +1 -1
  89. package/dist/persisted-types/0.1.1.d.ts +14 -14
  90. package/dist/persisted-types/0.1.1.js +3 -3
  91. package/dist/persisted-types/0.1.1.js.map +1 -1
  92. package/dist/tree-alpha.d.ts +2674 -119
  93. package/dist/tree-beta.d.ts +1 -50
  94. package/dist/tree-public.d.ts +1 -52
  95. package/dist/tree-untrimmed.d.ts +142 -143
  96. package/lib/ChangeTypes.d.ts +15 -15
  97. package/lib/ChangeTypes.js +4 -4
  98. package/lib/ChangeTypes.js.map +1 -1
  99. package/lib/Checkout.d.ts +4 -4
  100. package/lib/Checkout.js +3 -3
  101. package/lib/Checkout.js.map +1 -1
  102. package/lib/Common.d.ts +1 -1
  103. package/lib/Common.d.ts.map +1 -1
  104. package/lib/Common.js.map +1 -1
  105. package/lib/EagerCheckout.d.ts +1 -1
  106. package/lib/EagerCheckout.js +1 -1
  107. package/lib/EagerCheckout.js.map +1 -1
  108. package/lib/EditLog.d.ts +3 -2
  109. package/lib/EditLog.d.ts.map +1 -1
  110. package/lib/EditLog.js +2 -1
  111. package/lib/EditLog.js.map +1 -1
  112. package/lib/EditUtilities.d.ts +5 -5
  113. package/lib/EditUtilities.js +2 -2
  114. package/lib/EditUtilities.js.map +1 -1
  115. package/lib/EventTypes.d.ts +1 -1
  116. package/lib/EventTypes.js +1 -1
  117. package/lib/EventTypes.js.map +1 -1
  118. package/lib/Forest.d.ts +4 -4
  119. package/lib/Forest.js +2 -2
  120. package/lib/Forest.js.map +1 -1
  121. package/lib/Identifiers.d.ts +14 -14
  122. package/lib/Identifiers.js.map +1 -1
  123. package/lib/InitialTree.d.ts +1 -1
  124. package/lib/InitialTree.js +1 -1
  125. package/lib/InitialTree.js.map +1 -1
  126. package/lib/LogViewer.d.ts +2 -2
  127. package/lib/LogViewer.js +1 -1
  128. package/lib/LogViewer.js.map +1 -1
  129. package/lib/NodeIdUtilities.d.ts +3 -3
  130. package/lib/NodeIdUtilities.js.map +1 -1
  131. package/lib/PayloadUtilities.d.ts +1 -1
  132. package/lib/PayloadUtilities.js +1 -1
  133. package/lib/PayloadUtilities.js.map +1 -1
  134. package/lib/ReconciliationPath.d.ts +3 -3
  135. package/lib/ReconciliationPath.js.map +1 -1
  136. package/lib/RevisionValueCache.d.ts +1 -1
  137. package/lib/RevisionValueCache.js +1 -1
  138. package/lib/RevisionValueCache.js.map +1 -1
  139. package/lib/RevisionView.d.ts +2 -2
  140. package/lib/RevisionView.js +2 -2
  141. package/lib/RevisionView.js.map +1 -1
  142. package/lib/SharedTree.d.ts +14 -14
  143. package/lib/SharedTree.js +2 -2
  144. package/lib/SharedTree.js.map +1 -1
  145. package/lib/Transaction.d.ts +3 -3
  146. package/lib/Transaction.js +2 -2
  147. package/lib/Transaction.js.map +1 -1
  148. package/lib/TransactionInternal.d.ts +17 -17
  149. package/lib/TransactionInternal.js +3 -3
  150. package/lib/TransactionInternal.js.map +1 -1
  151. package/lib/TreeView.d.ts +7 -7
  152. package/lib/TreeView.js +1 -1
  153. package/lib/TreeView.js.map +1 -1
  154. package/lib/id-compressor/IdCompressor.js +1 -1
  155. package/lib/id-compressor/IdCompressor.js.map +1 -1
  156. package/lib/migration-shim/migrationShim.d.ts +3 -3
  157. package/lib/migration-shim/migrationShim.d.ts.map +1 -1
  158. package/lib/migration-shim/migrationShim.js +9 -5
  159. package/lib/migration-shim/migrationShim.js.map +1 -1
  160. package/lib/migration-shim/migrationShimFactory.d.ts +2 -2
  161. package/lib/migration-shim/migrationShimFactory.d.ts.map +1 -1
  162. package/lib/migration-shim/migrationShimFactory.js.map +1 -1
  163. package/lib/migration-shim/sharedTreeShim.d.ts +4 -4
  164. package/lib/migration-shim/sharedTreeShim.d.ts.map +1 -1
  165. package/lib/migration-shim/sharedTreeShim.js +1 -1
  166. package/lib/migration-shim/sharedTreeShim.js.map +1 -1
  167. package/lib/migration-shim/sharedTreeShimFactory.d.ts +1 -2
  168. package/lib/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
  169. package/lib/migration-shim/sharedTreeShimFactory.js.map +1 -1
  170. package/lib/migration-shim/shimDeltaConnection.d.ts +16 -0
  171. package/lib/migration-shim/shimDeltaConnection.d.ts.map +1 -1
  172. package/lib/migration-shim/shimDeltaConnection.js +16 -2
  173. package/lib/migration-shim/shimDeltaConnection.js.map +1 -1
  174. package/lib/migration-shim/types.d.ts +1 -1
  175. package/lib/migration-shim/types.d.ts.map +1 -1
  176. package/lib/migration-shim/types.js.map +1 -1
  177. package/lib/persisted-types/0.0.2.d.ts +24 -24
  178. package/lib/persisted-types/0.0.2.js +5 -5
  179. package/lib/persisted-types/0.0.2.js.map +1 -1
  180. package/lib/persisted-types/0.1.1.d.ts +14 -14
  181. package/lib/persisted-types/0.1.1.js +3 -3
  182. package/lib/persisted-types/0.1.1.js.map +1 -1
  183. package/lib/test/utilities/TestUtilities.d.ts +1 -2
  184. package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
  185. package/lib/test/utilities/TestUtilities.js.map +1 -1
  186. package/package.json +25 -25
  187. package/src/ChangeTypes.ts +15 -15
  188. package/src/Checkout.ts +4 -4
  189. package/src/Common.ts +1 -1
  190. package/src/EagerCheckout.ts +1 -1
  191. package/src/EditLog.ts +4 -3
  192. package/src/EditUtilities.ts +5 -5
  193. package/src/EventTypes.ts +1 -1
  194. package/src/Forest.ts +5 -5
  195. package/src/Identifiers.ts +14 -14
  196. package/src/InitialTree.ts +1 -1
  197. package/src/LogViewer.ts +2 -2
  198. package/src/NodeIdUtilities.ts +3 -3
  199. package/src/PayloadUtilities.ts +1 -1
  200. package/src/ReconciliationPath.ts +3 -3
  201. package/src/RevisionValueCache.ts +2 -2
  202. package/src/RevisionView.ts +2 -2
  203. package/src/SharedTree.ts +14 -14
  204. package/src/Transaction.ts +3 -3
  205. package/src/TransactionInternal.ts +17 -17
  206. package/src/TreeView.ts +7 -7
  207. package/src/id-compressor/IdCompressor.ts +1 -1
  208. package/src/migration-shim/migrationShim.ts +17 -9
  209. package/src/migration-shim/migrationShimFactory.ts +2 -2
  210. package/src/migration-shim/sharedTreeShim.ts +6 -5
  211. package/src/migration-shim/sharedTreeShimFactory.ts +1 -2
  212. package/src/migration-shim/shimDeltaConnection.ts +16 -2
  213. package/src/migration-shim/types.ts +1 -1
  214. package/src/persisted-types/0.0.2.ts +24 -24
  215. package/src/persisted-types/0.1.1.ts +14 -14
@@ -11,13 +11,13 @@
11
11
  * A 128-bit Universally Unique IDentifier. Represented here
12
12
  * with a string of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,
13
13
  * where x is a lowercase hex digit.
14
- * @internal
14
+ * @alpha
15
15
  */
16
16
  export type UuidString = string & { readonly UuidString: '9d40d0ae-90d9-44b1-9482-9f55d59d5465' };
17
17
 
18
18
  /**
19
19
  * An identifier associated with a session for the purpose of attributing its created content to some user/entity.
20
- * @internal
20
+ * @alpha
21
21
  */
22
22
  export type AttributionId = UuidString;
23
23
 
@@ -35,7 +35,7 @@ export type SessionId = StableId & { readonly SessionId: '4498f850-e14e-4be9-8db
35
35
 
36
36
  /**
37
37
  * Edit identifier
38
- * @internal
38
+ * @alpha
39
39
  */
40
40
  export type EditId = UuidString & { readonly EditId: '56897beb-53e4-4e66-85da-4bf5cd5d0d49' };
41
41
 
@@ -45,13 +45,13 @@ export type EditId = UuidString & { readonly EditId: '56897beb-53e4-4e66-85da-4b
45
45
  * Within a given Edit, any DetachedSequenceId must be a source at most once, and a destination at most once.
46
46
  * If used as a source, it must be after it is used as a destination.
47
47
  * If this is violated, the Edit is considered malformed.
48
- * @internal
48
+ * @alpha
49
49
  */
50
50
  export type DetachedSequenceId = number & { readonly DetachedSequenceId: 'f7d7903a-194e-45e7-8e82-c9ef4333577d' };
51
51
 
52
52
  /**
53
53
  * An identifier (UUID) that has been shortened by a distributed compression algorithm.
54
- * @internal
54
+ * @alpha
55
55
  */
56
56
  export type CompressedId = FinalCompressedId | LocalCompressedId;
57
57
 
@@ -63,7 +63,7 @@ export type InternedStringId = number & { readonly InternedStringId: 'e221abc9-9
63
63
 
64
64
  /**
65
65
  * A brand for identity types that are unique within a particular session (SharedTree instance).
66
- * @internal
66
+ * @alpha
67
67
  */
68
68
  export interface SessionUnique {
69
69
  readonly SessionUnique: 'cea55054-6b82-4cbf-ad19-1fa645ea3b3e';
@@ -73,7 +73,7 @@ export interface SessionUnique {
73
73
  * A compressed ID that has been normalized into "session space" (see `IdCompressor` for more).
74
74
  * Consumer-facing APIs and data structures should use session-space IDs as their lifetime and equality is stable and tied to the
75
75
  * compressor that produced them.
76
- * @internal
76
+ * @alpha
77
77
  */
78
78
  export type SessionSpaceCompressedId = CompressedId & SessionUnique;
79
79
 
@@ -91,7 +91,7 @@ export type OpSpaceCompressedId = CompressedId & {
91
91
  * A compressed ID that is local to a document. Stable across all revisions of a document starting from the one in which it was created.
92
92
  * It should not be persisted outside of the history as it can only be decompressed in the context of the originating document.
93
93
  * If external persistence is needed (e.g. by a client), a StableId should be used instead.
94
- * @internal
94
+ * @alpha
95
95
  */
96
96
  export type FinalCompressedId = number & {
97
97
  readonly FinalCompressedId: '5d83d1e2-98b7-4e4e-a889-54c855cfa73d';
@@ -104,14 +104,14 @@ export type FinalCompressedId = number & {
104
104
  * A compressed ID that is local to a session (can only be decompressed when paired with a SessionId).
105
105
  * It should not be persisted outside of the history as it can only be decompressed in the context of the originating session.
106
106
  * If external persistence is needed (e.g. by a client), a StableId should be used instead.
107
- * @internal
107
+ * @alpha
108
108
  */
109
109
  export type LocalCompressedId = number & {
110
110
  readonly LocalCompressedId: '6fccb42f-e2a4-4243-bd29-f13d12b9c6d1';
111
111
  } & SessionUnique; // Same brand as CompressedId, as local IDs are always locally normalized
112
112
 
113
113
  /**
114
- * @internal
114
+ * @alpha
115
115
  */
116
116
  export interface NodeIdBrand {
117
117
  readonly NodeId: 'e53e7d6b-c8b9-431a-8805-4843fc639342';
@@ -120,7 +120,7 @@ export interface NodeIdBrand {
120
120
  /**
121
121
  * Node identifier.
122
122
  * Identifies a node within a document.
123
- * @internal
123
+ * @alpha
124
124
  */
125
125
  export type NodeId = number & SessionSpaceCompressedId & NodeIdBrand;
126
126
 
@@ -135,21 +135,21 @@ export type OpSpaceNodeId = number & OpSpaceCompressedId & NodeIdBrand;
135
135
  /**
136
136
  * Globally unique node identifier.
137
137
  * Uniquely identifies a node within and across documents. Can be used across SharedTree instances.
138
- * @internal
138
+ * @alpha
139
139
  */
140
140
  export type StableNodeId = string & { readonly StableNodeId: 'a0843b38-699d-4bb2-aa7a-16c502a71151' };
141
141
 
142
142
  /**
143
143
  * Definition.
144
144
  * A full (Uuid) persistable definition.
145
- * @internal
145
+ * @alpha
146
146
  */
147
147
  export type Definition = UuidString & { readonly Definition: 'c0ef9488-2a78-482d-aeed-37fba996354c' };
148
148
 
149
149
  /**
150
150
  * Definition.
151
151
  * A full (Uuid) persistable label for a trait.
152
- * @internal
152
+ * @alpha
153
153
  */
154
154
  export type TraitLabel = UuidString & { readonly TraitLabel: '613826ed-49cc-4df3-b2b8-bfc6866af8e3' };
155
155
 
@@ -9,7 +9,7 @@ import { ChangeNode_0_0_2 } from './persisted-types';
9
9
 
10
10
  /**
11
11
  * The initial tree.
12
- * @internal
12
+ * @alpha
13
13
  */
14
14
  export const initialTree: ChangeNode_0_0_2 = {
15
15
  traits: {},
package/src/LogViewer.ts CHANGED
@@ -143,7 +143,7 @@ export type CachedEditingResult = AttemptedEditResultCacheEntry & {
143
143
 
144
144
  /**
145
145
  * Creates `RevisionView`s for the revisions in an `EditLog`
146
- * @internal
146
+ * @alpha
147
147
  */
148
148
  export interface LogViewer {
149
149
  /**
@@ -212,7 +212,7 @@ export interface ICachingLogViewerEvents extends IEvent {
212
212
  *
213
213
  * Does so by listening for edits added to the log. If the underlying EditLog or its listeners need to be reused beyond the lifetime of
214
214
  * a CachingLogViewer instance, that instance should be disposed with `detachFromEditLog` to ensure it is garbage-collectable.
215
- * @internal
215
+ * @alpha
216
216
  */
217
217
  export class CachingLogViewer extends TypedEventEmitter<ICachingLogViewerEvents> implements LogViewer {
218
218
  public readonly log: EditLog<ChangeInternal>;
@@ -10,13 +10,13 @@ import { assertWithMessage } from './Common';
10
10
 
11
11
  /**
12
12
  * An object which can generate node IDs and convert node IDs between compressed and stable variants
13
- * @internal
13
+ * @alpha
14
14
  */
15
15
  export interface NodeIdContext extends NodeIdGenerator, NodeIdConverter {}
16
16
 
17
17
  /**
18
18
  * An object which can generate node IDs
19
- * @internal
19
+ * @alpha
20
20
  */
21
21
  export interface NodeIdGenerator {
22
22
  /**
@@ -35,7 +35,7 @@ export interface NodeIdGenerator {
35
35
 
36
36
  /**
37
37
  * An object which can convert node IDs between compressed and stable variants
38
- * @internal
38
+ * @alpha
39
39
  */
40
40
  export interface NodeIdConverter {
41
41
  /**
@@ -40,7 +40,7 @@ import { Payload } from './persisted-types';
40
40
  * IFluidHandle instances (detected via JavaScript feature detection pattern) are only compared by absolutePath.
41
41
  *
42
42
  * TODO:#54095: Is there a better way to do this comparison?
43
- * @internal
43
+ * @alpha
44
44
  */
45
45
  export function comparePayloads(a: Payload, b: Payload): boolean {
46
46
  // === is not reflective because of how NaN is handled, so use Object.is instead.
@@ -12,7 +12,7 @@ import { TreeView } from './TreeView';
12
12
  * change is actually applied.
13
13
  * The path only contains edits that were successfully applied.
14
14
  * This path is always empty for a change that has no concurrent edits.
15
- * @internal
15
+ * @alpha
16
16
  */
17
17
  export interface ReconciliationPath {
18
18
  /**
@@ -28,7 +28,7 @@ export interface ReconciliationPath {
28
28
 
29
29
  /**
30
30
  * An edit in the `ReconciliationPath`.
31
- * @internal
31
+ * @alpha
32
32
  */
33
33
  export interface ReconciliationEdit {
34
34
  /**
@@ -52,7 +52,7 @@ export interface ReconciliationEdit {
52
52
 
53
53
  /**
54
54
  * A change in the `ReconciliationPath`.
55
- * @internal
55
+ * @alpha
56
56
  */
57
57
  export interface ReconciliationChange {
58
58
  /**
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { assert } from '@fluidframework/core-utils';
7
- import BTree from 'sorted-btree';
7
+ import { BTree } from '@tylerbu/sorted-btree-es6';
8
8
  import LRU from 'lru-cache';
9
9
  import { fail, compareFiniteNumbers } from './Common';
10
10
 
@@ -17,7 +17,7 @@ import { fail, compareFiniteNumbers } from './Common';
17
17
  * - revision 0 corresponds to the initialRevision.
18
18
  *
19
19
  * - revision 1 corresponds to the output of editLog[0] applied to the initialRevision.
20
- * @internal
20
+ * @alpha
21
21
  */
22
22
  export type Revision = number;
23
23
 
@@ -13,7 +13,7 @@ import { HasVariadicTraits } from './ChangeTypes';
13
13
 
14
14
  /**
15
15
  * An immutable view of a distributed tree.
16
- * @internal
16
+ * @alpha
17
17
  */
18
18
  export class RevisionView extends TreeView {
19
19
  /**
@@ -86,7 +86,7 @@ export class RevisionView extends TreeView {
86
86
 
87
87
  /**
88
88
  * An view of a distributed tree that is part of an ongoing transaction between `RevisionView`s.
89
- * @internal
89
+ * @alpha
90
90
  */
91
91
  export class TransactionView extends TreeView {
92
92
  /** Conclude a transaction by generating an immutable `RevisionView` from this view */
package/src/SharedTree.ts CHANGED
@@ -103,13 +103,13 @@ import { nilUuid } from './UuidUtilities';
103
103
 
104
104
  /**
105
105
  * The write format and associated options used to construct a `SharedTree`
106
- * @internal
106
+ * @alpha
107
107
  */
108
108
  export type SharedTreeArgs<WF extends WriteFormat = WriteFormat> = [writeFormat: WF, options?: SharedTreeOptions<WF>];
109
109
 
110
110
  /**
111
111
  * The type of shared tree options for a given write format
112
- * @internal
112
+ * @alpha
113
113
  */
114
114
  export type SharedTreeOptions<
115
115
  WF extends WriteFormat,
@@ -126,7 +126,7 @@ export type SharedTreeOptions<
126
126
 
127
127
  /**
128
128
  * Configuration options for SharedTree that are independent of write format versions.
129
- * @internal
129
+ * @alpha
130
130
  */
131
131
  export interface SharedTreeBaseOptions {
132
132
  /**
@@ -147,7 +147,7 @@ export interface SharedTreeBaseOptions {
147
147
 
148
148
  /**
149
149
  * Configuration options for a SharedTree with write format 0.0.2
150
- * @internal
150
+ * @alpha
151
151
  */
152
152
  export interface SharedTreeOptions_0_0_2 {
153
153
  /**
@@ -169,7 +169,7 @@ export interface SharedTreeOptions_0_0_2 {
169
169
 
170
170
  /**
171
171
  * Configuration options for a SharedTree with write format 0.1.1
172
- * @internal
172
+ * @alpha
173
173
  */
174
174
  export interface SharedTreeOptions_0_1_1 {
175
175
  /**
@@ -194,7 +194,7 @@ export interface SharedTreeOptions_0_1_1 {
194
194
  /**
195
195
  * Factory for SharedTree.
196
196
  * Includes history in the summary.
197
- * @internal
197
+ * @alpha
198
198
  */
199
199
  export class SharedTreeFactory implements IChannelFactory {
200
200
  /**
@@ -288,7 +288,7 @@ const sortedWriteVersions = [WriteFormat.v0_0_2, WriteFormat.v0_1_1];
288
288
 
289
289
  /**
290
290
  * The arguments included when the EditCommitted SharedTreeEvent is emitted.
291
- * @internal
291
+ * @alpha
292
292
  */
293
293
  export interface EditCommittedEventArguments {
294
294
  /** The ID of the edit committed. */
@@ -301,7 +301,7 @@ export interface EditCommittedEventArguments {
301
301
 
302
302
  /**
303
303
  * The arguments included when the {@link SharedTreeEvent.SequencedEditApplied} SharedTreeEvent is emitted.
304
- * @internal
304
+ * @alpha
305
305
  */
306
306
  export interface SequencedEditAppliedEventArguments {
307
307
  /** The ID of the edit committed. */
@@ -320,7 +320,7 @@ export interface SequencedEditAppliedEventArguments {
320
320
 
321
321
  /**
322
322
  * The outcome of an edit.
323
- * @internal
323
+ * @alpha
324
324
  */
325
325
  export type EditApplicationOutcome =
326
326
  | {
@@ -346,7 +346,7 @@ export type EditApplicationOutcome =
346
346
 
347
347
  /**
348
348
  * Events which may be emitted by `SharedTree`. See {@link SharedTreeEvent} for documentation of event semantics.
349
- * @internal
349
+ * @alpha
350
350
  */
351
351
  export interface ISharedTreeEvents extends ISharedObjectEvents {
352
352
  (event: 'committedEdit', listener: EditCommittedHandler);
@@ -355,13 +355,13 @@ export interface ISharedTreeEvents extends ISharedObjectEvents {
355
355
 
356
356
  /**
357
357
  * Expected type for a handler of the `EditCommitted` event.
358
- * @internal
358
+ * @alpha
359
359
  */
360
360
  export type EditCommittedHandler = (args: EditCommittedEventArguments) => void;
361
361
 
362
362
  /**
363
363
  * Expected type for a handler of the {@link SharedTreeEvent.SequencedEditApplied} event.
364
- * @internal
364
+ * @alpha
365
365
  */
366
366
  export type SequencedEditAppliedHandler = (args: SequencedEditAppliedEventArguments) => void;
367
367
 
@@ -369,7 +369,7 @@ const sharedTreeTelemetryProperties: ITelemetryLoggerPropertyBags = { all: { isS
369
369
 
370
370
  /**
371
371
  * Contains information resulting from processing stashed shared tree ops
372
- * @internal
372
+ * @alpha
373
373
  */
374
374
  export interface StashedLocalOpMetadata {
375
375
  /** A modified version of the edit in an edit op that should be resubmitted rather than the original edit */
@@ -381,7 +381,7 @@ const stashedSessionId = '8477b8d5-cf6c-4673-8345-8f076a8f9bc6' as SessionId;
381
381
 
382
382
  /**
383
383
  * A [distributed tree](../Readme.md).
384
- * @internal
384
+ * @alpha
385
385
  */
386
386
  export class SharedTree extends SharedObject<ISharedTreeEvents> implements NodeIdContext {
387
387
  /**
@@ -16,7 +16,7 @@ import { RestOrArray, unwrapRestOrArray } from './Common';
16
16
 
17
17
  /**
18
18
  * An event emitted by a `Transaction` to indicate a state change. See {@link TransactionEvents} for event argument information.
19
- * @internal
19
+ * @alpha
20
20
  */
21
21
  export enum TransactionEvent {
22
22
  /**
@@ -27,7 +27,7 @@ export enum TransactionEvent {
27
27
 
28
28
  /**
29
29
  * Events which may be emitted by `Transaction`
30
- * @internal
30
+ * @alpha
31
31
  */
32
32
  export interface TransactionEvents extends IErrorEvent {
33
33
  (event: TransactionEvent.ViewChange, listener: (before: TreeView, after: TreeView) => void);
@@ -36,7 +36,7 @@ export interface TransactionEvents extends IErrorEvent {
36
36
  /**
37
37
  * Buffers changes to be applied to an isolated view of a `SharedTree` over time before applying them directly to the tree itself as a
38
38
  * single edit
39
- * @internal
39
+ * @alpha
40
40
  */
41
41
  export class Transaction extends TypedEventEmitter<TransactionEvents> {
42
42
  /** The view of the tree when this transaction was created */
@@ -43,7 +43,7 @@ export type EditingResult = FailedEditingResult | ValidEditingResult;
43
43
 
44
44
  /**
45
45
  * Basic result of applying a transaction.
46
- * @internal
46
+ * @alpha
47
47
  */
48
48
  export interface EditingResultBase {
49
49
  /**
@@ -91,7 +91,7 @@ export interface FailedEditingResult extends EditingResultBase {
91
91
 
92
92
  /**
93
93
  * Result of applying a valid transaction.
94
- * @internal
94
+ * @alpha
95
95
  */
96
96
  export interface ValidEditingResult extends EditingResultBase {
97
97
  /**
@@ -118,7 +118,7 @@ export type TransactionState = SucceedingTransactionState | FailingTransactionSt
118
118
 
119
119
  /**
120
120
  * The state of a transaction that has not encountered an error.
121
- * @internal
121
+ * @alpha
122
122
  */
123
123
  export interface SucceedingTransactionState {
124
124
  /**
@@ -430,7 +430,7 @@ export interface GenericTransactionPolicy {
430
430
  *
431
431
  * No data outside the Transaction is modified by Transaction:
432
432
  * the results from `close` must be used to actually submit an `Edit`.
433
- * @internal
433
+ * @alpha
434
434
  */
435
435
  // eslint-disable-next-line @typescript-eslint/no-namespace
436
436
  export namespace TransactionInternal {
@@ -836,7 +836,7 @@ export namespace TransactionInternal {
836
836
 
837
837
  /**
838
838
  * The kinds of failures that a transaction might encounter.
839
- * @internal
839
+ * @alpha
840
840
  */
841
841
  export enum FailureKind {
842
842
  /**
@@ -879,7 +879,7 @@ export namespace TransactionInternal {
879
879
 
880
880
  /**
881
881
  * A failure encountered by a transaction.
882
- * @internal
882
+ * @alpha
883
883
  */
884
884
  export type Failure =
885
885
  | UnusedDetachedSequenceFailure
@@ -894,7 +894,7 @@ export namespace TransactionInternal {
894
894
 
895
895
  /**
896
896
  * Error returned when a transaction is closed while there is an unused detached sequence.
897
- * @internal
897
+ * @alpha
898
898
  */
899
899
  export interface UnusedDetachedSequenceFailure {
900
900
  /**
@@ -909,7 +909,7 @@ export namespace TransactionInternal {
909
909
 
910
910
  /**
911
911
  * Error thrown when a transaction encounters a build operation using an already in use DetachedSequenceID.
912
- * @internal
912
+ * @alpha
913
913
  */
914
914
  export interface DetachedSequenceIdAlreadyInUseFailure {
915
915
  /**
@@ -928,7 +928,7 @@ export namespace TransactionInternal {
928
928
 
929
929
  /**
930
930
  * Error thrown when a transaction tries to operate on an unknown DetachedSequenceID
931
- * @internal
931
+ * @alpha
932
932
  */
933
933
  export interface DetachedSequenceNotFoundFailure {
934
934
  /**
@@ -947,7 +947,7 @@ export namespace TransactionInternal {
947
947
 
948
948
  /**
949
949
  * Error thrown when a build uses a duplicated NodeId
950
- * @internal
950
+ * @alpha
951
951
  */
952
952
  export interface DuplicateIdInBuildFailure {
953
953
  /**
@@ -966,7 +966,7 @@ export namespace TransactionInternal {
966
966
 
967
967
  /**
968
968
  * Error thrown when a build node ID is already used in the current state
969
- * @internal
969
+ * @alpha
970
970
  */
971
971
  export interface IdAlreadyInUseFailure {
972
972
  /**
@@ -985,7 +985,7 @@ export namespace TransactionInternal {
985
985
 
986
986
  /**
987
987
  * Error thrown when a change is attempted on an unknown NodeId
988
- * @internal
988
+ * @alpha
989
989
  */
990
990
  export interface UnknownIdFailure {
991
991
  /**
@@ -1004,7 +1004,7 @@ export namespace TransactionInternal {
1004
1004
 
1005
1005
  /**
1006
1006
  * Error thrown when an insert change uses an invalid Place
1007
- * @internal
1007
+ * @alpha
1008
1008
  */
1009
1009
  export interface BadPlaceFailure {
1010
1010
  /**
@@ -1027,7 +1027,7 @@ export namespace TransactionInternal {
1027
1027
 
1028
1028
  /**
1029
1029
  * Error thrown when a detach operation is given an invalid or malformed Range
1030
- * @internal
1030
+ * @alpha
1031
1031
  */
1032
1032
  export interface BadRangeFailure {
1033
1033
  /**
@@ -1050,7 +1050,7 @@ export namespace TransactionInternal {
1050
1050
 
1051
1051
  /**
1052
1052
  * Error thrown when a constraint fails to apply
1053
- * @internal
1053
+ * @alpha
1054
1054
  */
1055
1055
  export interface ConstraintViolationFailure {
1056
1056
  /**
@@ -1069,7 +1069,7 @@ export namespace TransactionInternal {
1069
1069
 
1070
1070
  /**
1071
1071
  * The details of what kind of constraint was violated and caused a ConstraintViolationFailure error to occur
1072
- * @internal
1072
+ * @alpha
1073
1073
  */
1074
1074
  export type ConstraintViolationResult =
1075
1075
  | {
@@ -1091,7 +1091,7 @@ export namespace TransactionInternal {
1091
1091
 
1092
1092
  /**
1093
1093
  * Enum of possible kinds of constraint violations that can be encountered
1094
- * @internal
1094
+ * @alpha
1095
1095
  */
1096
1096
  export enum ConstraintViolationKind {
1097
1097
  /**
package/src/TreeView.ts CHANGED
@@ -11,7 +11,7 @@ import { NodeData, Side } from './persisted-types';
11
11
 
12
12
  /**
13
13
  * Specifies the location of a trait (a labeled sequence of nodes) within the tree.
14
- * @internal
14
+ * @alpha
15
15
  */
16
16
  export interface TraitLocation {
17
17
  readonly parent: NodeId;
@@ -20,7 +20,7 @@ export interface TraitLocation {
20
20
 
21
21
  /**
22
22
  * An immutable view of a distributed tree node.
23
- * @internal
23
+ * @alpha
24
24
  */
25
25
  export interface TreeViewNode extends NodeData<NodeId> {
26
26
  /** The IDs of the children under this node */
@@ -34,7 +34,7 @@ export interface TreeViewNode extends NodeData<NodeId> {
34
34
  * 0 = before all nodes,
35
35
  * 1 = after first node,
36
36
  * etc.
37
- * @internal
37
+ * @alpha
38
38
  */
39
39
  export type PlaceIndex = number & { readonly PlaceIndex: unique symbol };
40
40
 
@@ -43,14 +43,14 @@ export type PlaceIndex = number & { readonly PlaceIndex: unique symbol };
43
43
  * 0 = first node,
44
44
  * 1 = second node,
45
45
  * etc.
46
- * @internal
46
+ * @alpha
47
47
  */
48
48
  export type TraitNodeIndex = number & { readonly TraitNodeIndex: unique symbol };
49
49
 
50
50
  /**
51
51
  * A place within a particular `TreeView` that is anchored relative to a specific node in the tree, or relative to the outside of the trait.
52
52
  * Valid iff 'trait' is valid and, if provided, sibling is in the Location specified by 'trait'.
53
- * @internal
53
+ * @alpha
54
54
  */
55
55
  export interface TreeViewPlace {
56
56
  readonly sibling?: NodeId;
@@ -61,7 +61,7 @@ export interface TreeViewPlace {
61
61
  /**
62
62
  * Specifies the range of nodes from `start` to `end` within a trait within a particular `TreeView`.
63
63
  * Valid iff start and end are valid and are within the same trait.
64
- * @internal
64
+ * @alpha
65
65
  */
66
66
  export interface TreeViewRange {
67
67
  readonly start: TreeViewPlace;
@@ -79,7 +79,7 @@ export interface NodeInTrait {
79
79
 
80
80
  /**
81
81
  * A view of a distributed tree.
82
- * @internal
82
+ * @alpha
83
83
  */
84
84
  export abstract class TreeView {
85
85
  public readonly root: NodeId;
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { assert } from '@fluidframework/core-utils';
9
9
  import { ITelemetryLoggerExt, createChildLogger } from '@fluidframework/telemetry-utils';
10
- import BTree from 'sorted-btree';
10
+ import { BTree } from '@tylerbu/sorted-btree-es6';
11
11
  import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
12
12
  import {
13
13
  hasLength,
@@ -5,6 +5,7 @@
5
5
  import { AttachState } from '@fluidframework/container-definitions';
6
6
  import { type IEvent, type IFluidHandle, type IFluidLoadable } from '@fluidframework/core-interfaces';
7
7
  import {
8
+ IChannelFactory,
8
9
  type IChannelAttributes,
9
10
  type IChannelServices,
10
11
  type IFluidDataStoreRuntime,
@@ -14,8 +15,10 @@ import {
14
15
  type IGarbageCollectionData,
15
16
  type ITelemetryContext,
16
17
  type ISummaryTreeWithStats,
18
+ IIdCompressorCore,
19
+ SessionId,
17
20
  } from '@fluidframework/runtime-definitions';
18
- import { type TreeFactory, type ITree } from '@fluid-experimental/tree2';
21
+ import { type ITree } from '@fluidframework/tree';
19
22
  import { assert } from '@fluidframework/core-utils';
20
23
  import { MessageType, type ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
21
24
  import { type EventEmitterEventType } from '@fluid-internal/client-utils';
@@ -59,6 +62,8 @@ export interface IMigrationOp {
59
62
  newAttributes: IChannelAttributes;
60
63
  }
61
64
 
65
+ const ghostSessionId = '3692b242-46c0-4076-abea-c2ac1e896dee' as SessionId;
66
+
62
67
  /**
63
68
  * The MigrationShim loads in place of the legacy SharedTree. It provides API surface for migrating it to the new SharedTree, while also providing access to the current SharedTree for usage.
64
69
  *
@@ -79,7 +84,7 @@ export class MigrationShim extends EventEmitterWithErrorHandling<IMigrationEvent
79
84
  public readonly id: string,
80
85
  private readonly runtime: IFluidDataStoreRuntime,
81
86
  private readonly legacyTreeFactory: LegacySharedTreeFactory,
82
- private readonly newTreeFactory: TreeFactory,
87
+ private readonly newTreeFactory: IChannelFactory,
83
88
  private readonly populateNewSharedObjectFn: (legacyTree: LegacySharedTree, newTree: ITree) => void
84
89
  ) {
85
90
  super((event: EventEmitterEventType, e: unknown) => this.eventListenerErrorHandler(event, e));
@@ -93,17 +98,20 @@ export class MigrationShim extends EventEmitterWithErrorHandling<IMigrationEvent
93
98
  }
94
99
 
95
100
  private readonly processMigrateOp = (message: ISequencedDocumentMessage): boolean => {
96
- if (
97
- // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
98
- message.type !== MessageType.Operation ||
99
- (message.contents as Partial<IMigrationOp>).type !== 'barrier'
100
- ) {
101
+ if (message.type !== MessageType.Operation || (message.contents as Partial<IMigrationOp>).type !== 'barrier') {
101
102
  return false;
102
103
  }
103
- const newTree = this.newTreeFactory.create(this.runtime, this.id);
104
+ const newTree = this.newTreeFactory.create(this.runtime, this.id) as ITree;
104
105
  assert(this.preMigrationDeltaConnection !== undefined, 0x82f /* Should be in v1 state */);
105
106
  this.preMigrationDeltaConnection.disableSubmit();
106
- this.populateNewSharedObjectFn(this.legacyTree, newTree);
107
+ const { idCompressor } = this.runtime;
108
+ if (idCompressor !== undefined) {
109
+ (idCompressor as unknown as IIdCompressorCore).beginGhostSession(ghostSessionId, () =>
110
+ this.populateNewSharedObjectFn(this.legacyTree, newTree)
111
+ );
112
+ } else {
113
+ this.populateNewSharedObjectFn(this.legacyTree, newTree);
114
+ }
107
115
  this.newTree = newTree;
108
116
  this.reconnect();
109
117
  this.emit('migrated');