From fd6d961c322175cec07bd7181445bc2407e3ed96 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Mon, 12 Jan 2026 11:36:56 -0800 Subject: [PATCH 01/12] plan: remove APIs for external custom DDSes --- plans/custom-dds-removal.md | 254 ++++++++++++++++++++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 plans/custom-dds-removal.md diff --git a/plans/custom-dds-removal.md b/plans/custom-dds-removal.md new file mode 100644 index 000000000000..cda177765680 --- /dev/null +++ b/plans/custom-dds-removal.md @@ -0,0 +1,254 @@ +# Custom DDS Removal Plan + +## Goal +Reduce exposure of DDS base classes and interfaces (`SharedObject`, `SharedObjectCore`, `IChannel`, `IChannelFactory`) to prevent external/third-party custom DDS implementations while ensuring all DDSes are owned by Fluid. + +--- + +## Current State Analysis + +### DDS Audit Results +Found **19 total DDS implementations** in the codebase - all are Fluid-owned: + +| Category | DDSes | +|----------|-------| +| **Active/Stable** | SharedCell, SharedMap, SharedDirectory, SharedTree, SharedSegmentSequence, TaskManager, ConsensusOrderedCollection, ConsensusRegisterCollection, PactMap, Ink | +| **Legacy (@legacy @beta)** | SharedCounter, SharedString, SharedMatrix, SharedSummaryBlock | +| **Internal Legacy** | SharedSignal, SharedArray (in legacy-dds package) | +| **PropertyDDS (experimental)** | SharedPropertyTree, DeflatedPropertyTree, LZ4PropertyTree | + +**No external/third-party DDSes found.** All DDSes are already in Fluid's codebase. + +### Open Question +- **Other DDSes**: Need to confirm whether there are other partner DDSes that are not yet accounted for. + +### Current Public API Surface (Enabling Custom DDS) + +**From `@fluidframework/shared-object-base` (index.ts:8-15):** +```typescript +export { + SharedObject, // @legacy @beta - base class for DDSes + SharedObjectCore, // @legacy @beta - core base class + type ISharedObjectKind, + type SharedObjectKind, // @sealed @public - safe type + createSharedObjectKind, // factory wrapper +} from "./sharedObject.js"; +export type { ISharedObject, ISharedObjectEvents } from "./types.js"; +``` + +**From `@fluidframework/datastore-definitions` (index.ts:13-20):** +```typescript +export type { + IChannel, // @legacy @beta - channel interface + IChannelFactory, // @legacy @beta - factory pattern + IChannelServices, + IChannelStorageService, + IDeltaConnection, + IDeltaHandler, // @legacy @beta - op processing +} from "./channel.js"; +``` + +### Code Comments Indicating Intent +- `sharedObject.ts:84-86`: "This class should eventually be made internal, as custom subclasses of it outside this repository are intended to be made unsupported in the future." +- `channel.ts:26-27`: "this should probably eventually become internal" +- `types.ts:56-58`: "This interface is not intended to be implemented outside this repository" + +--- + +## Implementation Plan + +### Phase 0: Pre-announce deprecations + +Add a changeset for the affected packages that describes the classes and types that will be deprecated in the upcoming release 2.82.0. The deprecated APIs will be fully removed in release 2.100.0. + +### Phase 1: Add Deprecation Notices + +Add `@deprecated` JSDoc tags to all public exports that enable custom DDS creation. + +**File: `packages/dds/shared-object-base/src/sharedObject.ts`** + +Update `SharedObjectCore` class (line 87): +```typescript +/** + * Base class from which all {@link ISharedObject|shared objects} derive. + * ...existing docs... + * @deprecated SharedObjectCore is intended for internal Fluid Framework use only. + * External implementations of custom DDSes are not supported and this class will + * be removed from the public API in a future release. + * @legacy @beta + */ +export abstract class SharedObjectCore<...> +``` + +Update `SharedObject` class (around line 740): +```typescript +/** + * ...existing docs... + * @deprecated SharedObject is intended for internal Fluid Framework use only. + * External implementations of custom DDSes are not supported and this class will + * be removed from the public API in a future release. Use existing DDS types + * (SharedMap, SharedTree, etc.) instead. + * @legacy @beta + */ +export abstract class SharedObject<...> +``` + +Update `createSharedObjectKind` function: +```typescript +/** + * ...existing docs... + * @deprecated createSharedObjectKind is intended for internal Fluid Framework use only. + * External implementations of custom DDSes are not supported and this function will + * be removed from the public API in a future release. + */ +export function createSharedObjectKind<...> +``` + +**File: `packages/dds/shared-object-base/src/types.ts`** + +Update `ISharedObject` interface: +```typescript +/** + * ...existing docs... + * @deprecated ISharedObject is intended for internal Fluid Framework use only. + * External implementations are not supported. Use existing DDS types instead. + * @legacy @beta + */ +export interface ISharedObject<...> +``` + +**File: `packages/runtime/datastore-definitions/src/channel.ts`** + +Update `IChannel` interface (line 36): +```typescript +/** + * ...existing docs... + * @deprecated IChannel is intended for internal Fluid Framework use only. + * External implementations of channels/DDSes are not supported and this interface + * will be removed from the public API in a future release. + * @legacy @beta + */ +export interface IChannel extends IFluidLoadable { +``` + +Update `IChannelFactory` interface (around line 294): +```typescript +/** + * ...existing docs... + * @deprecated IChannelFactory is intended for internal Fluid Framework use only. + * External implementations of custom DDSes are not supported and this interface + * will be removed from the public API in a future release. + * @legacy @beta + */ +export interface IChannelFactory { +``` + +Update `IDeltaHandler` interface (around line 140): +```typescript +/** + * ...existing docs... + * @deprecated IDeltaHandler is intended for internal Fluid Framework use only. + * @legacy @beta + */ +export interface IDeltaHandler { +``` + +### Phase 2: Add changesets + +Add changesets for the + +```markdown +## [Next Version] + +### Deprecations + +- SharedObject, SharedObjectCore, ISharedObject, and createSharedObjectKind have been deprecated ([#XXXXX](URL)) + + These APIs are intended for internal Fluid Framework use only. External implementations + of custom DDSes are not supported and these exports will be removed from the public API + in a future release. + + Applications should use the existing DDS types (SharedMap, SharedTree, SharedCell, etc.) + rather than implementing custom DDSes. +``` + +**File: `packages/runtime/datastore-definitions/CHANGELOG.md`** + +Add entry: +```markdown +## [Next Version] + +### Deprecations + +- IChannel, IChannelFactory, and IDeltaHandler have been deprecated ([#XXXXX](URL)) + + These interfaces are intended for internal Fluid Framework use only. External + implementations of channels/DDSes are not supported and these exports will be + removed from the public API in a future release. +``` + +### Phase 3: Run API Extractor & Verify + +After making the changes: + +1. Run build to regenerate API reports: + ```bash + pnpm build + ``` + +2. Verify API reports show deprecation: + - `packages/dds/shared-object-base/api-report/*.api.md` + - `packages/runtime/datastore-definitions/api-report/*.api.md` + +3. Run tests to ensure no regressions: + ```bash + pnpm test + ``` + +### Phase 4: Future Removal (2.100.0 release) + +In a subsequent minor release, move exports from public to internal: + +**File: `packages/dds/shared-object-base/src/index.ts`** + +Change from: +```typescript +export { + SharedObject, + SharedObjectCore, + ... +} from "./sharedObject.js"; +``` + +To only export in internal index, not public. The `SharedObjectKind` type (which is `@sealed`) remains public as the safe API. + +--- + +## Files to Modify + +| File | Changes | +|------|---------| +| `packages/dds/shared-object-base/src/sharedObject.ts` | Add @deprecated to SharedObjectCore, SharedObject, createSharedObjectKind | +| `packages/dds/shared-object-base/src/types.ts` | Add @deprecated to ISharedObject | +| `packages/runtime/datastore-definitions/src/channel.ts` | Add @deprecated to IChannel, IChannelFactory, IDeltaHandler | +| `packages/dds/shared-object-base/CHANGELOG.md` | Add deprecation notice | +| `packages/runtime/datastore-definitions/CHANGELOG.md` | Add deprecation notice | + +--- + +## Verification Plan + +1. **Build**: `pnpm build` - Ensure all packages compile +2. **Tests**: `pnpm test` - Ensure no test regressions +3. **API Reports**: Check that `@deprecated` appears in generated API reports +4. **Lint**: `pnpm lint` - Ensure no lint errors +5. **External Test**: (Manual) Confirm that TypeScript shows deprecation warnings when importing these APIs + +--- + +## Summary + +- **No external DDSes found** - All 19 DDSes are already Fluid-owned +- **Deprecation approach**: Add `@deprecated` JSDoc now, remove from public exports in follow-up release +- **Safe API preserved**: `SharedObjectKind` remains public and @sealed +- **Open question**: Need to confirm whether there are other partner DDSes that are not yet accounted for From 3e77c335f6408071972ac288b39492255d1e50f3 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Mon, 12 Jan 2026 11:42:15 -0800 Subject: [PATCH 02/12] cleanup --- plans/custom-dds-removal.md | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/plans/custom-dds-removal.md b/plans/custom-dds-removal.md index cda177765680..7e90e6617b37 100644 --- a/plans/custom-dds-removal.md +++ b/plans/custom-dds-removal.md @@ -155,36 +155,25 @@ export interface IDeltaHandler { ### Phase 2: Add changesets -Add changesets for the +Add changesets for the packages that are changed, describing the deprecations. Something like the following: ```markdown -## [Next Version] +SharedObject, SharedObjectCore, ISharedObject, and createSharedObjectKind are now deprecated -### Deprecations +These APIs are intended for internal Fluid Framework use only. External implementations +of custom DDSes are not supported and these exports will be removed from the public API +in a future release. -- SharedObject, SharedObjectCore, ISharedObject, and createSharedObjectKind have been deprecated ([#XXXXX](URL)) - - These APIs are intended for internal Fluid Framework use only. External implementations - of custom DDSes are not supported and these exports will be removed from the public API - in a future release. - - Applications should use the existing DDS types (SharedMap, SharedTree, SharedCell, etc.) - rather than implementing custom DDSes. +Applications should use the existing DDS types (SharedMap, SharedTree, SharedCell, etc.) +rather than implementing custom DDSes. ``` -**File: `packages/runtime/datastore-definitions/CHANGELOG.md`** - -Add entry: ```markdown -## [Next Version] - -### Deprecations - -- IChannel, IChannelFactory, and IDeltaHandler have been deprecated ([#XXXXX](URL)) +IChannel, IChannelFactory, and IDeltaHandler are now deprecated - These interfaces are intended for internal Fluid Framework use only. External - implementations of channels/DDSes are not supported and these exports will be - removed from the public API in a future release. +These interfaces are intended for internal Fluid Framework use only. External +implementations of channels/DDSes are not supported and these exports will be +removed from the public API in a future release. ``` ### Phase 3: Run API Extractor & Verify From c9df98c5910c4c390a1e8b3b72f02e12bb65f612 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Mon, 12 Jan 2026 15:11:07 -0800 Subject: [PATCH 03/12] docs(plan): update custom DDS removal plan based on PR feedback - Expanded goals section to include faster iteration and API simplification - Added experimental SharedTree to DDS inventory (now 20 total) - Added IChannelAttributes, IChannelServices, IChannelStorageService, IDeltaConnection to the list of types to internalize - Changed approach from deprecate-then-remove to direct internalization - Added note about IChannel exposure at datastore layer needing special handling - Updated changeset content to promote SharedTree as recommended DDS - Added PR review notes section documenting feedback --- plans/custom-dds-removal.md | 258 +++++++++++++++--------------------- 1 file changed, 110 insertions(+), 148 deletions(-) diff --git a/plans/custom-dds-removal.md b/plans/custom-dds-removal.md index 7e90e6617b37..480da867aeb7 100644 --- a/plans/custom-dds-removal.md +++ b/plans/custom-dds-removal.md @@ -1,21 +1,26 @@ # Custom DDS Removal Plan -## Goal -Reduce exposure of DDS base classes and interfaces (`SharedObject`, `SharedObjectCore`, `IChannel`, `IChannelFactory`) to prevent external/third-party custom DDS implementations while ensuring all DDSes are owned by Fluid. +## Goals + +1. **Reduce public API surface** - Remove DDS base classes and interfaces (`SharedObject`, `SharedObjectCore`, `IChannel`, `IChannelFactory`, etc.) from the public API to prevent external/third-party custom DDS implementations. + +2. **Enable faster iteration** - When these types are public or `@legacy @beta`, changes must move slowly due to compatibility requirements. Making them internal allows the team to iterate more rapidly on DDS infrastructure. + +3. **Simplify the API** - Consolidate around SharedTree as the recommended DDS for most use cases, while maintaining existing DDSes for specific scenarios. --- ## Current State Analysis ### DDS Audit Results -Found **19 total DDS implementations** in the codebase - all are Fluid-owned: +Found **20 total DDS implementations** in the codebase - all are Fluid-owned: | Category | DDSes | |----------|-------| | **Active/Stable** | SharedCell, SharedMap, SharedDirectory, SharedTree, SharedSegmentSequence, TaskManager, ConsensusOrderedCollection, ConsensusRegisterCollection, PactMap, Ink | | **Legacy (@legacy @beta)** | SharedCounter, SharedString, SharedMatrix, SharedSummaryBlock | | **Internal Legacy** | SharedSignal, SharedArray (in legacy-dds package) | -| **PropertyDDS (experimental)** | SharedPropertyTree, DeflatedPropertyTree, LZ4PropertyTree | +| **Experimental** | SharedPropertyTree, DeflatedPropertyTree, LZ4PropertyTree (PropertyDDS), experimental SharedTree (in `experimental/dds/tree`) | **No external/third-party DDSes found.** All DDSes are already in Fluid's codebase. @@ -36,16 +41,17 @@ export { export type { ISharedObject, ISharedObjectEvents } from "./types.js"; ``` -**From `@fluidframework/datastore-definitions` (index.ts:13-20):** +**From `@fluidframework/datastore-definitions` (index.ts:13-20, 34):** ```typescript export type { - IChannel, // @legacy @beta - channel interface - IChannelFactory, // @legacy @beta - factory pattern - IChannelServices, - IChannelStorageService, - IDeltaConnection, - IDeltaHandler, // @legacy @beta - op processing + IChannel, // @legacy @beta - channel interface + IChannelFactory, // @legacy @beta - factory pattern + IChannelServices, // @legacy @beta - services bundle + IChannelStorageService,// @legacy @beta - storage service + IDeltaConnection, // @legacy @beta - delta connection + IDeltaHandler, // @legacy @beta - op processing } from "./channel.js"; +export type { IChannelAttributes } from "./storage.js"; // @legacy @beta ``` ### Code Comments Indicating Intent @@ -57,187 +63,143 @@ export type { ## Implementation Plan -### Phase 0: Pre-announce deprecations - -Add a changeset for the affected packages that describes the classes and types that will be deprecated in the upcoming release 2.82.0. The deprecated APIs will be fully removed in release 2.100.0. +### Recommended Approach -### Phase 1: Add Deprecation Notices +Based on feedback, the recommended approach is to **make things internal directly** and use build tooling to discover any issues. Deprecation is an intermediate step that may not be necessary if we're confident in making the change. However, we still need to announce the breaking change. -Add `@deprecated` JSDoc tags to all public exports that enable custom DDS creation. +### Phase 0: Pre-announce API changes -**File: `packages/dds/shared-object-base/src/sharedObject.ts`** +Add a changeset for the affected packages that describes the types that will be made internal in the upcoming release. This gives consumers notice of the upcoming change. -Update `SharedObjectCore` class (line 87): -```typescript -/** - * Base class from which all {@link ISharedObject|shared objects} derive. - * ...existing docs... - * @deprecated SharedObjectCore is intended for internal Fluid Framework use only. - * External implementations of custom DDSes are not supported and this class will - * be removed from the public API in a future release. - * @legacy @beta - */ -export abstract class SharedObjectCore<...> -``` +### Phase 1: Move exports from public to internal -Update `SharedObject` class (around line 740): -```typescript -/** - * ...existing docs... - * @deprecated SharedObject is intended for internal Fluid Framework use only. - * External implementations of custom DDSes are not supported and this class will - * be removed from the public API in a future release. Use existing DDS types - * (SharedMap, SharedTree, etc.) instead. - * @legacy @beta - */ -export abstract class SharedObject<...> -``` +Move all DDS-implementation-enabling exports to internal-only. The following types should be moved: -Update `createSharedObjectKind` function: -```typescript -/** - * ...existing docs... - * @deprecated createSharedObjectKind is intended for internal Fluid Framework use only. - * External implementations of custom DDSes are not supported and this function will - * be removed from the public API in a future release. - */ -export function createSharedObjectKind<...> -``` +**From `@fluidframework/shared-object-base`:** +- `SharedObject` - base class +- `SharedObjectCore` - core base class +- `ISharedObject` - interface +- `ISharedObjectEvents` - events interface +- `createSharedObjectKind` - factory creator +- `ISharedObjectKind` - type (keep `SharedObjectKind` public as the safe sealed type) -**File: `packages/dds/shared-object-base/src/types.ts`** +**From `@fluidframework/datastore-definitions`:** +- `IChannel` - channel interface (note: has exposure at datastore layer - need to sever typing) +- `IChannelFactory` - factory interface +- `IChannelServices` - services bundle +- `IChannelStorageService` - storage service interface +- `IDeltaConnection` - delta connection interface +- `IDeltaHandler` - op processing interface +- `IChannelAttributes` - channel attributes -Update `ISharedObject` interface: -```typescript -/** - * ...existing docs... - * @deprecated ISharedObject is intended for internal Fluid Framework use only. - * External implementations are not supported. Use existing DDS types instead. - * @legacy @beta - */ -export interface ISharedObject<...> -``` +### Phase 2: Identify additional types -**File: `packages/runtime/datastore-definitions/src/channel.ts`** +Manually inspect the API reports at the lowest shipped layer to identify any additional types that should be made internal. Use build tooling and trial/error to discover issues. -Update `IChannel` interface (line 36): -```typescript -/** - * ...existing docs... - * @deprecated IChannel is intended for internal Fluid Framework use only. - * External implementations of channels/DDSes are not supported and this interface - * will be removed from the public API in a future release. - * @legacy @beta - */ -export interface IChannel extends IFluidLoadable { -``` +Check API reports: +- `packages/dds/shared-object-base/api-report/*.api.md` +- `packages/runtime/datastore-definitions/api-report/*.api.md` -Update `IChannelFactory` interface (around line 294): -```typescript -/** - * ...existing docs... - * @deprecated IChannelFactory is intended for internal Fluid Framework use only. - * External implementations of custom DDSes are not supported and this interface - * will be removed from the public API in a future release. - * @legacy @beta - */ -export interface IChannelFactory { -``` +### Phase 3: Address IChannel at datastore layer -Update `IDeltaHandler` interface (around line 140): -```typescript -/** - * ...existing docs... - * @deprecated IDeltaHandler is intended for internal Fluid Framework use only. - * @legacy @beta - */ -export interface IDeltaHandler { -``` - -### Phase 2: Add changesets - -Add changesets for the packages that are changed, describing the deprecations. Something like the following: - -```markdown -SharedObject, SharedObjectCore, ISharedObject, and createSharedObjectKind are now deprecated - -These APIs are intended for internal Fluid Framework use only. External implementations -of custom DDSes are not supported and these exports will be removed from the public API -in a future release. - -Applications should use the existing DDS types (SharedMap, SharedTree, SharedCell, etc.) -rather than implementing custom DDSes. -``` - -```markdown -IChannel, IChannelFactory, and IDeltaHandler are now deprecated - -These interfaces are intended for internal Fluid Framework use only. External -implementations of channels/DDSes are not supported and these exports will be -removed from the public API in a future release. -``` +The `IChannel` interface has some exposure at the datastore layer. A plan is needed to sever the typing between the datastore layer and the channel layer when `IChannel` becomes internal. This may require: +- Creating a narrower public interface for datastore interactions +- Updating datastore APIs to not expose `IChannel` directly +- Possibly using `unknown` or a new minimal interface type -### Phase 3: Run API Extractor & Verify +### Phase 4: Build and verify After making the changes: -1. Run build to regenerate API reports: +1. Run build to regenerate API reports and discover issues: ```bash pnpm build ``` -2. Verify API reports show deprecation: - - `packages/dds/shared-object-base/api-report/*.api.md` - - `packages/runtime/datastore-definitions/api-report/*.api.md` +2. Address any build errors that indicate types are being used across package boundaries unexpectedly. -3. Run tests to ensure no regressions: +3. Verify API reports no longer export the internal types publicly. + +4. Run tests to ensure no regressions: ```bash pnpm test ``` -### Phase 4: Future Removal (2.100.0 release) +--- -In a subsequent minor release, move exports from public to internal: +## Files to Modify -**File: `packages/dds/shared-object-base/src/index.ts`** +| File | Changes | +|------|---------| +| `packages/dds/shared-object-base/src/index.ts` | Move SharedObject, SharedObjectCore, ISharedObject, createSharedObjectKind, ISharedObjectKind to internal exports only | +| `packages/dds/shared-object-base/src/sharedObject.ts` | Update API tags from @legacy @beta to @internal | +| `packages/dds/shared-object-base/src/types.ts` | Update API tags from @legacy @beta to @internal | +| `packages/runtime/datastore-definitions/src/index.ts` | Move channel-related types to internal exports only | +| `packages/runtime/datastore-definitions/src/channel.ts` | Update API tags from @legacy @beta to @internal | +| `packages/runtime/datastore-definitions/src/storage.ts` | Update IChannelAttributes API tag to @internal | -Change from: -```typescript -export { - SharedObject, - SharedObjectCore, - ... -} from "./sharedObject.js"; -``` +--- -To only export in internal index, not public. The `SharedObjectKind` type (which is `@sealed`) remains public as the safe API. +## Changeset Content +### For `@fluidframework/shared-object-base`: +```markdown +--- +"@fluidframework/shared-object-base": major --- -## Files to Modify +SharedObject, SharedObjectCore, ISharedObject, ISharedObjectEvents, createSharedObjectKind, and ISharedObjectKind are now internal -| File | Changes | -|------|---------| -| `packages/dds/shared-object-base/src/sharedObject.ts` | Add @deprecated to SharedObjectCore, SharedObject, createSharedObjectKind | -| `packages/dds/shared-object-base/src/types.ts` | Add @deprecated to ISharedObject | -| `packages/runtime/datastore-definitions/src/channel.ts` | Add @deprecated to IChannel, IChannelFactory, IDeltaHandler | -| `packages/dds/shared-object-base/CHANGELOG.md` | Add deprecation notice | -| `packages/runtime/datastore-definitions/CHANGELOG.md` | Add deprecation notice | +These APIs are intended for internal Fluid Framework use only. External implementations +of custom DDSes are not supported. These exports have been moved to internal and are +no longer available in the public API. + +Applications should use SharedTree or another existing DDS type (SharedMap, SharedCell, etc.) +rather than implementing custom DDSes. The `SharedObjectKind` type remains public as the +safe, sealed type for referencing DDS kinds. +``` + +### For `@fluidframework/datastore-definitions`: +```markdown +--- +"@fluidframework/datastore-definitions": major +--- + +IChannel, IChannelFactory, IChannelServices, IChannelStorageService, IDeltaConnection, IDeltaHandler, and IChannelAttributes are now internal + +These interfaces are intended for internal Fluid Framework use only. External +implementations of channels/DDSes are not supported. These exports have been moved +to internal and are no longer available in the public API. +``` --- ## Verification Plan -1. **Build**: `pnpm build` - Ensure all packages compile +1. **Build**: `pnpm build` - Ensure all packages compile and use tooling to discover type exposure issues 2. **Tests**: `pnpm test` - Ensure no test regressions -3. **API Reports**: Check that `@deprecated` appears in generated API reports +3. **API Reports**: Verify internal types no longer appear in public API reports 4. **Lint**: `pnpm lint` - Ensure no lint errors -5. **External Test**: (Manual) Confirm that TypeScript shows deprecation warnings when importing these APIs +5. **Cross-package**: Verify no public packages depend on these types in their public APIs --- ## Summary -- **No external DDSes found** - All 19 DDSes are already Fluid-owned -- **Deprecation approach**: Add `@deprecated` JSDoc now, remove from public exports in follow-up release +- **No external DDSes found** - All 20 DDSes are already Fluid-owned +- **Direct internal approach**: Move types to internal rather than deprecate-then-remove - **Safe API preserved**: `SharedObjectKind` remains public and @sealed +- **SharedTree promoted**: Deprecation messages should recommend SharedTree as the primary DDS +- **Datastore layer concern**: IChannel exposure at datastore layer needs special handling - **Open question**: Need to confirm whether there are other partner DDSes that are not yet accounted for + +--- + +## Notes from PR Review + +- Per @anthony-murphy: Aggressively deprecate/internalize anything no longer needed - IChannelAttributes, IChannelServices and child types +- Per @anthony-murphy: IChannel has exposure at datastore layer, need plan to sever typing when internal +- Per @anthony-murphy: Prefer making things internal directly and using build tooling to discover problems +- Per @markfields: Another goal is enabling faster iteration on these types +- Per @markfields: Include experimental SharedTree in the DDS list +- Per @markfields: Promote SharedTree specifically in migration guidance From 941ebb6b4caf64040c16d1c0d48f5c1d8c497da9 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Mon, 12 Jan 2026 17:01:22 -0800 Subject: [PATCH 04/12] update plan to include IChannel details --- plans/custom-dds-removal.md | 98 +++++++++++++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 4 deletions(-) diff --git a/plans/custom-dds-removal.md b/plans/custom-dds-removal.md index 480da867aeb7..71eaad98b711 100644 --- a/plans/custom-dds-removal.md +++ b/plans/custom-dds-removal.md @@ -102,10 +102,100 @@ Check API reports: ### Phase 3: Address IChannel at datastore layer -The `IChannel` interface has some exposure at the datastore layer. A plan is needed to sever the typing between the datastore layer and the channel layer when `IChannel` becomes internal. This may require: -- Creating a narrower public interface for datastore interactions -- Updating datastore APIs to not expose `IChannel` directly -- Possibly using `unknown` or a new minimal interface type +#### The Problem + +`IFluidDataStoreRuntime` (marked `@legacy @beta`) has methods that reference `IChannel`: + +```typescript +interface IFluidDataStoreRuntime { + getChannel(id: string): Promise; + createChannel(id: string | undefined, type: string): IChannel; + addChannel(channel: IChannel): void; + bindChannel(channel: IChannel): void; +} +``` + +If `IChannel` becomes `@internal`, API-extractor will report incompatible release tags. + +#### Usage Analysis + +Analyzed how these methods are used across the codebase: + +1. **Pattern: Create → Cast → Use** (most common) + ```typescript + const channel = runtime.createChannel(id, SharedMap.getFactory().type); + const map = channel as SharedMap; // Immediate cast to specific DDS + map.set("key", value); + ``` + +2. **Pattern: Get → Cast → Use** + ```typescript + const channel = await runtime.getChannel(id); + const map = channel as ISharedMap; + ``` + +3. **`addChannel`/`bindChannel`**: Only used internally by DDS implementations. + +**Key Finding**: External callers ALWAYS immediately cast `IChannel` to specific DDS types. They never use `IChannel` methods directly. + +#### IChannel Methods (Service-Level Only) + +These methods are only used by the runtime, not by external code: +- `getAttachSummary()` - Summary generation +- `summarize()` - Summary generation +- `isAttached()` - Attachment state +- `connect()` - Connection setup +- `getGCData()` - Garbage collection +- `attributes` - Channel metadata + +External code only accesses: +- `handle` (from `IFluidLoadable`) +- `id` (rarely) +- Casting to specific DDS types + +#### Recommended Solution: Phased Internalization + +Rather than creating a new minimal interface (which adds API surface), use a phased approach: + +**Phase 3a: Keep `IChannel` as `@legacy @beta`** +- `IChannel` remains accessible in the legacy API +- `IChannelAttributes` remains accessible (referenced by `IChannel.attributes`) +- This maintains `IFluidDataStoreRuntime` compatibility + +**Phase 3b: Internalize implementation-enabling interfaces** +Make `IChannelFactory` `@internal` to prevent custom DDS factory implementations. + +**Transitive dependency constraint**: The following interfaces CANNOT be made internal because +they are transitively referenced by `IChannel` (which must remain public for `IFluidDataStoreRuntime`): +- `IChannelServices` - Referenced by `IChannel.connect(services: IChannelServices)` +- `IChannelStorageService` - Referenced by `IChannelServices.objectStorage` +- `IDeltaConnection` - Referenced by `IChannelServices.deltaConnection` +- `IDeltaHandler` - Referenced by `IDeltaConnection.attach(handler: IDeltaHandler)` + +**Why this still works**: To implement a custom DDS, you need: +1. ❌ `SharedObject`/`SharedObjectCore` base classes → Now `@internal` +2. ❌ `IChannelFactory` to create the factory → Now `@internal` +3. ⚠️ `IChannelServices` et al. → Must stay `@legacy @beta` but useless without #1 and #2 + +Keeping `IChannel` and its dependencies as `@legacy @beta` is acceptable because: +- External code can't implement it (no base class) +- External code can't create custom factories (no `IChannelFactory`) +- The service interfaces are useless without the implementation infrastructure +- It maintains backward compatibility with `IFluidDataStoreRuntime` + +#### Alternative Approaches (Not Recommended) + +1. **Use `unknown` return type**: Loses type safety, requires casts everywhere +2. **Create minimal public interface**: Adds API surface, requires migration +3. **Split `IFluidDataStoreRuntime`**: Major breaking change +4. **Make everything internal**: Breaks `IFluidDataStoreRuntime` compatibility + +#### Future Consideration + +In a future major version, `IChannel` could potentially be made internal by: +1. Updating `IFluidDataStoreRuntime` methods to return `IFluidLoadable & { id: string }` +2. Or deprecating the channel methods entirely in favor of higher-level APIs +3. This would require coordinated changes across multiple packages ### Phase 4: Build and verify From 2e627f68b16202209e40340cd1c72ddc5e3d549d Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Tue, 13 Jan 2026 11:58:57 -0800 Subject: [PATCH 05/12] docs(plan): address PR review comments - Move PactMap and Ink from Active/Stable to Experimental category - Add type check/narrowing function approach to Future Considerations - Add Follow-up Items section for IFluidDataStoreRuntime cleanup Addresses feedback from @ChumpChief and @anthony-murphy. --- ...ustom-dds-removal-datastore-definitions.md | 20 ++++++ .../custom-dds-removal-shared-object-base.md | 14 ++++ .../shared-object-base.legacy.beta.api.md | 72 ------------------- .../shared-object-base/src/sharedObject.ts | 10 ++- packages/dds/shared-object-base/src/types.ts | 7 +- .../datastore-definitions.legacy.alpha.api.md | 8 --- .../datastore-definitions.legacy.beta.api.md | 8 --- .../datastore-definitions/src/channel.ts | 2 +- plans/custom-dds-removal.md | 24 +++++-- 9 files changed, 61 insertions(+), 104 deletions(-) create mode 100644 .changeset/custom-dds-removal-datastore-definitions.md create mode 100644 .changeset/custom-dds-removal-shared-object-base.md diff --git a/.changeset/custom-dds-removal-datastore-definitions.md b/.changeset/custom-dds-removal-datastore-definitions.md new file mode 100644 index 000000000000..c68438ccfd0a --- /dev/null +++ b/.changeset/custom-dds-removal-datastore-definitions.md @@ -0,0 +1,20 @@ +--- +"@fluidframework/datastore-definitions": major +"__section": breaking +--- + +IChannelFactory is now internal + +The `IChannelFactory` interface is intended for internal Fluid Framework use only. It is +required to implement custom DDS factories, which is not supported for external use. +This export has been moved to internal and is no longer available in the public API. + +Note: Other channel-related interfaces (`IChannel`, `IChannelAttributes`, `IChannelServices`, +`IChannelStorageService`, `IDeltaConnection`, `IDeltaHandler`) remain in the legacy API as +they are transitively referenced by `IChannel` and `IFluidDataStoreRuntime`. However, without +access to `IChannelFactory` and the `SharedObject`/`SharedObjectCore` base classes (which are +also now internal in `@fluidframework/shared-object-base`), implementing custom DDSes is not +possible. + +Applications should use SharedTree or another existing DDS type (SharedMap, SharedCell, etc.) +rather than implementing custom DDSes. diff --git a/.changeset/custom-dds-removal-shared-object-base.md b/.changeset/custom-dds-removal-shared-object-base.md new file mode 100644 index 000000000000..3e4b03009140 --- /dev/null +++ b/.changeset/custom-dds-removal-shared-object-base.md @@ -0,0 +1,14 @@ +--- +"@fluidframework/shared-object-base": major +"__section": breaking +--- + +SharedObject, SharedObjectCore, ISharedObject, ISharedObjectEvents, createSharedObjectKind, and ISharedObjectKind are now internal + +These APIs are intended for internal Fluid Framework use only. External implementations +of custom DDSes are not supported. These exports have been moved to internal and are +no longer available in the public API. + +Applications should use SharedTree or another existing DDS type (SharedMap, SharedCell, etc.) +rather than implementing custom DDSes. The `SharedObjectKind` type remains public as the +safe, sealed type for referencing DDS kinds. diff --git a/packages/dds/shared-object-base/api-report/shared-object-base.legacy.beta.api.md b/packages/dds/shared-object-base/api-report/shared-object-base.legacy.beta.api.md index 29144c3a4b7e..33c3c1fb5543 100644 --- a/packages/dds/shared-object-base/api-report/shared-object-base.legacy.beta.api.md +++ b/packages/dds/shared-object-base/api-report/shared-object-base.legacy.beta.api.md @@ -12,84 +12,12 @@ export interface IFluidSerializer { stringify(value: unknown, bind: IFluidHandle): string; } -// @beta @legacy -export interface ISharedObject extends IChannel, IEventProvider { - bindToContext(): void; -} - -// @beta @legacy -export interface ISharedObjectEvents extends IErrorEvent { - // @eventProperty - (event: "pre-op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any; - // @eventProperty - (event: "op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any; -} - -// @beta @legacy -export interface ISharedObjectKind { - create(runtime: IFluidDataStoreRuntime, id?: string): TSharedObject; - getFactory(): IChannelFactory; -} - // @beta @legacy export function makeHandlesSerializable(value: unknown, serializer: IFluidSerializer, bind: IFluidHandle): unknown; // @beta @legacy export function parseHandles(value: unknown, serializer: IFluidSerializer): unknown; -// @beta @legacy -export abstract class SharedObject extends SharedObjectCore { - constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes, - telemetryContextPrefix: string); - getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats; - getGCData(fullGC?: boolean): IGarbageCollectionData; - protected processGCDataCore(serializer: IFluidSerializer): void; - // (undocumented) - protected get serializer(): IFluidSerializer; - summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): Promise; - protected abstract summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext, fullTree?: boolean): ISummaryTreeWithStats; -} - -// @beta @legacy -export abstract class SharedObjectCore extends EventEmitterWithErrorHandling implements ISharedObject { - constructor( - id: string, - runtime: IFluidDataStoreRuntime, - attributes: IChannelAttributes); - protected abstract applyStashedOp(content: unknown): void; - readonly attributes: IChannelAttributes; - bindToContext(): void; - connect(services: IChannelServices): void; - get connected(): boolean; - protected get deltaManager(): IDeltaManager; - protected didAttach(): void; - protected dirty(): void; - emit(event: EventEmitterEventType, ...args: any[]): boolean; - abstract getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats; - abstract getGCData(fullGC?: boolean): IGarbageCollectionData; - readonly handle: IFluidHandleInternal; - id: string; - // (undocumented) - get IFluidLoadable(): this; - initializeLocal(): void; - protected initializeLocalCore(): void; - isAttached(): boolean; - load(services: IChannelServices): Promise; - protected abstract loadCore(services: IChannelStorageService): Promise; - protected readonly logger: ITelemetryLoggerExt; - protected newAckBasedPromise(executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: unknown) => void) => void): Promise; - protected onConnect(): void; - protected abstract onDisconnect(): void; - protected abstract processMessagesCore(messagesCollection: IRuntimeMessageCollection): void; - protected reSubmitCore(content: unknown, localOpMetadata: unknown): void; - protected reSubmitSquashed(content: unknown, localOpMetadata: unknown): void; - protected rollback(content: unknown, localOpMetadata: unknown): void; - protected runtime: IFluidDataStoreRuntime; - protected abstract get serializer(): IFluidSerializer; - protected submitLocalMessage(content: unknown, localOpMetadata?: unknown): void; - abstract summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise; -} - // @public @sealed export interface SharedObjectKind extends ErasedType { is(value: IFluidLoadable): value is IFluidLoadable & TSharedObject; diff --git a/packages/dds/shared-object-base/src/sharedObject.ts b/packages/dds/shared-object-base/src/sharedObject.ts index 7ca5d73b34f4..975e3108d538 100644 --- a/packages/dds/shared-object-base/src/sharedObject.ts +++ b/packages/dds/shared-object-base/src/sharedObject.ts @@ -81,9 +81,7 @@ interface ProcessTelemetryProperties { * or if the intention is that no other implementations should exist and creating some might break things. * As part of this, any existing implementations of ISharedObject (via SharedObjectCore or otherwise) in use by legacy API users will need to be considered. * - * TODO: - * This class should eventually be made internal, as custom subclasses of it outside this repository are intended to be made unsupported in the future. - * @legacy @beta + * @internal */ export abstract class SharedObjectCore< TEvent extends ISharedObjectEvents = ISharedObjectEvents, @@ -735,9 +733,9 @@ export abstract class SharedObjectCore< * @privateRemarks * TODO: * This class is badly named. - * Once it becomes `@internal` "SharedObjectCore" should probably become "SharedObject" + * "SharedObjectCore" should probably become "SharedObject" * and this class should be renamed to something like "SharedObjectSynchronous". - * @legacy @beta + * @internal */ export abstract class SharedObject< TEvent extends ISharedObjectEvents = ISharedObjectEvents, @@ -926,7 +924,7 @@ export abstract class SharedObject< * This does not extend {@link SharedObjectKind} since doing so would prevent implementing this interface in type safe code. * Any implementation of this can safely be used as a {@link SharedObjectKind} with an explicit type conversion, * but doing so is typically not needed as {@link createSharedObjectKind} is used to produce values that are both types simultaneously. - * @legacy @beta + * @internal */ export interface ISharedObjectKind { /** diff --git a/packages/dds/shared-object-base/src/types.ts b/packages/dds/shared-object-base/src/types.ts index 856601423782..0b9c4761e82d 100644 --- a/packages/dds/shared-object-base/src/types.ts +++ b/packages/dds/shared-object-base/src/types.ts @@ -13,7 +13,7 @@ import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitio /** * Events emitted by {@link ISharedObject}. - * @legacy @beta + * @internal */ export interface ISharedObjectEvents extends IErrorEvent { /** @@ -53,9 +53,6 @@ export interface ISharedObjectEvents extends IErrorEvent { /** * Base interface for shared objects from which other interfaces extend. - * @remarks - * This interface is not intended to be implemented outside this repository: - * implementers should migrate to using an existing implementation instead. * @privateRemarks * Implemented by {@link SharedObjectCore}. * @@ -65,7 +62,7 @@ export interface ISharedObjectEvents extends IErrorEvent { * Additionally the docs here need to define what a shared object is, not just claim this interface is for them. * If the intention is that the "shared object" concept `IFluidLoadable` mentions is only ever implemented by this interface then even more concept unification should be done. * If not then more clarity is needed on what this interface specifically is, what the other "shared object" concept means and how they relate. - * @legacy @beta + * @internal */ export interface ISharedObject extends IChannel, diff --git a/packages/runtime/datastore-definitions/api-report/datastore-definitions.legacy.alpha.api.md b/packages/runtime/datastore-definitions/api-report/datastore-definitions.legacy.alpha.api.md index 0213e9851da7..759dffdf3713 100644 --- a/packages/runtime/datastore-definitions/api-report/datastore-definitions.legacy.alpha.api.md +++ b/packages/runtime/datastore-definitions/api-report/datastore-definitions.legacy.alpha.api.md @@ -23,14 +23,6 @@ export interface IChannelAttributes { readonly type: string; } -// @beta @legacy -export interface IChannelFactory { - readonly attributes: IChannelAttributes; - create(runtime: IFluidDataStoreRuntime, id: string): TChannel & IChannel; - load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, channelAttributes: Readonly): Promise; - readonly type: string; -} - // @beta @legacy export interface IChannelServices { // (undocumented) diff --git a/packages/runtime/datastore-definitions/api-report/datastore-definitions.legacy.beta.api.md b/packages/runtime/datastore-definitions/api-report/datastore-definitions.legacy.beta.api.md index 056c9f40f5f0..bd34750c5932 100644 --- a/packages/runtime/datastore-definitions/api-report/datastore-definitions.legacy.beta.api.md +++ b/packages/runtime/datastore-definitions/api-report/datastore-definitions.legacy.beta.api.md @@ -23,14 +23,6 @@ export interface IChannelAttributes { readonly type: string; } -// @beta @legacy -export interface IChannelFactory { - readonly attributes: IChannelAttributes; - create(runtime: IFluidDataStoreRuntime, id: string): TChannel & IChannel; - load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, channelAttributes: Readonly): Promise; - readonly type: string; -} - // @beta @legacy export interface IChannelServices { // (undocumented) diff --git a/packages/runtime/datastore-definitions/src/channel.ts b/packages/runtime/datastore-definitions/src/channel.ts index 527af53e1138..e8ab8b3a16ba 100644 --- a/packages/runtime/datastore-definitions/src/channel.ts +++ b/packages/runtime/datastore-definitions/src/channel.ts @@ -289,7 +289,7 @@ export interface IChannelServices { * This approach (not requiring TChannel to extend IChannel) also makes it possible for SharedObject's public interfaces to not include IChannel if desired * (while still requiring the implementation to implement it). * - * @legacy @beta + * @internal */ export interface IChannelFactory { /** diff --git a/plans/custom-dds-removal.md b/plans/custom-dds-removal.md index 71eaad98b711..06607d4f5e5c 100644 --- a/plans/custom-dds-removal.md +++ b/plans/custom-dds-removal.md @@ -17,10 +17,10 @@ Found **20 total DDS implementations** in the codebase - all are Fluid-owned: | Category | DDSes | |----------|-------| -| **Active/Stable** | SharedCell, SharedMap, SharedDirectory, SharedTree, SharedSegmentSequence, TaskManager, ConsensusOrderedCollection, ConsensusRegisterCollection, PactMap, Ink | +| **Active/Stable** | SharedCell, SharedMap, SharedDirectory, SharedTree, SharedSegmentSequence, TaskManager, ConsensusOrderedCollection, ConsensusRegisterCollection | | **Legacy (@legacy @beta)** | SharedCounter, SharedString, SharedMatrix, SharedSummaryBlock | | **Internal Legacy** | SharedSignal, SharedArray (in legacy-dds package) | -| **Experimental** | SharedPropertyTree, DeflatedPropertyTree, LZ4PropertyTree (PropertyDDS), experimental SharedTree (in `experimental/dds/tree`) | +| **Experimental** | PactMap, Ink, SharedPropertyTree, DeflatedPropertyTree, LZ4PropertyTree (PropertyDDS), experimental SharedTree (in `experimental/dds/tree`) | **No external/third-party DDSes found.** All DDSes are already in Fluid's codebase. @@ -190,12 +190,13 @@ Keeping `IChannel` and its dependencies as `@legacy @beta` is acceptable because 3. **Split `IFluidDataStoreRuntime`**: Major breaking change 4. **Make everything internal**: Breaks `IFluidDataStoreRuntime` compatibility -#### Future Consideration +#### Future Considerations In a future major version, `IChannel` could potentially be made internal by: 1. Updating `IFluidDataStoreRuntime` methods to return `IFluidLoadable & { id: string }` 2. Or deprecating the channel methods entirely in favor of higher-level APIs -3. This would require coordinated changes across multiple packages +3. Using `unknown` or `IFluidLoadable` as the return type for `getChannel`/`createChannel`, with each DDS package offering a type check/narrowing function for consumers who prefer runtime type safety over casting +4. This would require coordinated changes across multiple packages ### Phase 4: Build and verify @@ -285,6 +286,21 @@ to internal and are no longer available in the public API. --- +## Follow-up Items + +### IFluidDataStoreRuntime Cleanup (Out of Scope) + +The current plan keeps `IChannel` and its transitive dependencies (`IChannelServices`, `IChannelStorageService`, `IDeltaConnection`, `IDeltaHandler`) as `@legacy @beta` because they are referenced by `IFluidDataStoreRuntime`. This leaks internal implementation details. + +**Follow-up work should be tracked separately to:** +1. Update `IFluidDataStoreRuntime.getChannel()` and `createChannel()` to return a narrower type (e.g., `IFluidLoadable & { id: string }` or `unknown`) +2. Potentially add type check/narrowing functions to each DDS package +3. Once `IFluidDataStoreRuntime` no longer references `IChannel`, fully internalize `IChannel` and all related interfaces + +This is intentionally out of scope for the initial custom DDS removal effort to limit the breaking change surface area. + +--- + ## Notes from PR Review - Per @anthony-murphy: Aggressively deprecate/internalize anything no longer needed - IChannelAttributes, IChannelServices and child types From e1506e93b1f21f28c143cb7bd39f3ef1ffb86d24 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Wed, 11 Feb 2026 09:23:52 -0800 Subject: [PATCH 06/12] revert ISharedObject and ISharedObjectEvents --- packages/dds/shared-object-base/src/types.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/dds/shared-object-base/src/types.ts b/packages/dds/shared-object-base/src/types.ts index 0b9c4761e82d..856601423782 100644 --- a/packages/dds/shared-object-base/src/types.ts +++ b/packages/dds/shared-object-base/src/types.ts @@ -13,7 +13,7 @@ import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitio /** * Events emitted by {@link ISharedObject}. - * @internal + * @legacy @beta */ export interface ISharedObjectEvents extends IErrorEvent { /** @@ -53,6 +53,9 @@ export interface ISharedObjectEvents extends IErrorEvent { /** * Base interface for shared objects from which other interfaces extend. + * @remarks + * This interface is not intended to be implemented outside this repository: + * implementers should migrate to using an existing implementation instead. * @privateRemarks * Implemented by {@link SharedObjectCore}. * @@ -62,7 +65,7 @@ export interface ISharedObjectEvents extends IErrorEvent { * Additionally the docs here need to define what a shared object is, not just claim this interface is for them. * If the intention is that the "shared object" concept `IFluidLoadable` mentions is only ever implemented by this interface then even more concept unification should be done. * If not then more clarity is needed on what this interface specifically is, what the other "shared object" concept means and how they relate. - * @internal + * @legacy @beta */ export interface ISharedObject extends IChannel, From 52924383889a29afefae426ccd5a6ef7e7598ade Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Wed, 11 Feb 2026 11:45:48 -0800 Subject: [PATCH 07/12] fix(tree): preserve ISharedObjectKind in SharedTree type Revert the explicit SharedObjectKind type annotation on SharedTree that was narrowing away ISharedObjectKind, breaking getFactory()/create() calls in 31 files. Use inline import() syntax for the return types of configuredSharedTree/configuredSharedTreeInternal to avoid api-extractor ae-incompatible-release-tags detection. --- .../api-report/legacy-dds.legacy.beta.api.md | 6 +- .../src/array/sharedArrayFactory.ts | 6 +- .../src/test/array/sharedArray.spec.ts | 11 +- .../test/array/sharedArrayConnected.spec.ts | 11 +- .../array/sharedArrayReconnection.spec.ts | 5 +- .../dds/map/api-report/map.legacy.beta.api.md | 20 -- packages/dds/map/src/directoryFactory.ts | 2 +- packages/dds/map/src/mapFactory.ts | 2 +- .../api-report/matrix.legacy.beta.api.md | 15 - packages/dds/matrix/src/runtime.ts | 2 +- .../ordered-collection.legacy.beta.api.md | 39 --- .../src/consensusOrderedCollection.ts | 2 +- .../src/consensusOrderedCollectionFactory.ts | 4 +- .../ordered-collection/src/consensusQueue.ts | 2 +- .../register-collection.legacy.beta.api.md | 45 --- .../src/consensusRegisterCollection.ts | 2 +- .../src/consensusRegisterCollectionFactory.ts | 6 +- .../dds/register-collection/src/interfaces.ts | 2 +- .../shared-object-base.legacy.beta.api.md | 13 + packages/dds/test-dds-utils/src/utils.ts | 2 +- .../tree/api-report/tree.legacy.beta.api.md | 2 +- .../api/schemaFactoryRecursive.spec.ts | 6 +- .../src/test/simple-tree/api/tree.spec.ts | 4 +- packages/dds/tree/src/treeFactory.ts | 11 +- .../api-report/aqueduct.legacy.beta.api.md | 50 ---- .../dataObjectFactory.ts | 3 +- .../pureDataObjectFactory.ts | 4 +- .../treeDataObjectFactory.ts | 13 +- .../src/data-objects/treeDataObject.ts | 9 +- .../api-report/datastore.legacy.beta.api.md | 109 ------- .../runtime/datastore/src/dataStoreRuntime.ts | 8 +- .../test-runtime-utils.legacy.beta.api.md | 266 ------------------ .../runtime/test-runtime-utils/src/mocks.ts | 6 +- .../src/mocksForReconnection.ts | 4 +- 34 files changed, 95 insertions(+), 597 deletions(-) diff --git a/packages/dds/legacy-dds/api-report/legacy-dds.legacy.beta.api.md b/packages/dds/legacy-dds/api-report/legacy-dds.legacy.beta.api.md index 6d8aa5a5bf50..333ac1ccfc69 100644 --- a/packages/dds/legacy-dds/api-report/legacy-dds.legacy.beta.api.md +++ b/packages/dds/legacy-dds/api-report/legacy-dds.legacy.beta.api.md @@ -127,13 +127,13 @@ export type SerializableTypeForSharedArray = boolean | number | string | object export type SerializableTypeForSharedSignal = boolean | number | string | IFluidHandle | object; // @beta @legacy -export const SharedArray: ISharedObjectKind> & SharedObjectKind>; +export const SharedArray: SharedObjectKind>; // @beta @legacy -export const SharedArrayBuilder: () => ISharedObjectKind> & SharedObjectKind>; +export const SharedArrayBuilder: () => SharedObjectKind>; // @beta @legacy -export const SharedSignal: ISharedObjectKind_2> & SharedObjectKind_2>; +export const SharedSignal: ISharedObjectKind> & SharedObjectKind_2>; // (No @packageDocumentation comment for this package) diff --git a/packages/dds/legacy-dds/src/array/sharedArrayFactory.ts b/packages/dds/legacy-dds/src/array/sharedArrayFactory.ts index 40cee46e5450..a271d85b4281 100644 --- a/packages/dds/legacy-dds/src/array/sharedArrayFactory.ts +++ b/packages/dds/legacy-dds/src/array/sharedArrayFactory.ts @@ -11,7 +11,6 @@ import type { } from "@fluidframework/datastore-definitions/internal"; import { createSharedObjectKind, - type ISharedObjectKind, type SharedObjectKind, } from "@fluidframework/shared-object-base/internal"; @@ -70,8 +69,7 @@ export class SharedArrayFactory * Entrypoint for {@link ISharedArray} creation. * @legacy @beta */ -export const SharedArray: ISharedObjectKind> & - SharedObjectKind> = +export const SharedArray: SharedObjectKind> = createSharedObjectKind>(SharedArrayFactory); /** @@ -80,7 +78,7 @@ export const SharedArray: ISharedObjectKind(): ISharedObjectKind> & SharedObjectKind> => { +>(): SharedObjectKind> => { const factory = SharedArrayFactory; return createSharedObjectKind>(factory); }; diff --git a/packages/dds/legacy-dds/src/test/array/sharedArray.spec.ts b/packages/dds/legacy-dds/src/test/array/sharedArray.spec.ts index a9e89fcfa8e2..5baae2d8848b 100644 --- a/packages/dds/legacy-dds/src/test/array/sharedArray.spec.ts +++ b/packages/dds/legacy-dds/src/test/array/sharedArray.spec.ts @@ -7,6 +7,7 @@ import { strict as assert } from "node:assert"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; +import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; import { MockFluidDataStoreRuntime, MockHandle, @@ -31,7 +32,9 @@ describe("SharedArray", () => { beforeEach(async () => { dataStoreRuntime = new MockFluidDataStoreRuntime(); - factory = SharedArrayBuilder().getFactory(); + factory = ( + SharedArrayBuilder() as unknown as ISharedObjectKind> + ).getFactory(); sharedArray = factory.create(dataStoreRuntime, "sharedArray"); testData = [1, 2, 3, 4]; expectedSharedArray = testData; @@ -168,7 +171,11 @@ describe("SharedArray", () => { const mockHandle = new MockHandle({}); beforeEach(() => { - handleFactory = SharedArrayBuilder().getFactory(); + handleFactory = ( + SharedArrayBuilder() as unknown as ISharedObjectKind< + ISharedArray + > + ).getFactory(); sharedArrayIFluidHandle = handleFactory.create( dataStoreRuntime, "sharedArrayIFluidHandle", diff --git a/packages/dds/legacy-dds/src/test/array/sharedArrayConnected.spec.ts b/packages/dds/legacy-dds/src/test/array/sharedArrayConnected.spec.ts index 7c5a19df5b64..8d11f48ee3b5 100644 --- a/packages/dds/legacy-dds/src/test/array/sharedArrayConnected.spec.ts +++ b/packages/dds/legacy-dds/src/test/array/sharedArrayConnected.spec.ts @@ -7,6 +7,7 @@ import { strict as assert } from "node:assert"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; +import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; import { MockFluidDataStoreRuntime, MockContainerRuntimeFactory, @@ -38,7 +39,9 @@ describe("SharedArray", () => { beforeEach(async () => { dataStoreRuntime = new MockFluidDataStoreRuntime(); - factory = SharedArrayBuilder().getFactory(); + factory = ( + SharedArrayBuilder() as unknown as ISharedObjectKind> + ).getFactory(); sharedArray = factory.create(dataStoreRuntime, "sharedArray"); testData = [1, 2, 3, 4]; expectedSharedArray = testData; @@ -563,7 +566,11 @@ describe("SharedArray in connected state with a remote SharedArray with IFluidHa // const mockHandle = new MockHandle({}); beforeEach(async () => { - factory = SharedArrayBuilder().getFactory(); + factory = ( + SharedArrayBuilder() as unknown as ISharedObjectKind< + ISharedArray + > + ).getFactory(); dataStoreRuntime = new MockFluidDataStoreRuntime(); containerRuntimeFactory = new MockContainerRuntimeFactory(); diff --git a/packages/dds/legacy-dds/src/test/array/sharedArrayReconnection.spec.ts b/packages/dds/legacy-dds/src/test/array/sharedArrayReconnection.spec.ts index 7fa16581b947..44a92babaed3 100644 --- a/packages/dds/legacy-dds/src/test/array/sharedArrayReconnection.spec.ts +++ b/packages/dds/legacy-dds/src/test/array/sharedArrayReconnection.spec.ts @@ -6,6 +6,7 @@ import { strict as assert } from "node:assert"; import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; +import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; import { MockFluidDataStoreRuntime, MockContainerRuntimeFactoryForReconnection, @@ -28,7 +29,9 @@ describe("SharedArray", () => { beforeEach(async () => { dataStoreRuntime = new MockFluidDataStoreRuntime(); - factory = SharedArrayBuilder().getFactory(); + factory = ( + SharedArrayBuilder() as unknown as ISharedObjectKind> + ).getFactory(); sharedArray = factory.create(dataStoreRuntime, "sharedArray"); testDataOne = [1, 2]; testDataTwo = [3, 4]; diff --git a/packages/dds/map/api-report/map.legacy.beta.api.md b/packages/dds/map/api-report/map.legacy.beta.api.md index 1ed784c556a9..e6336cfc73ff 100644 --- a/packages/dds/map/api-report/map.legacy.beta.api.md +++ b/packages/dds/map/api-report/map.legacy.beta.api.md @@ -4,16 +4,6 @@ ```ts -// @beta @sealed @legacy -export class DirectoryFactory implements IChannelFactory { - static readonly Attributes: IChannelAttributes; - get attributes(): IChannelAttributes; - create(runtime: IFluidDataStoreRuntime, id: string): ISharedDirectory; - load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise; - static readonly Type = "https://graph.microsoft.com/types/directory"; - get type(): string; -} - // @beta @deprecated @legacy export interface ICreateInfo { ccIds: string[]; @@ -103,16 +93,6 @@ export interface IValueChanged { readonly previousValue: any; } -// @beta @sealed @legacy -export class MapFactory implements IChannelFactory { - static readonly Attributes: IChannelAttributes; - get attributes(): IChannelAttributes; - create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap; - load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise; - static readonly Type = "https://graph.microsoft.com/types/map"; - get type(): string; -} - // @beta @legacy export const SharedDirectory: ISharedObjectKind & SharedObjectKind; diff --git a/packages/dds/map/src/directoryFactory.ts b/packages/dds/map/src/directoryFactory.ts index 4a8f55311a3b..96d077c53661 100644 --- a/packages/dds/map/src/directoryFactory.ts +++ b/packages/dds/map/src/directoryFactory.ts @@ -20,7 +20,7 @@ import { pkgVersion } from "./packageVersion.js"; * @privateRemarks * TODO: AB#35245: Deprecate and stop exporting this class. * @sealed - * @legacy @beta + * @internal */ export class DirectoryFactory implements IChannelFactory { /** diff --git a/packages/dds/map/src/mapFactory.ts b/packages/dds/map/src/mapFactory.ts index 05fa5b5576a3..3127e4f59fa9 100644 --- a/packages/dds/map/src/mapFactory.ts +++ b/packages/dds/map/src/mapFactory.ts @@ -20,7 +20,7 @@ import { pkgVersion } from "./packageVersion.js"; * @privateRemarks * TODO: AB#35245: Deprecate and stop exporting this class. * @sealed - * @legacy @beta + * @internal */ export class MapFactory implements IChannelFactory { /** diff --git a/packages/dds/matrix/api-report/matrix.legacy.beta.api.md b/packages/dds/matrix/api-report/matrix.legacy.beta.api.md index 465da760d0e9..88593ef9b205 100644 --- a/packages/dds/matrix/api-report/matrix.legacy.beta.api.md +++ b/packages/dds/matrix/api-report/matrix.legacy.beta.api.md @@ -44,21 +44,6 @@ export const SharedMatrix: ISharedObjectKind> & SharedObjectK // @beta @legacy export type SharedMatrix = ISharedMatrix; -// @beta @deprecated @legacy -export class SharedMatrixFactory implements IChannelFactory { - // (undocumented) - static readonly Attributes: IChannelAttributes; - // (undocumented) - get attributes(): IChannelAttributes; - // (undocumented) - create(document: IFluidDataStoreRuntime, id: string): ISharedMatrix & IChannel; - load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise; - // (undocumented) - static Type: string; - // (undocumented) - get type(): string; -} - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/dds/matrix/src/runtime.ts b/packages/dds/matrix/src/runtime.ts index 22c5c852c46a..b5b6c6453dc4 100644 --- a/packages/dds/matrix/src/runtime.ts +++ b/packages/dds/matrix/src/runtime.ts @@ -17,7 +17,7 @@ import { pkgVersion } from "./packageVersion.js"; /** * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedMatrix}. - * @legacy @beta + * @internal * @deprecated Use `SharedMatrix.getFactory` instead. */ export class SharedMatrixFactory implements IChannelFactory { diff --git a/packages/dds/ordered-collection/api-report/ordered-collection.legacy.beta.api.md b/packages/dds/ordered-collection/api-report/ordered-collection.legacy.beta.api.md index ce46a1e06fbf..8f885c2f764e 100644 --- a/packages/dds/ordered-collection/api-report/ordered-collection.legacy.beta.api.md +++ b/packages/dds/ordered-collection/api-report/ordered-collection.legacy.beta.api.md @@ -7,45 +7,6 @@ // @beta @legacy export type ConsensusCallback = (value: T) => Promise; -// @beta @legacy -export class ConsensusOrderedCollection extends SharedObject> implements IConsensusOrderedCollection { - protected constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes, data: IOrderedCollection); - acquire(callback: ConsensusCallback): Promise; - add(value: T): Promise; - // (undocumented) - protected applyStashedOp(content: unknown): void; - // (undocumented) - protected complete(acquireId: string): Promise; - // (undocumented) - protected completeCore(acquireId: string): void; - // (undocumented) - protected isActive(): boolean; - protected loadCore(storage: IChannelStorageService): Promise; - // (undocumented) - protected onDisconnect(): void; - protected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void; - // (undocumented) - protected release(acquireId: string): void; - // (undocumented) - protected releaseCore(acquireId: string): void; - // @sealed - protected rollback(content: unknown, localOpMetadata: unknown): void; - // (undocumented) - protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats; - waitAndAcquire(callback: ConsensusCallback): Promise; -} - -// @beta @legacy -export const ConsensusQueue: ISharedObjectKind> & SharedObjectKind>; - -// @beta @legacy -export type ConsensusQueue = ConsensusQueueClass; - -// @beta @legacy -export class ConsensusQueueClass extends ConsensusOrderedCollection { - constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes); -} - // @beta @legacy (undocumented) export enum ConsensusResult { // (undocumented) diff --git a/packages/dds/ordered-collection/src/consensusOrderedCollection.ts b/packages/dds/ordered-collection/src/consensusOrderedCollection.ts index 938982de1000..61e6748b336d 100644 --- a/packages/dds/ordered-collection/src/consensusOrderedCollection.ts +++ b/packages/dds/ordered-collection/src/consensusOrderedCollection.ts @@ -102,7 +102,7 @@ const idForLocalUnattachedClient = undefined; * * Generally not used directly. A derived type will pass in a backing data type * IOrderedCollection that will define the deterministic add/acquire order and snapshot ability. - * @legacy @beta + * @internal */ // TODO: #22835 Use undefined instead of any (breaking change) diff --git a/packages/dds/ordered-collection/src/consensusOrderedCollectionFactory.ts b/packages/dds/ordered-collection/src/consensusOrderedCollectionFactory.ts index d734d251c5d1..73b4ddef1ba4 100644 --- a/packages/dds/ordered-collection/src/consensusOrderedCollectionFactory.ts +++ b/packages/dds/ordered-collection/src/consensusOrderedCollectionFactory.ts @@ -62,13 +62,13 @@ export class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory /** * {@inheritDoc ConsensusQueueClass} - * @legacy @beta + * @internal */ export const ConsensusQueue = createSharedObjectKind(ConsensusQueueFactory); /** * {@inheritDoc ConsensusQueueClass} - * @legacy @beta + * @internal */ // TODO: #22835 Use undefined instead of any (breaking change) // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/dds/ordered-collection/src/consensusQueue.ts b/packages/dds/ordered-collection/src/consensusQueue.ts index 610fb77aba07..b1e83de91e82 100644 --- a/packages/dds/ordered-collection/src/consensusQueue.ts +++ b/packages/dds/ordered-collection/src/consensusQueue.ts @@ -32,7 +32,7 @@ class SnapshotableQueue extends SnapshotableArray implements IOrderedColle * Implementation of a consensus stack * * An derived type of ConsensusOrderedCollection with a queue as the backing data and order. - * @legacy @beta + * @internal */ // TODO: #22835 Use undefined instead of any (breaking change) // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/dds/register-collection/api-report/register-collection.legacy.beta.api.md b/packages/dds/register-collection/api-report/register-collection.legacy.beta.api.md index 9cb4f2a3ffa4..02affac76a2c 100644 --- a/packages/dds/register-collection/api-report/register-collection.legacy.beta.api.md +++ b/packages/dds/register-collection/api-report/register-collection.legacy.beta.api.md @@ -4,48 +4,6 @@ ```ts -// @beta @legacy -export const ConsensusRegisterCollection: ISharedObjectKind> & SharedObjectKind>; - -// @beta @legacy -export type ConsensusRegisterCollection = IConsensusRegisterCollection; - -// @beta @legacy -export class ConsensusRegisterCollectionClass extends SharedObject implements IConsensusRegisterCollection { - constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes); - // (undocumented) - protected applyStashedOp(content: unknown): void; - // (undocumented) - keys(): string[]; - protected loadCore(storage: IChannelStorageService): Promise; - // (undocumented) - protected onDisconnect(): void; - protected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void; - read(key: string, readPolicy?: ReadPolicy): T | undefined; - // (undocumented) - readVersions(key: string): T[] | undefined; - // @sealed - protected rollback(content: unknown, localOpMetadata: unknown): void; - // (undocumented) - protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats; - write(key: string, value: T): Promise; -} - -// @beta @legacy -export class ConsensusRegisterCollectionFactory implements IChannelFactory { - // (undocumented) - static readonly Attributes: IChannelAttributes; - // (undocumented) - get attributes(): IChannelAttributes; - // (undocumented) - create(document: IFluidDataStoreRuntime, id: string): IConsensusRegisterCollection; - load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise; - // (undocumented) - static Type: string; - // (undocumented) - get type(): string; -} - // @beta @legacy export interface IConsensusRegisterCollection extends ISharedObject { keys(): string[]; @@ -60,9 +18,6 @@ export interface IConsensusRegisterCollectionEvents extends ISharedObjectEvents (event: "atomicChanged" | "versionChanged", listener: (key: string, value: any, local: boolean) => void): any; } -// @beta @deprecated @legacy -export type IConsensusRegisterCollectionFactory = IChannelFactory; - // @beta @legacy export enum ReadPolicy { // (undocumented) diff --git a/packages/dds/register-collection/src/consensusRegisterCollection.ts b/packages/dds/register-collection/src/consensusRegisterCollection.ts index 1042f030fdad..2b55282808c9 100644 --- a/packages/dds/register-collection/src/consensusRegisterCollection.ts +++ b/packages/dds/register-collection/src/consensusRegisterCollection.ts @@ -122,7 +122,7 @@ interface IConsensusRegisterCollectionInternalEvents { /** * {@inheritDoc IConsensusRegisterCollection} - * @legacy @beta + * @internal */ export class ConsensusRegisterCollection extends SharedObject diff --git a/packages/dds/register-collection/src/consensusRegisterCollectionFactory.ts b/packages/dds/register-collection/src/consensusRegisterCollectionFactory.ts index 85428bee5dba..1a379a5308d0 100644 --- a/packages/dds/register-collection/src/consensusRegisterCollectionFactory.ts +++ b/packages/dds/register-collection/src/consensusRegisterCollectionFactory.ts @@ -17,7 +17,7 @@ import { pkgVersion } from "./packageVersion.js"; /** * The factory that defines the consensus queue. - * @legacy @beta + * @internal */ export class ConsensusRegisterCollectionFactory implements IChannelFactory @@ -65,13 +65,13 @@ export class ConsensusRegisterCollectionFactory /** * {@inheritDoc IConsensusRegisterCollection} - * @legacy @beta + * @internal */ export const ConsensusRegisterCollection = createSharedObjectKind( ConsensusRegisterCollectionFactory, ); /** * Compatibility alias for {@link IConsensusRegisterCollection}. - * @legacy @beta + * @internal */ export type ConsensusRegisterCollection = IConsensusRegisterCollection; diff --git a/packages/dds/register-collection/src/interfaces.ts b/packages/dds/register-collection/src/interfaces.ts index 0989286ebca3..ec1f8864b7bb 100644 --- a/packages/dds/register-collection/src/interfaces.ts +++ b/packages/dds/register-collection/src/interfaces.ts @@ -14,7 +14,7 @@ import { * * Extends the base IChannelFactory to return a more definite type of IConsensusRegisterCollection * Use for the runtime to create and load distributed data structure by type name of each channel. - * @legacy @beta + * @internal * @deprecated Use `IChannelFactory`. */ export type IConsensusRegisterCollectionFactory = diff --git a/packages/dds/shared-object-base/api-report/shared-object-base.legacy.beta.api.md b/packages/dds/shared-object-base/api-report/shared-object-base.legacy.beta.api.md index 33c3c1fb5543..63bc05da62ee 100644 --- a/packages/dds/shared-object-base/api-report/shared-object-base.legacy.beta.api.md +++ b/packages/dds/shared-object-base/api-report/shared-object-base.legacy.beta.api.md @@ -12,6 +12,19 @@ export interface IFluidSerializer { stringify(value: unknown, bind: IFluidHandle): string; } +// @beta @legacy +export interface ISharedObject extends IChannel, IEventProvider { + bindToContext(): void; +} + +// @beta @legacy +export interface ISharedObjectEvents extends IErrorEvent { + // @eventProperty + (event: "pre-op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any; + // @eventProperty + (event: "op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any; +} + // @beta @legacy export function makeHandlesSerializable(value: unknown, serializer: IFluidSerializer, bind: IFluidHandle): unknown; diff --git a/packages/dds/test-dds-utils/src/utils.ts b/packages/dds/test-dds-utils/src/utils.ts index 5f9571856ed5..be93bb24a5f3 100644 --- a/packages/dds/test-dds-utils/src/utils.ts +++ b/packages/dds/test-dds-utils/src/utils.ts @@ -7,7 +7,7 @@ import type { MockContainerRuntimeForReconnection, MockFluidDataStoreRuntime, // eslint-disable-next-line import-x/no-internal-modules -} from "@fluidframework/test-runtime-utils/legacy"; +} from "@fluidframework/test-runtime-utils/internal"; export function makeUnreachableCodePathProxy(name: string): T { // eslint-disable-next-line @typescript-eslint/consistent-type-assertions diff --git a/packages/dds/tree/api-report/tree.legacy.beta.api.md b/packages/dds/tree/api-report/tree.legacy.beta.api.md index 59a7e1bec76c..79fccc8ca516 100644 --- a/packages/dds/tree/api-report/tree.legacy.beta.api.md +++ b/packages/dds/tree/api-report/tree.legacy.beta.api.md @@ -116,7 +116,7 @@ export type ConciseTree = Exclude; // @beta @legacy -export function configuredSharedTreeBetaLegacy(options: SharedTreeOptionsBeta): ISharedObjectKind & SharedObjectKind; +export function configuredSharedTreeBetaLegacy(options: SharedTreeOptionsBeta): SharedObjectKind; // @beta export function createIndependentTreeBeta(options?: ForestOptions): ViewableTree; diff --git a/packages/dds/tree/src/test/simple-tree/api/schemaFactoryRecursive.spec.ts b/packages/dds/tree/src/test/simple-tree/api/schemaFactoryRecursive.spec.ts index 01aea8bbb19b..655319ad0d86 100644 --- a/packages/dds/tree/src/test/simple-tree/api/schemaFactoryRecursive.spec.ts +++ b/packages/dds/tree/src/test/simple-tree/api/schemaFactoryRecursive.spec.ts @@ -8,11 +8,13 @@ import { strict as assert } from "node:assert"; import { createIdCompressor } from "@fluidframework/id-compressor/internal"; +import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; import { MockFluidDataStoreRuntime, validateTypeError, } from "@fluidframework/test-runtime-utils/internal"; +import type { ITree } from "../../../index.js"; import { allowUnused, type ValidateRecursiveSchema, @@ -124,10 +126,10 @@ describe("SchemaFactory Recursive methods", () => { const config = new TreeViewConfiguration({ schema: Box }); - const tree = SharedTree.create( + const tree = (SharedTree as unknown as ISharedObjectKind).create( new MockFluidDataStoreRuntime({ idCompressor: createIdCompressor(), - registry: [SharedTree.getFactory()], + registry: [(SharedTree as unknown as ISharedObjectKind).getFactory()], }), "tree", ); diff --git a/packages/dds/tree/src/test/simple-tree/api/tree.spec.ts b/packages/dds/tree/src/test/simple-tree/api/tree.spec.ts index 09634c2c052b..d18ff8e737f2 100644 --- a/packages/dds/tree/src/test/simple-tree/api/tree.spec.ts +++ b/packages/dds/tree/src/test/simple-tree/api/tree.spec.ts @@ -6,9 +6,11 @@ import { strict as assert } from "node:assert"; import { createIdCompressor } from "@fluidframework/id-compressor/internal"; +import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; import { validateUsageError } from "@fluidframework/test-runtime-utils/internal"; import { MockFluidDataStoreRuntime } from "@fluidframework/test-runtime-utils/internal"; +import type { ITree } from "../../../index.js"; import { Tree } from "../../../shared-tree/index.js"; // eslint-disable-next-line import-x/no-internal-modules import type { UnhydratedFlexTreeNode } from "../../../simple-tree/core/index.js"; @@ -34,7 +36,7 @@ class NodeMap extends schema.map("NoteMap", schema.string) {} class NodeList extends schema.array("NoteList", schema.string) {} class Canvas extends schema.object("Canvas", { stuff: [NodeMap, NodeList] }) {} -const factory = SharedTree.getFactory(); +const factory = (SharedTree as unknown as ISharedObjectKind).getFactory(); describe("simple-tree tree", () => { it("ListRoot", () => { diff --git a/packages/dds/tree/src/treeFactory.ts b/packages/dds/tree/src/treeFactory.ts index 9267bd9b6c83..5b71314a3eff 100644 --- a/packages/dds/tree/src/treeFactory.ts +++ b/packages/dds/tree/src/treeFactory.ts @@ -7,7 +7,6 @@ import type { IChannelStorageService } from "@fluidframework/datastore-definitio import type { SharedObjectKind } from "@fluidframework/shared-object-base"; import { type ISharedObject, - type ISharedObjectKind, makeSharedObjectKind, type KernelArgs, type SharedKernelFactory, @@ -144,7 +143,7 @@ export function configuredSharedTreeBeta( */ export function configuredSharedTreeBetaLegacy( options: SharedTreeOptionsBeta, -): ISharedObjectKind & SharedObjectKind { +): SharedObjectKind { return configuredSharedTree(options); } @@ -183,14 +182,18 @@ export function configuredSharedTreeAlpha( */ export function configuredSharedTree( options: SharedTreeOptions, -): ISharedObjectKind & SharedObjectKind { + // eslint-disable-next-line @typescript-eslint/consistent-type-imports +): import("@fluidframework/shared-object-base/internal").ISharedObjectKind & + SharedObjectKind { const internalOptions = resolveOptions(options); return configuredSharedTreeInternal(internalOptions); } export function configuredSharedTreeInternal( options: SharedTreeOptionsInternal, -): ISharedObjectKind & SharedObjectKind { + // eslint-disable-next-line @typescript-eslint/consistent-type-imports +): import("@fluidframework/shared-object-base/internal").ISharedObjectKind & + SharedObjectKind { const sharedObjectOptions: SharedObjectOptions = { type: SharedTreeFactoryType, attributes: SharedTreeAttributes, diff --git a/packages/framework/aqueduct/api-report/aqueduct.legacy.beta.api.md b/packages/framework/aqueduct/api-report/aqueduct.legacy.beta.api.md index f1e238c0f96b..7e8093005aad 100644 --- a/packages/framework/aqueduct/api-report/aqueduct.legacy.beta.api.md +++ b/packages/framework/aqueduct/api-report/aqueduct.legacy.beta.api.md @@ -57,23 +57,6 @@ export abstract class DataObject ex protected get root(): ISharedDirectory; } -// @beta @legacy -export class DataObjectFactory, I extends DataObjectTypes = DataObjectTypes> extends PureDataObjectFactory { - constructor(type: string, ctor: new (props: IDataObjectProps) => TObj, sharedObjects?: readonly IChannelFactory[], optionalProviders?: FluidObjectSymbolProvider, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeFactory?: typeof FluidDataStoreRuntime); - constructor(props: DataObjectFactoryProps); -} - -// @beta @legacy -export interface DataObjectFactoryProps, I extends DataObjectTypes = DataObjectTypes> { - readonly ctor: new (props: IDataObjectProps) => TObj; - readonly optionalProviders?: FluidObjectSymbolProvider; - readonly policies?: Partial; - readonly registryEntries?: NamedFluidDataStoreRegistryEntries; - readonly runtimeClass?: typeof FluidDataStoreRuntime; - readonly sharedObjects?: readonly IChannelFactory[]; - readonly type: string; -} - // @beta @legacy export interface DataObjectTypes { Events?: IEvent; @@ -118,37 +101,4 @@ export abstract class PureDataObject, I extends DataObjectTypes = DataObjectTypes> implements IFluidDataStoreFactory, Partial { - constructor(type: string, ctor: new (props: IDataObjectProps) => TObj, sharedObjects?: readonly IChannelFactory[], optionalProviders?: FluidObjectSymbolProvider, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeClass?: typeof FluidDataStoreRuntime); - constructor(props: DataObjectFactoryProps); - createChildInstance(parentContext: IFluidDataStoreContext, initialState?: I["InitialState"], loadingGroupId?: string): Promise; - createInstance(runtime: IContainerRuntimeBase, initialState?: I["InitialState"], loadingGroupId?: string): Promise; - // (undocumented) - protected createInstanceCore(context: IFluidDataStoreContextDetached, initialState?: I["InitialState"]): Promise; - createInstanceWithDataStore(containerRuntime: IContainerRuntimeBase, initialState?: I["InitialState"], packagePath?: readonly string[], loadingGroupId?: string): Promise<[TObj, IDataStore]>; - // (undocumented) - protected createNonRootInstanceCore(containerRuntime: IContainerRuntimeBase, packagePath: readonly string[], initialState?: I["InitialState"], loadingGroupId?: string): Promise; - createPeerInstance(peerContext: IFluidDataStoreContext, initialState?: I["InitialState"], loadingGroupId?: string): Promise; - // @deprecated - createRootInstance(rootDataStoreId: string, runtime: IContainerRuntime, initialState?: I["InitialState"]): Promise; - get IFluidDataStoreFactory(): this; - get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined; - instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise; - get registryEntry(): NamedFluidDataStoreRegistryEntry; - readonly type: string; -} - -// @beta @legacy -export abstract class TreeDataObject extends PureDataObject { - // (undocumented) - initializeInternal(existing: boolean): Promise; - protected get tree(): ITree_2; -} - -// @beta @legacy -export class TreeDataObjectFactory, TDataObjectTypes extends DataObjectTypes = DataObjectTypes> extends PureDataObjectFactory { - constructor(props: DataObjectFactoryProps); -} - ``` diff --git a/packages/framework/aqueduct/src/data-object-factories/dataObjectFactory.ts b/packages/framework/aqueduct/src/data-object-factories/dataObjectFactory.ts index 4613c734d1dd..4a4a55dd4fa4 100644 --- a/packages/framework/aqueduct/src/data-object-factories/dataObjectFactory.ts +++ b/packages/framework/aqueduct/src/data-object-factories/dataObjectFactory.ts @@ -28,8 +28,7 @@ import { * * @typeParam TObj - DataObject (concrete type) * @typeParam I - The input types for the DataObject - * @legacy - * @beta + * @internal */ export class DataObjectFactory< TObj extends DataObject, diff --git a/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts b/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts index 4c3ea84253db..a4b32b9a6c88 100644 --- a/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts +++ b/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts @@ -145,7 +145,7 @@ async function createDataObject< * registry entries, and the runtime class to use for the data object. * @typeParam TObj - DataObject (concrete type) * @typeParam I - The input types for the DataObject - * @legacy @beta + * @internal */ export interface DataObjectFactoryProps< TObj extends PureDataObject, @@ -197,7 +197,7 @@ export interface DataObjectFactoryProps< * * @typeParam TObj - DataObject (concrete type) * @typeParam I - The input types for the DataObject - * @legacy @beta + * @internal */ export class PureDataObjectFactory< TObj extends PureDataObject, diff --git a/packages/framework/aqueduct/src/data-object-factories/treeDataObjectFactory.ts b/packages/framework/aqueduct/src/data-object-factories/treeDataObjectFactory.ts index c270c3f366e4..d96803a4915f 100644 --- a/packages/framework/aqueduct/src/data-object-factories/treeDataObjectFactory.ts +++ b/packages/framework/aqueduct/src/data-object-factories/treeDataObjectFactory.ts @@ -3,7 +3,8 @@ * Licensed under the MIT License. */ -import { SharedTree } from "@fluidframework/tree/internal"; +import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; +import { SharedTree, type ITree } from "@fluidframework/tree/internal"; import type { DataObjectTypes, TreeDataObject } from "../data-objects/index.js"; @@ -18,7 +19,7 @@ import { * @typeParam TDataObject - The concrete TreeDataObject implementation. * @typeParam TDataObjectTypes - The input types for the DataObject * - * @legacy @beta + * @internal */ export class TreeDataObjectFactory< TDataObject extends TreeDataObject, @@ -33,10 +34,14 @@ export class TreeDataObjectFactory< // If the user did not specify a SharedTree factory, add it to the shared objects. if ( !newProps.sharedObjects.some( - (sharedObject) => sharedObject.type === SharedTree.getFactory().type, + (sharedObject) => + sharedObject.type === + (SharedTree as unknown as ISharedObjectKind).getFactory().type, ) ) { - newProps.sharedObjects.push(SharedTree.getFactory()); + newProps.sharedObjects.push( + (SharedTree as unknown as ISharedObjectKind).getFactory(), + ); } super(newProps); diff --git a/packages/framework/aqueduct/src/data-objects/treeDataObject.ts b/packages/framework/aqueduct/src/data-objects/treeDataObject.ts index 73159be202e1..facb0d98acf2 100644 --- a/packages/framework/aqueduct/src/data-objects/treeDataObject.ts +++ b/packages/framework/aqueduct/src/data-objects/treeDataObject.ts @@ -3,7 +3,10 @@ * Licensed under the MIT License. */ -import type { ISharedObject } from "@fluidframework/shared-object-base/internal"; +import type { + ISharedObject, + ISharedObjectKind, +} from "@fluidframework/shared-object-base/internal"; import { UsageError } from "@fluidframework/telemetry-utils/internal"; import { SharedTree, type ITree } from "@fluidframework/tree/internal"; @@ -57,7 +60,7 @@ const uninitializedErrorString = * } * ``` * - * @legacy @beta + * @internal */ export abstract class TreeDataObject< TDataObjectTypes extends DataObjectTypes = DataObjectTypes, @@ -97,7 +100,7 @@ export abstract class TreeDataObject< } else { const sharedTree = this.runtime.createChannel( treeChannelId, - SharedTree.getFactory().type, + (SharedTree as unknown as ISharedObjectKind).getFactory().type, ) as unknown as ITree; (sharedTree as unknown as ISharedObject).bindToContext(); diff --git a/packages/runtime/datastore/api-report/datastore.legacy.beta.api.md b/packages/runtime/datastore/api-report/datastore.legacy.beta.api.md index 52bd6a7278a8..a0b650a1ed17 100644 --- a/packages/runtime/datastore/api-report/datastore.legacy.beta.api.md +++ b/packages/runtime/datastore/api-report/datastore.legacy.beta.api.md @@ -12,100 +12,6 @@ export enum DataStoreMessageType { ChannelOp = "op" } -// @beta @legacy -export class FluidDataStoreRuntime extends TypedEventEmitter implements IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext { - constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, provideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise, policies?: Partial); - // (undocumented) - get absolutePath(): string; - // (undocumented) - get activeLocalOperationActivity(): "applyStashed" | "rollback" | undefined; - addChannel(channel: IChannel): void; - // (undocumented) - applyStashedOp(content: any): Promise; - attachGraph(): void; - // (undocumented) - get attachState(): AttachState; - // (undocumented) - bind(handle: IFluidHandle): void; - bindChannel(channel: IChannel): void; - // (undocumented) - get channelsRoutingContext(): this; - // (undocumented) - get clientDetails(): IClientDetails; - // (undocumented) - get clientId(): string | undefined; - // (undocumented) - get connected(): boolean; - // (undocumented) - createChannel(idArg: string | undefined, type: string): IChannel; - // (undocumented) - get deltaManager(): IDeltaManagerErased; - // (undocumented) - readonly deltaManagerInternal: IDeltaManager; - // (undocumented) - dispose(): void; - // (undocumented) - get disposed(): boolean; - readonly entryPoint: IFluidHandleInternal; - getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData; - // (undocumented) - getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats; - // (undocumented) - getAudience(): IAudience; - // (undocumented) - getChannel(id: string): Promise; - getGCData(fullGC?: boolean): Promise; - // (undocumented) - getQuorum(): IQuorumClients; - // (undocumented) - readonly id: string; - // (undocumented) - get idCompressor(): IIdCompressor | undefined; - // (undocumented) - get IFluidHandleContext(): this; - readonly ILayerCompatDetails?: unknown; - // (undocumented) - get isAttached(): boolean; - readonly isReadOnly: () => boolean; - // (undocumented) - get logger(): ITelemetryLoggerExt; - makeVisibleAndAttachGraph(): void; - readonly minVersionForCollab?: MinimumVersionForCollab | undefined; - notifyReadOnlyState(readonly: boolean): void; - // (undocumented) - get objectsRoutingContext(): this; - // (undocumented) - readonly options: Record; - // (undocumented) - readonly policies: IFluidDataStorePolicies; - processMessages(messageCollection: IRuntimeMessageCollection): void; - // (undocumented) - processSignal(message: IInboundSignalMessage, local: boolean): void; - // (undocumented) - request(request: IRequest): Promise; - // (undocumented) - resolveHandle(request: IRequest): Promise; - reSubmit(type: DataStoreMessageType, content: any, localOpMetadata: unknown, squash: boolean): void; - rollback?(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void; - // (undocumented) - get rootRoutingContext(): this; - // (undocumented) - get routeContext(): IFluidHandleContext; - // (undocumented) - setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void; - // (undocumented) - setConnectionState(connected: boolean, clientId?: string): void; - submitSignal(type: string, content: unknown, targetClientId?: string): void; - summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise; - updateUsedRoutes(usedRoutes: string[]): void; - // (undocumented) - uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise>; - protected validateChannelId(id: string): void; - // (undocumented) - visibilityState: VisibilityState; - waitAttached(): Promise; -} - // @beta @legacy export class FluidObjectHandle extends FluidHandleBase { constructor(value: T | Promise, path: string, routeContext: IFluidHandleContext); @@ -121,21 +27,6 @@ export class FluidObjectHandle extends Flui protected readonly value: T | Promise; } -// @beta @legacy (undocumented) -export interface ISharedObjectRegistry { - // (undocumented) - get(name: string): IChannelFactory | undefined; -} - -// @beta @legacy -export const mixinRequestHandler: (requestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime; - -// @beta @legacy -export const mixinSummaryHandler: (handler: (runtime: FluidDataStoreRuntime, setCurrentSummarizeStep: (currentStep: string) => void) => Promise<{ - path: string[]; - content: string; -} | undefined>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime; - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/runtime/datastore/src/dataStoreRuntime.ts b/packages/runtime/datastore/src/dataStoreRuntime.ts index db7f15ed977a..27ee9e1f0284 100644 --- a/packages/runtime/datastore/src/dataStoreRuntime.ts +++ b/packages/runtime/datastore/src/dataStoreRuntime.ts @@ -149,7 +149,7 @@ export type LocalFluidDataStoreRuntimeMessage = | { type: DataStoreMessageType.Attach; content: IAttachMessage }; /** - * @legacy @beta + * @internal */ export interface ISharedObjectRegistry { // TODO consider making this async. A consequence is that either the creation of a distributed data type @@ -179,7 +179,7 @@ function initializePendingOpCount(): { value: number } { /** * Base data store class - * @legacy @beta + * @internal */ export class FluidDataStoreRuntime extends TypedEventEmitter @@ -1532,7 +1532,7 @@ export class FluidDataStoreRuntime * Request handler is only called when data store can't resolve request, i.e. for custom requests. * @param Base - base class, inherits from FluidDataStoreRuntime * @param requestHandler - request handler to mix in - * @legacy @beta + * @internal */ export const mixinRequestHandler = ( requestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise, @@ -1553,7 +1553,7 @@ export const mixinRequestHandler = ( * @param handler - handler that returns info about blob to be added to summary. * Or undefined not to add anything to summary. * @param Base - base class, inherits from FluidDataStoreRuntime - * @legacy @beta + * @internal */ export const mixinSummaryHandler = ( handler: ( diff --git a/packages/runtime/test-runtime-utils/api-report/test-runtime-utils.legacy.beta.api.md b/packages/runtime/test-runtime-utils/api-report/test-runtime-utils.legacy.beta.api.md index f7be62b8ff42..a0ef158e4492 100644 --- a/packages/runtime/test-runtime-utils/api-report/test-runtime-utils.legacy.beta.api.md +++ b/packages/runtime/test-runtime-utils/api-report/test-runtime-utils.legacy.beta.api.md @@ -49,131 +49,6 @@ export class MockAudience extends TypedEventEmitter implements setCurrentClientId(clientId: string): void; } -// @beta @legacy -export class MockContainerRuntime extends TypedEventEmitter { - constructor(dataStoreRuntime: MockFluidDataStoreRuntime, factory: MockContainerRuntimeFactory, mockContainerRuntimeOptions?: IMockContainerRuntimeOptions, overrides?: { - minimumSequenceNumber?: number | undefined; - } | undefined); - // (undocumented) - protected addPendingMessage(content: any, localOpMetadata: unknown, clientSequenceNumber: number): void; - // (undocumented) - clientId: string; - // @deprecated - createDeltaConnection(): MockDeltaConnection; - // (undocumented) - protected readonly dataStoreRuntime: MockFluidDataStoreRuntime; - // @deprecated (undocumented) - protected readonly deltaConnections: MockDeltaConnection[]; - // (undocumented) - readonly deltaManager: MockDeltaManager; - // (undocumented) - dirty(): void; - // (undocumented) - protected readonly factory: MockContainerRuntimeFactory; - // (undocumented) - finalizeIdRange(range: IdCreationRange): void; - flush(): void; - flushSomeMessages(numMessages: number): void; - // (undocumented) - get isDirty(): boolean; - protected maybeProcessIdAllocationMessage(message: ISequencedDocumentMessage): boolean; - // (undocumented) - protected readonly outbox: IInternalMockRuntimeMessage[]; - // (undocumented) - protected readonly overrides?: { - minimumSequenceNumber?: number | undefined; - } | undefined; - // (undocumented) - protected readonly pendingMessages: IMockContainerRuntimePendingMessage[]; - // (undocumented) - process(message: ISequencedDocumentMessage): void; - // (undocumented) - protected processInternal(message: ISequencedDocumentMessage): [boolean, unknown]; - rebase(): void; - // (undocumented) - resolveHandle(handle: IFluidHandle): Promise; - // (undocumented) - protected reSubmitMessages(messagesToResubmit: { - content: any; - localOpMetadata?: unknown; - }[]): void; - rollback?(): void; - protected readonly runtimeOptions: Required; - // (undocumented) - runWithManualFlush(act: () => void | Promise): Promise; - // (undocumented) - submit(messageContent: any, localOpMetadata?: unknown): number; -} - -// @beta @legacy -export class MockContainerRuntimeFactory { - constructor(mockContainerRuntimeOptions?: IMockContainerRuntimeOptions); - // (undocumented) - createContainerRuntime(dataStoreRuntime: MockFluidDataStoreRuntime): MockContainerRuntime; - // (undocumented) - protected getFirstMessageToProcess(): ISequencedDocumentMessage; - getMinSeq(): number; - // (undocumented) - protected lastProcessedMessage: ISequencedDocumentMessage | undefined; - protected messages: ISequencedDocumentMessage[]; - // (undocumented) - minSeq: Map; - // (undocumented) - get outstandingMessageCount(): number; - processAllMessages(): void; - processOneMessage(): void; - processSomeMessages(count: number): void; - // (undocumented) - pushMessage(msg: Partial): void; - // (undocumented) - readonly quorum: MockQuorumClients; - // (undocumented) - removeContainerRuntime(containerRuntime: MockContainerRuntime): void; - protected readonly runtimeOptions: Required; - // (undocumented) - protected readonly runtimes: Set; - // (undocumented) - sequenceNumber: number; -} - -// @beta @legacy -export class MockContainerRuntimeFactoryForReconnection extends MockContainerRuntimeFactory { - // (undocumented) - clearOutstandingClientMessages(clientId: string): void; - // (undocumented) - createContainerRuntime(dataStoreRuntime: MockFluidDataStoreRuntime, overrides?: { - minimumSequenceNumber?: number; - trackRemoteOps?: boolean; - }): MockContainerRuntimeForReconnection; -} - -// @beta @legacy -export class MockContainerRuntimeForReconnection extends MockContainerRuntime { - constructor(dataStoreRuntime: MockFluidDataStoreRuntime, factory: MockContainerRuntimeFactoryForReconnection, runtimeOptions?: IMockContainerRuntimeOptions, overrides?: { - minimumSequenceNumber?: number; - trackRemoteOps?: boolean; - }); - get connected(): boolean; - set connected(connected: boolean); - // (undocumented) - protected readonly factory: MockContainerRuntimeFactoryForReconnection; - // (undocumented) - flush(): void; - // (undocumented) - initializeWithStashedOps(fromContainerRuntime: MockContainerRuntimeForReconnection): Promise; - protected readonly pendingRemoteMessages: ISequencedDocumentMessage[]; - // (undocumented) - process(message: ISequencedDocumentMessage): void; - // (undocumented) - protected readonly processedOps?: ISequencedDocumentMessage[]; - // (undocumented) - protected processPendingMessages(pendingMessages: ISequencedDocumentMessage[]): void; - // (undocumented) - protected setConnectedState(connected: boolean): void; - // (undocumented) - submit(messageContent: any, localOpMetadata: unknown): number; -} - // @beta @legacy export class MockDeltaConnection implements IDeltaConnection { constructor(submitFn: (messageContent: any, localOpMetadata: unknown) => number, dirtyFn: () => void); @@ -375,147 +250,6 @@ export class MockFluidDataStoreContext implements IFluidDataStoreContext { uploadBlob(blob: ArrayBufferLike): Promise>; } -// @beta @sealed @legacy -export class MockFluidDataStoreRuntime extends EventEmitter implements IFluidDataStoreRuntime, IFluidDataStoreChannel, IFluidHandleContext { - constructor(overrides?: { - clientId?: string; - entryPoint?: IFluidHandle; - id?: string; - logger?: ITelemetryBaseLogger; - idCompressor?: IIdCompressor & IIdCompressorCore; - attachState?: AttachState; - registry?: readonly IChannelFactory[]; - minVersionForCollab?: MinimumVersionForCollab; - }); - // (undocumented) - get absolutePath(): string; - // (undocumented) - addChannel(channel: IChannel): void; - // (undocumented) - applyStashedOp(content: any): Promise; - // (undocumented) - attachGraph(): void; - // (undocumented) - get attachState(): AttachState; - // (undocumented) - bind(handle: IFluidHandle): void; - // (undocumented) - bindChannel(channel: IChannel): void; - // (undocumented) - get channelsRoutingContext(): IFluidHandleContext; - // (undocumented) - clientId: string; - // (undocumented) - close(): Promise; - // (undocumented) - readonly connected = true; - // (undocumented) - containerRuntime?: MockContainerRuntime; - // (undocumented) - createChannel(id: string | undefined, type: string): IChannel; - // (undocumented) - createDeltaConnection(): MockDeltaConnection; - // (undocumented) - get deltaManager(): IDeltaManagerErased; - // (undocumented) - deltaManagerInternal: MockDeltaManager; - // (undocumented) - dispose(): void; - // (undocumented) - get disposed(): boolean; - // (undocumented) - readonly documentId: string; - // (undocumented) - readonly entryPoint: IFluidHandleInternal; - // (undocumented) - readonly existing: boolean; - // (undocumented) - getAttachGCData(telemetryContext?: ITelemetryContext | undefined): IGarbageCollectionData; - // (undocumented) - getAttachSnapshot(): ITreeEntry[]; - // (undocumented) - getAttachSummary(): ISummaryTreeWithStats; - // (undocumented) - getAudience(): IAudience; - // (undocumented) - getBlob(blobId: string): Promise; - // (undocumented) - getChannel(id: string): Promise; - // (undocumented) - getGCData(): Promise; - // (undocumented) - getQuorum(): IQuorumClients; - // (undocumented) - readonly id: string; - // (undocumented) - idCompressor: (IIdCompressor & IIdCompressorCore) | undefined; - // (undocumented) - get IFluidHandleContext(): IFluidHandleContext; - // (undocumented) - ILayerCompatDetails?: unknown; - // (undocumented) - get isAttached(): boolean; - // (undocumented) - readonly isReadOnly: () => boolean; - // (undocumented) - readonly loader: ILoader; - // @deprecated - get local(): boolean; - set local(local: boolean); - // (undocumented) - readonly logger: ITelemetryBaseLogger; - // (undocumented) - makeVisibleAndAttachGraph(): void; - // (undocumented) - readonly minVersionForCollab: MinimumVersionForCollab | undefined; - // (undocumented) - notifyReadOnlyState(readonly: boolean): void; - // (undocumented) - get objectsRoutingContext(): IFluidHandleContext; - // (undocumented) - options: Record; - // (undocumented) - readonly path = ""; - // (undocumented) - processMessages(messageCollection: IRuntimeMessageCollection): void; - // (undocumented) - processSignal(message: any, local: boolean): void; - // (undocumented) - quorum: MockQuorumClients; - // (undocumented) - request(request: IRequest): Promise; - // (undocumented) - requestDataStore(request: IRequest): Promise; - // (undocumented) - resolveHandle(request: IRequest): Promise; - // (undocumented) - reSubmit(content: any, localOpMetadata: unknown, squash: boolean): void; - // (undocumented) - rollback?(message: any, localOpMetadata: unknown): void; - // (undocumented) - get rootRoutingContext(): IFluidHandleContext; - // (undocumented) - save(message: string): void; - // (undocumented) - setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void; - // (undocumented) - setConnectionState(connected: boolean, clientId?: string): void; - // (undocumented) - submitSignal: IFluidDataStoreRuntime["submitSignal"]; - // (undocumented) - summarize(fullTree?: boolean, trackState?: boolean): Promise; - // (undocumented) - updateMinSequenceNumber(value: number): void; - // (undocumented) - updateUsedRoutes(usedRoutes: string[]): void; - // (undocumented) - uploadBlob(blob: ArrayBufferLike): Promise>; - // (undocumented) - get visibilityState(): VisibilityState; - // (undocumented) - waitAttached(): Promise; -} - // @beta @legacy export class MockHandle extends FluidHandleBase { constructor(value: T, path?: string, absolutePath?: string); diff --git a/packages/runtime/test-runtime-utils/src/mocks.ts b/packages/runtime/test-runtime-utils/src/mocks.ts index 938ac08b0158..ed729cd62129 100644 --- a/packages/runtime/test-runtime-utils/src/mocks.ts +++ b/packages/runtime/test-runtime-utils/src/mocks.ts @@ -192,7 +192,7 @@ export interface IInternalMockRuntimeMessage { * Mock implementation of IContainerRuntime for testing basic submitting and processing of messages. * If test specific logic is required, extend this class and add the logic there. For an example, take a look * at MockContainerRuntimeForReconnection. - * @legacy @beta + * @internal */ export class MockContainerRuntime extends TypedEventEmitter { public clientId: string; @@ -544,7 +544,7 @@ export class MockContainerRuntime extends TypedEventEmitter Date: Wed, 11 Feb 2026 11:59:36 -0800 Subject: [PATCH 08/12] fix: resolve remaining build failures from custom DDS removal - Mark AgentSchedulerFactory as @internal (returns @internal FluidDataStoreRuntime) - Fix test-version-utils union type error by casting DDS entries for getFactory() - Split /legacy imports in 6 example files: @internal types (DataObjectFactory, FluidDataStoreRuntime, IChannelFactory, MapFactory, ConsensusRegisterCollection) now import from /internal, non-@internal types remain at /legacy --- .../container/blobCollection/blobCollection.ts | 14 ++++++++------ .../data-objects/table-document/src/document.ts | 4 +++- .../data-objects/table-document/src/slice.ts | 4 +++- .../migrationTool/sameContainerMigrationTool.ts | 8 +++----- .../src/migrationTool/migrationTool.ts | 17 ++++++++--------- .../src/container/diceRoller/diceRoller.ts | 14 ++++++++------ .../agent-scheduler.legacy.beta.api.md | 16 ---------------- .../framework/agent-scheduler/src/scheduler.ts | 3 +-- .../test/test-version-utils/src/compatUtils.ts | 6 ++++-- 9 files changed, 38 insertions(+), 48 deletions(-) diff --git a/examples/apps/blobs/src/container/blobCollection/blobCollection.ts b/examples/apps/blobs/src/container/blobCollection/blobCollection.ts index 18be81fca547..3103d834a198 100644 --- a/examples/apps/blobs/src/container/blobCollection/blobCollection.ts +++ b/examples/apps/blobs/src/container/blobCollection/blobCollection.ts @@ -5,12 +5,14 @@ import { TypedEventEmitter } from "@fluid-internal/client-utils"; import type { IEventProvider, IFluidHandle } from "@fluidframework/core-interfaces"; -import { FluidDataStoreRuntime } from "@fluidframework/datastore/legacy"; -import type { - IChannelFactory, - IFluidDataStoreRuntime, -} from "@fluidframework/datastore-definitions/legacy"; -import { MapFactory, type ISharedMap, type IValueChanged } from "@fluidframework/map/legacy"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; +import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/legacy"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import { MapFactory } from "@fluidframework/map/internal"; +import type { ISharedMap, IValueChanged } from "@fluidframework/map/legacy"; import type { IFluidDataStoreChannel, IFluidDataStoreContext, diff --git a/examples/data-objects/table-document/src/document.ts b/examples/data-objects/table-document/src/document.ts index 8095f50e6056..6c639ef005d1 100644 --- a/examples/data-objects/table-document/src/document.ts +++ b/examples/data-objects/table-document/src/document.ts @@ -9,7 +9,9 @@ import { positionToRowCol, rowColToPosition, } from "@fluid-experimental/sequence-deprecated"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { IEvent, IFluidHandle } from "@fluidframework/core-interfaces"; import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/legacy"; // eslint-disable-next-line import-x/no-internal-modules -- #26904: `sequence` internals used in examples diff --git a/examples/data-objects/table-document/src/slice.ts b/examples/data-objects/table-document/src/slice.ts index 387a64dc0e37..636788244eeb 100644 --- a/examples/data-objects/table-document/src/slice.ts +++ b/examples/data-objects/table-document/src/slice.ts @@ -3,7 +3,9 @@ * Licensed under the MIT License. */ -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { IFluidHandle } from "@fluidframework/core-interfaces"; import { PropertySet } from "@fluidframework/sequence/legacy"; diff --git a/examples/utils/example-utils/src/migrationTool/sameContainerMigrationTool.ts b/examples/utils/example-utils/src/migrationTool/sameContainerMigrationTool.ts index 20040482441c..cd8cd197d901 100644 --- a/examples/utils/example-utils/src/migrationTool/sameContainerMigrationTool.ts +++ b/examples/utils/example-utils/src/migrationTool/sameContainerMigrationTool.ts @@ -4,11 +4,9 @@ */ import { type IPactMap, PactMap } from "@fluid-experimental/pact-map"; -import { - DataObject, - DataObjectFactory, - type IDataObjectProps, -} from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject, type IDataObjectProps } from "@fluidframework/aqueduct/legacy"; import type { IContainer } from "@fluidframework/container-definitions/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import { assert } from "@fluidframework/core-utils/legacy"; diff --git a/examples/utils/migration-tools/src/migrationTool/migrationTool.ts b/examples/utils/migration-tools/src/migrationTool/migrationTool.ts index 1ee03eb0e0e0..d2b42bc90704 100644 --- a/examples/utils/migration-tools/src/migrationTool/migrationTool.ts +++ b/examples/utils/migration-tools/src/migrationTool/migrationTool.ts @@ -11,15 +11,14 @@ import type { IFluidHandle, } from "@fluidframework/core-interfaces"; import { assert } from "@fluidframework/core-utils/legacy"; -import { FluidDataStoreRuntime } from "@fluidframework/datastore/legacy"; -import type { - IChannelFactory, - IFluidDataStoreRuntime, -} from "@fluidframework/datastore-definitions/legacy"; -import { - ConsensusRegisterCollection, - type IConsensusRegisterCollection, -} from "@fluidframework/register-collection/legacy"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; +import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/legacy"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import { ConsensusRegisterCollection } from "@fluidframework/register-collection/internal"; +import type { IConsensusRegisterCollection } from "@fluidframework/register-collection/legacy"; import type { IFluidDataStoreChannel, IFluidDataStoreContext, diff --git a/examples/view-integration/external-views/src/container/diceRoller/diceRoller.ts b/examples/view-integration/external-views/src/container/diceRoller/diceRoller.ts index d85dbeebb791..02064fd8fee4 100644 --- a/examples/view-integration/external-views/src/container/diceRoller/diceRoller.ts +++ b/examples/view-integration/external-views/src/container/diceRoller/diceRoller.ts @@ -6,12 +6,14 @@ import { TypedEventEmitter } from "@fluid-internal/client-utils"; import type { IEventProvider } from "@fluidframework/core-interfaces"; import { assert } from "@fluidframework/core-utils/legacy"; -import { FluidDataStoreRuntime } from "@fluidframework/datastore/legacy"; -import type { - IChannelFactory, - IFluidDataStoreRuntime, -} from "@fluidframework/datastore-definitions/legacy"; -import { MapFactory, type ISharedMap, type IValueChanged } from "@fluidframework/map/legacy"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; +import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/legacy"; +// eslint-disable-next-line import-x/no-internal-modules -- @internal type used in example +import { MapFactory } from "@fluidframework/map/internal"; +import type { ISharedMap, IValueChanged } from "@fluidframework/map/legacy"; import type { IFluidDataStoreChannel, IFluidDataStoreContext, diff --git a/packages/framework/agent-scheduler/api-report/agent-scheduler.legacy.beta.api.md b/packages/framework/agent-scheduler/api-report/agent-scheduler.legacy.beta.api.md index bbadd70499e2..789f618105f9 100644 --- a/packages/framework/agent-scheduler/api-report/agent-scheduler.legacy.beta.api.md +++ b/packages/framework/agent-scheduler/api-report/agent-scheduler.legacy.beta.api.md @@ -4,22 +4,6 @@ ```ts -// @beta @legacy (undocumented) -export class AgentSchedulerFactory implements IFluidDataStoreFactory { - // (undocumented) - static createChildInstance(parentContext: IFluidDataStoreContext): Promise; - // (undocumented) - get IFluidDataStoreFactory(): AgentSchedulerFactory; - // (undocumented) - instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise; - // (undocumented) - static get registryEntry(): NamedFluidDataStoreRegistryEntry; - // (undocumented) - static readonly type = "_scheduler"; - // (undocumented) - readonly type = "_scheduler"; -} - // @beta @legacy (undocumented) export const IAgentScheduler: keyof IProvideAgentScheduler; diff --git a/packages/framework/agent-scheduler/src/scheduler.ts b/packages/framework/agent-scheduler/src/scheduler.ts index 96f9c664f785..737c8750ff07 100644 --- a/packages/framework/agent-scheduler/src/scheduler.ts +++ b/packages/framework/agent-scheduler/src/scheduler.ts @@ -471,8 +471,7 @@ class AgentSchedulerRuntime extends FluidDataStoreRuntime { } /** - * @legacy - * @beta + * @internal */ export class AgentSchedulerFactory implements IFluidDataStoreFactory { public static readonly type = "_scheduler"; diff --git a/packages/test/test-version-utils/src/compatUtils.ts b/packages/test/test-version-utils/src/compatUtils.ts index 640dc1107af8..386cd76493e3 100644 --- a/packages/test/test-version-utils/src/compatUtils.ts +++ b/packages/test/test-version-utils/src/compatUtils.ts @@ -121,7 +121,8 @@ function createGetDataStoreFactoryFunction( } const registryMapping = {}; - for (const value of Object.values(api.dds)) { + for (const ddsEntry of Object.values(api.dds)) { + const value = ddsEntry as { getFactory?(): IChannelFactory }; /** * Skip dds that may not be available in this version of the api. * Not all versions have all dds. See {@link PackageToInstall} for details. @@ -129,7 +130,8 @@ function createGetDataStoreFactoryFunction( if (value?.getFactory === undefined) { continue; } - registryMapping[value.getFactory().type] = value.getFactory(); + const factory = value.getFactory(); + registryMapping[factory.type] = factory; } function convertRegistry(registry: ChannelFactoryRegistry = []): ChannelFactoryRegistry { From 7f1482f18bffc5792aaac739c8ed24878f9ac9bf Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Wed, 11 Feb 2026 12:03:57 -0800 Subject: [PATCH 09/12] fix(vale): add DDS to accepted acronyms vocabulary DDSes was already accepted but the singular form DDS was missing, causing vale to flag it in PR markdown. --- .vale/config/vocabularies/fluid/accept.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.vale/config/vocabularies/fluid/accept.txt b/.vale/config/vocabularies/fluid/accept.txt index ed7eb00ca807..fb979a4c70cf 100644 --- a/.vale/config/vocabularies/fluid/accept.txt +++ b/.vale/config/vocabularies/fluid/accept.txt @@ -12,6 +12,7 @@ enum Enum openable Datastore +DDS DDSes accessor accessors From e767ffe3d01d54aa1f7d26f16afb63c782c8ca6a Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Wed, 11 Feb 2026 14:58:04 -0800 Subject: [PATCH 10/12] format --- .../src/test/array/sharedArray.spec.ts | 14 ++++---------- .../test/array/sharedArrayConnected.spec.ts | 14 ++++---------- .../array/sharedArrayReconnection.spec.ts | 13 +++++++------ packages/dds/legacy-dds/src/test/utilities.ts | 19 ++++++++++++++++++- .../shared-object-base/src/sharedObject.ts | 15 ++++++--------- .../api/schemaFactoryRecursive.spec.ts | 5 +++-- .../src/test/simple-tree/api/tree.spec.ts | 6 ++++-- packages/dds/tree/src/treeFactory.ts | 2 +- .../treeDataObjectFactory.ts | 13 +++---------- 9 files changed, 50 insertions(+), 51 deletions(-) diff --git a/packages/dds/legacy-dds/src/test/array/sharedArray.spec.ts b/packages/dds/legacy-dds/src/test/array/sharedArray.spec.ts index 5baae2d8848b..6953f661a530 100644 --- a/packages/dds/legacy-dds/src/test/array/sharedArray.spec.ts +++ b/packages/dds/legacy-dds/src/test/array/sharedArray.spec.ts @@ -7,15 +7,15 @@ import { strict as assert } from "node:assert"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; -import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; import { MockFluidDataStoreRuntime, MockHandle, MockSharedObjectServices, } from "@fluidframework/test-runtime-utils/internal"; -import { SharedArrayBuilder, type ISharedArray } from "../../index.js"; +import type { ISharedArray } from "../../index.js"; import { + getSharedArrayFactory, verifyEventsEmitted, verifyEntries, getRandomInt, @@ -32,9 +32,7 @@ describe("SharedArray", () => { beforeEach(async () => { dataStoreRuntime = new MockFluidDataStoreRuntime(); - factory = ( - SharedArrayBuilder() as unknown as ISharedObjectKind> - ).getFactory(); + factory = getSharedArrayFactory(); sharedArray = factory.create(dataStoreRuntime, "sharedArray"); testData = [1, 2, 3, 4]; expectedSharedArray = testData; @@ -171,11 +169,7 @@ describe("SharedArray", () => { const mockHandle = new MockHandle({}); beforeEach(() => { - handleFactory = ( - SharedArrayBuilder() as unknown as ISharedObjectKind< - ISharedArray - > - ).getFactory(); + handleFactory = getSharedArrayFactory(); sharedArrayIFluidHandle = handleFactory.create( dataStoreRuntime, "sharedArrayIFluidHandle", diff --git a/packages/dds/legacy-dds/src/test/array/sharedArrayConnected.spec.ts b/packages/dds/legacy-dds/src/test/array/sharedArrayConnected.spec.ts index 8d11f48ee3b5..e250835f4d41 100644 --- a/packages/dds/legacy-dds/src/test/array/sharedArrayConnected.spec.ts +++ b/packages/dds/legacy-dds/src/test/array/sharedArrayConnected.spec.ts @@ -7,7 +7,6 @@ import { strict as assert } from "node:assert"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; -import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; import { MockFluidDataStoreRuntime, MockContainerRuntimeFactory, @@ -21,8 +20,9 @@ import type { IRevertible, ISharedArray, } from "../../index.js"; -import { SharedArrayBuilder, SharedArrayRevertible } from "../../index.js"; +import { SharedArrayRevertible } from "../../index.js"; import { + getSharedArrayFactory, verifyEventsEmitted, verifyEntries, getRandomInt, @@ -39,9 +39,7 @@ describe("SharedArray", () => { beforeEach(async () => { dataStoreRuntime = new MockFluidDataStoreRuntime(); - factory = ( - SharedArrayBuilder() as unknown as ISharedObjectKind> - ).getFactory(); + factory = getSharedArrayFactory(); sharedArray = factory.create(dataStoreRuntime, "sharedArray"); testData = [1, 2, 3, 4]; expectedSharedArray = testData; @@ -566,11 +564,7 @@ describe("SharedArray in connected state with a remote SharedArray with IFluidHa // const mockHandle = new MockHandle({}); beforeEach(async () => { - factory = ( - SharedArrayBuilder() as unknown as ISharedObjectKind< - ISharedArray - > - ).getFactory(); + factory = getSharedArrayFactory(); dataStoreRuntime = new MockFluidDataStoreRuntime(); containerRuntimeFactory = new MockContainerRuntimeFactory(); diff --git a/packages/dds/legacy-dds/src/test/array/sharedArrayReconnection.spec.ts b/packages/dds/legacy-dds/src/test/array/sharedArrayReconnection.spec.ts index 44a92babaed3..d6133aee2692 100644 --- a/packages/dds/legacy-dds/src/test/array/sharedArrayReconnection.spec.ts +++ b/packages/dds/legacy-dds/src/test/array/sharedArrayReconnection.spec.ts @@ -6,7 +6,6 @@ import { strict as assert } from "node:assert"; import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; -import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; import { MockFluidDataStoreRuntime, MockContainerRuntimeFactoryForReconnection, @@ -15,8 +14,12 @@ import { import type { MockContainerRuntimeForReconnection } from "@fluidframework/test-runtime-utils/internal"; import type { ISharedArray } from "../../index.js"; -import { SharedArrayBuilder } from "../../index.js"; -import { verifyEntries, fillEntries, getRandomInt } from "../utilities.js"; +import { + getSharedArrayFactory, + verifyEntries, + fillEntries, + getRandomInt, +} from "../utilities.js"; describe("SharedArray", () => { let sharedArray: ISharedArray; @@ -29,9 +32,7 @@ describe("SharedArray", () => { beforeEach(async () => { dataStoreRuntime = new MockFluidDataStoreRuntime(); - factory = ( - SharedArrayBuilder() as unknown as ISharedObjectKind> - ).getFactory(); + factory = getSharedArrayFactory(); sharedArray = factory.create(dataStoreRuntime, "sharedArray"); testDataOne = [1, 2]; testDataTwo = [3, 4]; diff --git a/packages/dds/legacy-dds/src/test/utilities.ts b/packages/dds/legacy-dds/src/test/utilities.ts index add3047ec702..a3c619071fe4 100644 --- a/packages/dds/legacy-dds/src/test/utilities.ts +++ b/packages/dds/legacy-dds/src/test/utilities.ts @@ -6,9 +6,12 @@ import { strict as assert } from "node:assert"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; +import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; +import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; import { toFluidHandleInternal } from "@fluidframework/runtime-utils/internal"; -import type { ISharedArray } from "../index.js"; +import type { ISharedArray, SerializableTypeForSharedArray } from "../index.js"; +import { SharedArrayBuilder } from "../index.js"; /** * Verifies that two arrays contain the same entries. @@ -56,6 +59,20 @@ export function fillEntries(sharedArray: ISharedArray, entries: number[] } } +/** + * Creates a channel factory for `SharedArray` by casting through the `@internal` `ISharedObjectKind` type. + * + * @remarks This is needed because `SharedArrayBuilder` returns `SharedObjectKind` (the public type) + * which does not expose `getFactory()`. The `ISharedObjectKind` type (now `@internal`) provides that method. + */ +export function getSharedArrayFactory< + T extends SerializableTypeForSharedArray, +>(): IChannelFactory> { + return ( + SharedArrayBuilder() as unknown as ISharedObjectKind> + ).getFactory(); +} + /** * Creates a mock handle for the given value. */ diff --git a/packages/dds/shared-object-base/src/sharedObject.ts b/packages/dds/shared-object-base/src/sharedObject.ts index 2a102462559b..bcd717597fd9 100644 --- a/packages/dds/shared-object-base/src/sharedObject.ts +++ b/packages/dds/shared-object-base/src/sharedObject.ts @@ -76,10 +76,9 @@ interface ProcessTelemetryProperties { * This class implements common behaviors that implementations of {@link ISharedObject} may want to reuse. * Even more such behaviors are implemented in the {@link SharedObject} class. * @privateRemarks - * Currently some documentation (like the above) implies that this is supposed to be the only implementation of ISharedObject, which is both package-exported and not `@sealed`. - * This situation should be clarified to indicate if other implementations of ISharedObject are allowed and just currently don't exist, - * or if the intention is that no other implementations should exist and creating some might break things. - * As part of this, any existing implementations of ISharedObject (via SharedObjectCore or otherwise) in use by legacy API users will need to be considered. + * Now that this class is `@internal`, external implementations of ISharedObject via custom subclasses + * are no longer part of the supported public API surface. Existing external subclasses may continue + * to work but are not guaranteed to be compatible across versions. * * @internal */ @@ -732,9 +731,8 @@ export abstract class SharedObjectCore< * @remarks * DDS implementations with async and incremental summarization should extend {@link SharedObjectCore} directly instead. * @privateRemarks - * TODO: - * This class is badly named. - * "SharedObjectCore" should probably become "SharedObject" + * TODO: This class is badly named. Now that these classes are `@internal`, + * "SharedObjectCore" should be renamed to "SharedObject" * and this class should be renamed to something like "SharedObjectSynchronous". * @internal */ @@ -918,8 +916,7 @@ export abstract class SharedObject< * Used in containers to register a shared object implementation, and to create new instances of a given type of shared object. * * @remarks - * For use internally and in the "encapsulated API". - * See {@link SharedObjectKind} for the type erased version for use in the public declarative API. + * See {@link SharedObjectKind} for the type-erased version for use in the public declarative API. * * @privateRemarks * This does not extend {@link SharedObjectKind} since doing so would prevent implementing this interface in type safe code. diff --git a/packages/dds/tree/src/test/simple-tree/api/schemaFactoryRecursive.spec.ts b/packages/dds/tree/src/test/simple-tree/api/schemaFactoryRecursive.spec.ts index 655319ad0d86..9ca8d2b7e9ed 100644 --- a/packages/dds/tree/src/test/simple-tree/api/schemaFactoryRecursive.spec.ts +++ b/packages/dds/tree/src/test/simple-tree/api/schemaFactoryRecursive.spec.ts @@ -126,10 +126,11 @@ describe("SchemaFactory Recursive methods", () => { const config = new TreeViewConfiguration({ schema: Box }); - const tree = (SharedTree as unknown as ISharedObjectKind).create( + const sharedTreeKind = SharedTree as unknown as ISharedObjectKind; + const tree = sharedTreeKind.create( new MockFluidDataStoreRuntime({ idCompressor: createIdCompressor(), - registry: [(SharedTree as unknown as ISharedObjectKind).getFactory()], + registry: [sharedTreeKind.getFactory()], }), "tree", ); diff --git a/packages/dds/tree/src/test/simple-tree/api/tree.spec.ts b/packages/dds/tree/src/test/simple-tree/api/tree.spec.ts index d18ff8e737f2..bed37a352af5 100644 --- a/packages/dds/tree/src/test/simple-tree/api/tree.spec.ts +++ b/packages/dds/tree/src/test/simple-tree/api/tree.spec.ts @@ -7,8 +7,10 @@ import { strict as assert } from "node:assert"; import { createIdCompressor } from "@fluidframework/id-compressor/internal"; import type { ISharedObjectKind } from "@fluidframework/shared-object-base/internal"; -import { validateUsageError } from "@fluidframework/test-runtime-utils/internal"; -import { MockFluidDataStoreRuntime } from "@fluidframework/test-runtime-utils/internal"; +import { + MockFluidDataStoreRuntime, + validateUsageError, +} from "@fluidframework/test-runtime-utils/internal"; import type { ITree } from "../../../index.js"; import { Tree } from "../../../shared-tree/index.js"; diff --git a/packages/dds/tree/src/treeFactory.ts b/packages/dds/tree/src/treeFactory.ts index 5b71314a3eff..a3a76434bdaf 100644 --- a/packages/dds/tree/src/treeFactory.ts +++ b/packages/dds/tree/src/treeFactory.ts @@ -136,7 +136,7 @@ export function configuredSharedTreeBeta( } /** - * {@link configuredSharedTreeBeta} including the legacy `ISharedObjectKind` type. + * {@link configuredSharedTreeBeta} for the legacy API surface. * @privateRemarks * This is given a different export name (with legacy appended) to avoid the need to do the special reexport with different types from the fluid-framework package. * @legacy @beta diff --git a/packages/framework/aqueduct/src/data-object-factories/treeDataObjectFactory.ts b/packages/framework/aqueduct/src/data-object-factories/treeDataObjectFactory.ts index d96803a4915f..e475ca13692c 100644 --- a/packages/framework/aqueduct/src/data-object-factories/treeDataObjectFactory.ts +++ b/packages/framework/aqueduct/src/data-object-factories/treeDataObjectFactory.ts @@ -32,16 +32,9 @@ export class TreeDataObjectFactory< }; // If the user did not specify a SharedTree factory, add it to the shared objects. - if ( - !newProps.sharedObjects.some( - (sharedObject) => - sharedObject.type === - (SharedTree as unknown as ISharedObjectKind).getFactory().type, - ) - ) { - newProps.sharedObjects.push( - (SharedTree as unknown as ISharedObjectKind).getFactory(), - ); + const sharedTreeFactory = (SharedTree as unknown as ISharedObjectKind).getFactory(); + if (!newProps.sharedObjects.some((so) => so.type === sharedTreeFactory.type)) { + newProps.sharedObjects.push(sharedTreeFactory); } super(newProps); From 8b33fd09c6ec8230429dac52a98f303ffd3fff36 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Wed, 11 Feb 2026 15:43:25 -0800 Subject: [PATCH 11/12] fix: update imports for @internal types across examples and tests Move DataObjectFactory, FluidDataStoreRuntime, IChannelFactory, MapFactory, and test mock imports from /legacy to /internal entry points. Update @fluid-experimental/tree release tags from @alpha to @internal to resolve api-extractor cascade from SharedObject being @internal. --- .../src/fluid-object/index.ts | 4 +- .../apps/contact-collection/src/dataObject.ts | 4 +- .../data-object-grid/src/dataObjectGrid.ts | 4 +- .../apps/diceroller/src/container/main.tsx | 4 +- .../presence-tracker/src/datastoreSupport.ts | 3 +- .../src/container/groceryList/groceryList.ts | 10 +- .../src/oldestClientDiceRoller.ts | 4 +- .../src/taskManagerDiceRoller.ts | 4 +- .../src/model/legacyTreeInventoryList.ts | 4 +- .../src/model/newTreeInventoryList.ts | 4 +- .../bubblebench/baseline/src/main.ts | 4 +- .../experimental-tree/src/main.tsx | 4 +- .../benchmarks/bubblebench/ot/src/main.ts | 4 +- .../shared-tree/src/bubblebench.ts | 4 +- .../benchmarks/tablebench/src/test/utils.ts | 7 +- examples/data-objects/canvas/src/index.ts | 3 +- examples/data-objects/clicker/src/index.tsx | 4 +- .../data-objects/codemirror/src/codeMirror.ts | 4 +- examples/data-objects/monaco/src/index.ts | 3 +- .../constellation-model/src/model.ts | 4 +- .../multiview/coordinate-model/src/model.ts | 4 +- .../prosemirror/src/prosemirror.tsx | 4 +- examples/data-objects/smde/src/smde.ts | 4 +- .../webflow/src/document/index.ts | 4 +- .../data-objects/webflow/src/host/webFlow.ts | 4 +- examples/external-data/src/model/taskList.ts | 4 +- .../src/modelVersion1/diceRoller.ts | 4 +- .../src/modelVersion2/diceCounter.ts | 4 +- .../src/modelVersion2/diceRoller.ts | 4 +- .../src/modelVersion1/inventoryList.ts | 4 +- .../src/modelVersion2/inventoryList.ts | 4 +- .../src/modelVersion1/inventoryList.ts | 4 +- .../src/modelVersion2/inventoryList.ts | 4 +- .../tree-shim/src/model/inventoryList.ts | 4 +- .../container-views/src/model.ts | 4 +- .../view-framework-sampler/src/dataObject.ts | 4 +- .../api-report/experimental-tree.alpha.api.md | 1090 ----------------- experimental/dds/tree/src/ChangeTypes.ts | 30 +- experimental/dds/tree/src/Checkout.ts | 8 +- experimental/dds/tree/src/EagerCheckout.ts | 2 +- experimental/dds/tree/src/EditLog.ts | 6 +- experimental/dds/tree/src/EditUtilities.ts | 10 +- experimental/dds/tree/src/EventTypes.ts | 2 +- experimental/dds/tree/src/Forest.ts | 8 +- experimental/dds/tree/src/Identifiers.ts | 28 +- experimental/dds/tree/src/InitialTree.ts | 2 +- experimental/dds/tree/src/LogViewer.ts | 4 +- experimental/dds/tree/src/NodeIdUtilities.ts | 6 +- experimental/dds/tree/src/PayloadUtilities.ts | 2 +- .../dds/tree/src/ReconciliationPath.ts | 6 +- .../dds/tree/src/RevisionValueCache.ts | 2 +- experimental/dds/tree/src/RevisionView.ts | 4 +- experimental/dds/tree/src/SharedTree.ts | 28 +- experimental/dds/tree/src/Transaction.ts | 6 +- .../dds/tree/src/TransactionInternal.ts | 34 +- experimental/dds/tree/src/TreeView.ts | 14 +- experimental/dds/tree/src/UndoRedoHandler.ts | 6 +- .../dds/tree/src/persisted-types/0.0.2.ts | 48 +- .../dds/tree/src/persisted-types/0.1.1.ts | 28 +- packages/dds/legacy-dds/src/test/utilities.ts | 2 +- .../azure-client/src/test/TestDataObject.ts | 3 +- .../src/test/offline/stashedOps.spec.ts | 7 +- 62 files changed, 260 insertions(+), 1276 deletions(-) diff --git a/examples/apps/collaborative-textarea/src/fluid-object/index.ts b/examples/apps/collaborative-textarea/src/fluid-object/index.ts index 5e646f6aed66..418af2ecf8fc 100644 --- a/examples/apps/collaborative-textarea/src/fluid-object/index.ts +++ b/examples/apps/collaborative-textarea/src/fluid-object/index.ts @@ -3,7 +3,9 @@ * Licensed under the MIT License. */ -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import { SharedString, type ISharedString } from "@fluidframework/sequence/legacy"; diff --git a/examples/apps/contact-collection/src/dataObject.ts b/examples/apps/contact-collection/src/dataObject.ts index 43b8406f13d6..5deb0c809612 100644 --- a/examples/apps/contact-collection/src/dataObject.ts +++ b/examples/apps/contact-collection/src/dataObject.ts @@ -4,7 +4,9 @@ */ import type { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { v4 as uuid } from "uuid"; /** diff --git a/examples/apps/data-object-grid/src/dataObjectGrid.ts b/examples/apps/data-object-grid/src/dataObjectGrid.ts index dbf795908571..285f32ce7940 100644 --- a/examples/apps/data-object-grid/src/dataObjectGrid.ts +++ b/examples/apps/data-object-grid/src/dataObjectGrid.ts @@ -4,7 +4,9 @@ */ import type { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { Serializable } from "@fluidframework/datastore-definitions/legacy"; import type React from "react"; import type { Layout } from "react-grid-layout"; diff --git a/examples/apps/diceroller/src/container/main.tsx b/examples/apps/diceroller/src/container/main.tsx index e502713169f5..75e1eb7a0eb3 100644 --- a/examples/apps/diceroller/src/container/main.tsx +++ b/examples/apps/diceroller/src/container/main.tsx @@ -4,7 +4,9 @@ */ import type { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IValueChanged } from "@fluidframework/map/legacy"; import React from "react"; diff --git a/examples/apps/presence-tracker/src/datastoreSupport.ts b/examples/apps/presence-tracker/src/datastoreSupport.ts index b26a08d5a6a0..b76aa86fd106 100644 --- a/examples/apps/presence-tracker/src/datastoreSupport.ts +++ b/examples/apps/presence-tracker/src/datastoreSupport.ts @@ -16,7 +16,8 @@ import type { } from "@fluidframework/core-interfaces"; import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/legacy"; import { assert } from "@fluidframework/core-utils/legacy"; -import { FluidDataStoreRuntime } from "@fluidframework/datastore/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal"; import type { IFluidDataStoreContext, IFluidDataStoreFactory, diff --git a/examples/apps/staging/src/container/groceryList/groceryList.ts b/examples/apps/staging/src/container/groceryList/groceryList.ts index 5b24178cb07c..da105a3be935 100644 --- a/examples/apps/staging/src/container/groceryList/groceryList.ts +++ b/examples/apps/staging/src/container/groceryList/groceryList.ts @@ -10,9 +10,13 @@ import type { IFluidHandle, } from "@fluidframework/core-interfaces"; import { assert } from "@fluidframework/core-utils/legacy"; -import { FluidDataStoreRuntime } from "@fluidframework/datastore/legacy"; -import type { IChannelFactory } from "@fluidframework/datastore-definitions/legacy"; -import { type ISharedMap, type IValueChanged, MapFactory } from "@fluidframework/map/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal"; +// eslint-disable-next-line import-x/no-internal-modules +import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; +// eslint-disable-next-line import-x/no-internal-modules +import { MapFactory } from "@fluidframework/map/internal"; +import type { ISharedMap, IValueChanged } from "@fluidframework/map/legacy"; import type { IFluidDataStoreChannel, IFluidDataStoreContext, diff --git a/examples/apps/task-selection/src/oldestClientDiceRoller.ts b/examples/apps/task-selection/src/oldestClientDiceRoller.ts index a48c0bd2d3e0..30e7b2a02c5d 100644 --- a/examples/apps/task-selection/src/oldestClientDiceRoller.ts +++ b/examples/apps/task-selection/src/oldestClientDiceRoller.ts @@ -5,7 +5,9 @@ // Lint rule can be disabled once eslint config is upgraded to 5.3.0+ import { OldestClientObserver } from "@fluid-experimental/oldest-client-observer/legacy"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { assert } from "@fluidframework/core-utils/legacy"; import type { IDiceRoller } from "./interface.js"; diff --git a/examples/apps/task-selection/src/taskManagerDiceRoller.ts b/examples/apps/task-selection/src/taskManagerDiceRoller.ts index 0ed8730078b9..515f69b45ce6 100644 --- a/examples/apps/task-selection/src/taskManagerDiceRoller.ts +++ b/examples/apps/task-selection/src/taskManagerDiceRoller.ts @@ -3,7 +3,9 @@ * Licensed under the MIT License. */ -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import { assert } from "@fluidframework/core-utils/legacy"; import { TaskManager } from "@fluidframework/task-manager/legacy"; diff --git a/examples/apps/tree-comparison/src/model/legacyTreeInventoryList.ts b/examples/apps/tree-comparison/src/model/legacyTreeInventoryList.ts index 8eab78619d1d..9fffe0dfc596 100644 --- a/examples/apps/tree-comparison/src/model/legacyTreeInventoryList.ts +++ b/examples/apps/tree-comparison/src/model/legacyTreeInventoryList.ts @@ -11,7 +11,9 @@ import { StablePlace, StableRange, } from "@fluid-experimental/tree"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import { TypedEmitter } from "tiny-typed-emitter"; import { v4 as uuid } from "uuid"; diff --git a/examples/apps/tree-comparison/src/model/newTreeInventoryList.ts b/examples/apps/tree-comparison/src/model/newTreeInventoryList.ts index 55e0944e32eb..e7c27bb1cf34 100644 --- a/examples/apps/tree-comparison/src/model/newTreeInventoryList.ts +++ b/examples/apps/tree-comparison/src/model/newTreeInventoryList.ts @@ -3,7 +3,9 @@ * Licensed under the MIT License. */ -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import { type ITree, diff --git a/examples/benchmarks/bubblebench/baseline/src/main.ts b/examples/benchmarks/bubblebench/baseline/src/main.ts index 2eaf76847ae5..202031eb23e3 100644 --- a/examples/benchmarks/bubblebench/baseline/src/main.ts +++ b/examples/benchmarks/bubblebench/baseline/src/main.ts @@ -3,7 +3,9 @@ * Licensed under the MIT License. */ -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { AppState } from "./state.js"; diff --git a/examples/benchmarks/bubblebench/experimental-tree/src/main.tsx b/examples/benchmarks/bubblebench/experimental-tree/src/main.tsx index 12b448c2de49..bea63f3f3757 100644 --- a/examples/benchmarks/bubblebench/experimental-tree/src/main.tsx +++ b/examples/benchmarks/bubblebench/experimental-tree/src/main.tsx @@ -5,7 +5,9 @@ import type { IClient } from "@fluid-example/bubblebench-common"; import { SharedTree, WriteFormat } from "@fluid-experimental/tree"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import { TreeObjectProxy } from "./proxy/index.js"; diff --git a/examples/benchmarks/bubblebench/ot/src/main.ts b/examples/benchmarks/bubblebench/ot/src/main.ts index 38b70acbf654..161cc2680acc 100644 --- a/examples/benchmarks/bubblebench/ot/src/main.ts +++ b/examples/benchmarks/bubblebench/ot/src/main.ts @@ -4,7 +4,9 @@ */ import { SharedJson1 } from "@fluid-experimental/sharejs-json1"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import { AppState } from "./state.js"; diff --git a/examples/benchmarks/bubblebench/shared-tree/src/bubblebench.ts b/examples/benchmarks/bubblebench/shared-tree/src/bubblebench.ts index 8d93c3fe4888..82d1d1820812 100644 --- a/examples/benchmarks/bubblebench/shared-tree/src/bubblebench.ts +++ b/examples/benchmarks/bubblebench/shared-tree/src/bubblebench.ts @@ -3,7 +3,9 @@ * Licensed under the MIT License. */ -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import type { ITree, TreeView } from "@fluidframework/tree"; import { SharedTree } from "@fluidframework/tree/legacy"; diff --git a/examples/benchmarks/tablebench/src/test/utils.ts b/examples/benchmarks/tablebench/src/test/utils.ts index 5bebe83a2b4d..d8ec71c3806d 100644 --- a/examples/benchmarks/tablebench/src/test/utils.ts +++ b/examples/benchmarks/tablebench/src/test/utils.ts @@ -3,16 +3,19 @@ * Licensed under the MIT License. */ +/* eslint-disable import-x/no-internal-modules */ + import { IsoBuffer } from "@fluid-internal/client-utils"; import { makeRandom } from "@fluid-private/stochastic-test-utils"; -import { IChannel, IChannelFactory } from "@fluidframework/datastore-definitions/legacy"; +import { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; +import { IChannel } from "@fluidframework/datastore-definitions/legacy"; import { SessionId } from "@fluidframework/id-compressor"; import { createIdCompressor } from "@fluidframework/id-compressor/legacy"; import { MockContainerRuntimeFactory, MockFluidDataStoreRuntime, MockStorage, -} from "@fluidframework/test-runtime-utils/legacy"; +} from "@fluidframework/test-runtime-utils/internal"; export function create(factory: IChannelFactory): { channel: T & IChannel; diff --git a/examples/data-objects/canvas/src/index.ts b/examples/data-objects/canvas/src/index.ts index 96e0d09dfc5c..62ac1f1ddba6 100644 --- a/examples/data-objects/canvas/src/index.ts +++ b/examples/data-objects/canvas/src/index.ts @@ -5,7 +5,8 @@ import { ContainerViewRuntimeFactory } from "@fluid-example/example-utils"; import { Ink } from "@fluid-experimental/ink"; -import { DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; import React from "react"; import { Canvas } from "./canvas.js"; diff --git a/examples/data-objects/clicker/src/index.tsx b/examples/data-objects/clicker/src/index.tsx index 6baa6d3ce461..880c2c507b42 100644 --- a/examples/data-objects/clicker/src/index.tsx +++ b/examples/data-objects/clicker/src/index.tsx @@ -4,7 +4,9 @@ */ import { ContainerViewRuntimeFactory } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { IEvent, IFluidHandle } from "@fluidframework/core-interfaces"; import { SharedCounter } from "@fluidframework/counter/legacy"; import { TaskManager } from "@fluidframework/task-manager/legacy"; diff --git a/examples/data-objects/codemirror/src/codeMirror.ts b/examples/data-objects/codemirror/src/codeMirror.ts index 2015cc3e534c..46e8bf77fbb8 100644 --- a/examples/data-objects/codemirror/src/codeMirror.ts +++ b/examples/data-objects/codemirror/src/codeMirror.ts @@ -5,7 +5,9 @@ import { EventEmitter } from "@fluid-example/example-utils"; import { IFluidHandle, IFluidLoadable } from "@fluidframework/core-interfaces"; -import { FluidDataStoreRuntime, FluidObjectHandle } from "@fluidframework/datastore/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal"; +import { FluidObjectHandle } from "@fluidframework/datastore/legacy"; import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/legacy"; import { ISharedMap, SharedMap } from "@fluidframework/map/legacy"; import { diff --git a/examples/data-objects/monaco/src/index.ts b/examples/data-objects/monaco/src/index.ts index 7259ad74dbc6..f2dc8b3e7ad2 100644 --- a/examples/data-objects/monaco/src/index.ts +++ b/examples/data-objects/monaco/src/index.ts @@ -4,7 +4,8 @@ */ import { ContainerViewRuntimeFactory } from "@fluid-example/example-utils"; -import { DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; import * as sequence from "@fluidframework/sequence/legacy"; import React from "react"; diff --git a/examples/data-objects/multiview/constellation-model/src/model.ts b/examples/data-objects/multiview/constellation-model/src/model.ts index e701ed094e23..79c79e4aab2b 100644 --- a/examples/data-objects/multiview/constellation-model/src/model.ts +++ b/examples/data-objects/multiview/constellation-model/src/model.ts @@ -8,7 +8,9 @@ import type { ICoordinate, } from "@fluid-example/multiview-coordinate-interface"; import { Coordinate } from "@fluid-example/multiview-coordinate-model"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import type { IValueChanged } from "@fluidframework/map/legacy"; diff --git a/examples/data-objects/multiview/coordinate-model/src/model.ts b/examples/data-objects/multiview/coordinate-model/src/model.ts index f1896e2eebf6..1f0723e86f3a 100644 --- a/examples/data-objects/multiview/coordinate-model/src/model.ts +++ b/examples/data-objects/multiview/coordinate-model/src/model.ts @@ -4,7 +4,9 @@ */ import type { ICoordinate } from "@fluid-example/multiview-coordinate-interface"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IValueChanged } from "@fluidframework/map/legacy"; const xKey = "x"; diff --git a/examples/data-objects/prosemirror/src/prosemirror.tsx b/examples/data-objects/prosemirror/src/prosemirror.tsx index e2c80ee1404c..437c0bd5d33f 100644 --- a/examples/data-objects/prosemirror/src/prosemirror.tsx +++ b/examples/data-objects/prosemirror/src/prosemirror.tsx @@ -7,7 +7,9 @@ import { EventEmitter } from "@fluid-example/example-utils"; import { IFluidHandle, IFluidLoadable } from "@fluidframework/core-interfaces"; -import { FluidDataStoreRuntime, FluidObjectHandle } from "@fluidframework/datastore/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal"; +import { FluidObjectHandle } from "@fluidframework/datastore/legacy"; import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/legacy"; import { ISharedMap, SharedMap } from "@fluidframework/map/legacy"; import { diff --git a/examples/data-objects/smde/src/smde.ts b/examples/data-objects/smde/src/smde.ts index 4f88451a6161..4675d1d8e582 100644 --- a/examples/data-objects/smde/src/smde.ts +++ b/examples/data-objects/smde/src/smde.ts @@ -6,7 +6,9 @@ import { EventEmitter } from "@fluid-example/example-utils"; import { IFluidHandle, IFluidLoadable } from "@fluidframework/core-interfaces"; import { assert } from "@fluidframework/core-utils/legacy"; -import { FluidDataStoreRuntime, FluidObjectHandle } from "@fluidframework/datastore/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal"; +import { FluidObjectHandle } from "@fluidframework/datastore/legacy"; import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/legacy"; import { ISharedMap, SharedMap } from "@fluidframework/map/legacy"; import { diff --git a/examples/data-objects/webflow/src/document/index.ts b/examples/data-objects/webflow/src/document/index.ts index ee0f969c0d99..b63ace4c7fed 100644 --- a/examples/data-objects/webflow/src/document/index.ts +++ b/examples/data-objects/webflow/src/document/index.ts @@ -3,7 +3,9 @@ * Licensed under the MIT License. */ -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { IEvent, IFluidHandle } from "@fluidframework/core-interfaces"; import { assert } from "@fluidframework/core-utils/legacy"; import { diff --git a/examples/data-objects/webflow/src/host/webFlow.ts b/examples/data-objects/webflow/src/host/webFlow.ts index 97bd0bd1ec33..7a434314b0ad 100644 --- a/examples/data-objects/webflow/src/host/webFlow.ts +++ b/examples/data-objects/webflow/src/host/webFlow.ts @@ -3,7 +3,9 @@ * Licensed under the MIT License. */ -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { IFluidHandle } from "@fluidframework/core-interfaces"; import { IFluidDataStoreFactory } from "@fluidframework/runtime-definitions/legacy"; diff --git a/examples/external-data/src/model/taskList.ts b/examples/external-data/src/model/taskList.ts index 7e5d6f0833b6..64a9e0442feb 100644 --- a/examples/external-data/src/model/taskList.ts +++ b/examples/external-data/src/model/taskList.ts @@ -4,7 +4,9 @@ */ import { TypedEventEmitter } from "@fluid-internal/client-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; // eslint-disable-next-line import-x/no-internal-modules -- #26903: `cell` internals used in examples import { type ISharedCell, SharedCell } from "@fluidframework/cell/internal"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; diff --git a/examples/version-migration/live-schema-upgrade/src/modelVersion1/diceRoller.ts b/examples/version-migration/live-schema-upgrade/src/modelVersion1/diceRoller.ts index 905ca01c3155..fc380db63627 100644 --- a/examples/version-migration/live-schema-upgrade/src/modelVersion1/diceRoller.ts +++ b/examples/version-migration/live-schema-upgrade/src/modelVersion1/diceRoller.ts @@ -4,7 +4,9 @@ */ import type { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; /** * IDiceRoller describes the public API surface for our dice roller data object. diff --git a/examples/version-migration/live-schema-upgrade/src/modelVersion2/diceCounter.ts b/examples/version-migration/live-schema-upgrade/src/modelVersion2/diceCounter.ts index a3bc860ae523..a7a199171f5b 100644 --- a/examples/version-migration/live-schema-upgrade/src/modelVersion2/diceCounter.ts +++ b/examples/version-migration/live-schema-upgrade/src/modelVersion2/diceCounter.ts @@ -4,7 +4,9 @@ */ import type { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { IFluidHandle } from "@fluidframework/core-interfaces"; import { assert } from "@fluidframework/core-utils/legacy"; import { ISharedCounter, SharedCounter } from "@fluidframework/counter/legacy"; diff --git a/examples/version-migration/live-schema-upgrade/src/modelVersion2/diceRoller.ts b/examples/version-migration/live-schema-upgrade/src/modelVersion2/diceRoller.ts index b334d362af5c..4b6007775a60 100644 --- a/examples/version-migration/live-schema-upgrade/src/modelVersion2/diceRoller.ts +++ b/examples/version-migration/live-schema-upgrade/src/modelVersion2/diceRoller.ts @@ -4,7 +4,9 @@ */ import type { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; /** * IDiceRoller describes the public API surface for our dice roller data object. diff --git a/examples/version-migration/same-container/src/modelVersion1/inventoryList.ts b/examples/version-migration/same-container/src/modelVersion1/inventoryList.ts index 425552747fd8..c57c64f993db 100644 --- a/examples/version-migration/same-container/src/modelVersion1/inventoryList.ts +++ b/examples/version-migration/same-container/src/modelVersion1/inventoryList.ts @@ -4,7 +4,9 @@ */ import { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; // eslint-disable-next-line import-x/no-internal-modules -- #26903: `cell` internals used in examples import { SharedCell, type ISharedCell } from "@fluidframework/cell/internal"; import { SharedString } from "@fluidframework/sequence/legacy"; diff --git a/examples/version-migration/same-container/src/modelVersion2/inventoryList.ts b/examples/version-migration/same-container/src/modelVersion2/inventoryList.ts index 3eb8f44ffb65..77bc4c0af39a 100644 --- a/examples/version-migration/same-container/src/modelVersion2/inventoryList.ts +++ b/examples/version-migration/same-container/src/modelVersion2/inventoryList.ts @@ -4,7 +4,9 @@ */ import { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { type ISharedMap, SharedMap } from "@fluidframework/map/legacy"; import { SharedString } from "@fluidframework/sequence/legacy"; import { v4 as uuid } from "uuid"; diff --git a/examples/version-migration/separate-container/src/modelVersion1/inventoryList.ts b/examples/version-migration/separate-container/src/modelVersion1/inventoryList.ts index 3af0abb3bc59..1109a369df9c 100644 --- a/examples/version-migration/separate-container/src/modelVersion1/inventoryList.ts +++ b/examples/version-migration/separate-container/src/modelVersion1/inventoryList.ts @@ -4,7 +4,9 @@ */ import { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; // eslint-disable-next-line import-x/no-internal-modules -- #26903: `cell` internals used in examples import { type ISharedCell, SharedCell } from "@fluidframework/cell/internal"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; diff --git a/examples/version-migration/separate-container/src/modelVersion2/inventoryList.ts b/examples/version-migration/separate-container/src/modelVersion2/inventoryList.ts index d38762d1b8e6..8ee854a5cfae 100644 --- a/examples/version-migration/separate-container/src/modelVersion2/inventoryList.ts +++ b/examples/version-migration/separate-container/src/modelVersion2/inventoryList.ts @@ -4,7 +4,9 @@ */ import { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; import { type ISharedMap, SharedMap } from "@fluidframework/map/legacy"; import { type ISharedString, SharedString } from "@fluidframework/sequence/legacy"; diff --git a/examples/version-migration/tree-shim/src/model/inventoryList.ts b/examples/version-migration/tree-shim/src/model/inventoryList.ts index 0c12bbfd922e..9ef02b14f5be 100644 --- a/examples/version-migration/tree-shim/src/model/inventoryList.ts +++ b/examples/version-migration/tree-shim/src/model/inventoryList.ts @@ -10,7 +10,9 @@ import { SharedTreeShim, SharedTreeShimFactory, } from "@fluid-experimental/tree"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { IFluidHandle } from "@fluidframework/core-interfaces"; import { ITree } from "@fluidframework/tree"; import { SharedTree } from "@fluidframework/tree/legacy"; diff --git a/examples/view-integration/container-views/src/model.ts b/examples/view-integration/container-views/src/model.ts index 9243d58c2b44..d889d44406c8 100644 --- a/examples/view-integration/container-views/src/model.ts +++ b/examples/view-integration/container-views/src/model.ts @@ -3,7 +3,9 @@ * Licensed under the MIT License. */ -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; import { IValueChanged } from "@fluidframework/map/legacy"; import { IDiceRoller } from "./interface.js"; diff --git a/examples/view-integration/view-framework-sampler/src/dataObject.ts b/examples/view-integration/view-framework-sampler/src/dataObject.ts index 7bf1dfe0a154..2b3c0caf69d9 100644 --- a/examples/view-integration/view-framework-sampler/src/dataObject.ts +++ b/examples/view-integration/view-framework-sampler/src/dataObject.ts @@ -4,7 +4,9 @@ */ import type { EventEmitter } from "@fluid-example/example-utils"; -import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; +// eslint-disable-next-line import-x/no-internal-modules +import { DataObjectFactory } from "@fluidframework/aqueduct/internal"; +import { DataObject } from "@fluidframework/aqueduct/legacy"; /** * IDiceRoller describes the public API surface for our dice roller data object. diff --git a/experimental/dds/tree/api-report/experimental-tree.alpha.api.md b/experimental/dds/tree/api-report/experimental-tree.alpha.api.md index 7b0c1f58b919..737d5d3c339d 100644 --- a/experimental/dds/tree/api-report/experimental-tree.alpha.api.md +++ b/experimental/dds/tree/api-report/experimental-tree.alpha.api.md @@ -4,1100 +4,10 @@ ```ts -// @alpha -export type AttributionId = UuidString; - -// @alpha -export type BadPlaceValidationResult = Exclude; - -// @alpha -export type BadRangeValidationResult = Exclude; - -// @alpha -export interface Build { - // (undocumented) - readonly destination: number; - // (undocumented) - readonly source: BuildNode | TreeNodeSequence; - // (undocumented) - readonly type: typeof ChangeType.Build; -} - -// @alpha -export interface BuildInternal extends Omit { - // (undocumented) - readonly source: TreeNodeSequence; -} - -// @alpha -export interface BuildInternal_0_0_2 { - // (undocumented) - readonly destination: DetachedSequenceId; - // (undocumented) - readonly source: TreeNodeSequence; - // (undocumented) - readonly type: typeof ChangeTypeInternal.Build; -} - -// @alpha -export type BuildNode = BuildTreeNode | number; - -// @alpha -export type BuildNodeInternal = TreeNode | DetachedSequenceId; - -// @alpha -export type BuildNodeInternal_0_0_2 = TreeNode | DetachedSequenceId; - -// @alpha -export interface BuildTreeNode extends HasVariadicTraits { - // (undocumented) - definition: string; - // (undocumented) - identifier?: NodeId; - // (undocumented) - payload?: Payload; -} - -// @alpha -export type Change = Insert | Detach | Build | SetValue | Constraint; - -// @alpha (undocumented) -export const Change: { - build: (source: BuildNode | TreeNodeSequence, destination: number) => Build; - insert: (source: number, destination: StablePlace) => Insert; - detach: (source: StableRange, destination?: number) => Detach; - setPayload: (nodeToModify: NodeId, payload: Payload) => SetValue; - clearPayload: (nodeToModify: NodeId) => SetValue; - constraint: (toConstrain: StableRange, effect: ConstraintEffect, identityHash?: UuidString, length?: number, contentHash?: UuidString, parentNode?: NodeId, label?: TraitLabel) => Constraint; - delete: (stableRange: StableRange) => Change; - insertTree: (nodes: BuildNode | TreeNodeSequence, destination: StablePlace) => Change[]; - move: (source: StableRange, destination: StablePlace) => Change[]; -}; - -// @alpha -export type ChangeInternal = InsertInternal | DetachInternal | BuildInternal | SetValueInternal | ConstraintInternal; - -// @alpha (undocumented) -export const ChangeInternal: { - build: (source: TreeNodeSequence, destination: DetachedSequenceId) => BuildInternal; - insert: (source: DetachedSequenceId, destination: StablePlaceInternal) => InsertInternal; - detach: (source: StableRangeInternal, destination?: DetachedSequenceId) => DetachInternal; - setPayload: (nodeToModify: NodeData | NodeId, payload: Payload) => SetValueInternal; - clearPayload: (nodeToModify: NodeData | NodeId) => SetValueInternal; - constraint: (toConstrain: StableRangeInternal, effect: ConstraintEffect, identityHash?: UuidString, length?: number, contentHash?: UuidString, parentNode?: NodeId, label?: TraitLabel) => ConstraintInternal; - delete: (stableRange: StableRangeInternal) => ChangeInternal; - insertTree: (nodes: TreeNodeSequence, destination: StablePlaceInternal) => ChangeInternal[]; - move: (source: StableRangeInternal, destination: StablePlaceInternal) => ChangeInternal[]; -}; - -// @alpha -export type ChangeNode_0_0_2 = TreeNode; - -// @alpha -export enum ChangeType { - // (undocumented) - Build = 2, - // (undocumented) - Constraint = 4, - // (undocumented) - Detach = 1, - // (undocumented) - Insert = 0, - // (undocumented) - SetValue = 3 -} - -// @alpha -export enum ChangeTypeInternal { - // (undocumented) - Build = 2, - // (undocumented) - CompressedBuild = 5, - // (undocumented) - Constraint = 4, - // (undocumented) - Detach = 1, - // (undocumented) - Insert = 0, - // (undocumented) - SetValue = 3 -} - -// @alpha -export abstract class Checkout extends EventEmitterWithErrorHandling implements IDisposable { - protected constructor(tree: SharedTree, currentView: RevisionView, onEditCommitted: EditCommittedHandler); - abortEdit(): void; - applyChanges(changes: readonly Change[]): void; - // (undocumented) - applyChanges(...changes: readonly Change[]): void; - applyEdit(changes: readonly Change[]): EditId; - // (undocumented) - applyEdit(...changes: readonly Change[]): EditId; - closeEdit(): EditId; - get currentView(): TreeView; - dispose(error?: Error): void; - // (undocumented) - disposed: boolean; - protected emitChange(): void; - getEditStatus(): EditStatus; - protected handleNewEdit(id: EditId, result: ValidEditingResult): void; - hasOpenEdit(): boolean; - protected hintKnownEditingResult(edit: Edit, result: ValidEditingResult): void; - protected abstract get latestCommittedView(): RevisionView; - openEdit(): void; - rebaseCurrentEdit(): EditValidationResult.Valid | EditValidationResult.Invalid; - revert(editId: EditId): void; - readonly tree: SharedTree; - protected tryApplyChangesInternal(changes: readonly ChangeInternal[]): EditStatus; - // (undocumented) - protected tryApplyChangesInternal(...changes: readonly ChangeInternal[]): EditStatus; - tryApplyEdit(changes: readonly Change[]): EditId | undefined; - // (undocumented) - tryApplyEdit(...changes: readonly Change[]): EditId | undefined; - // (undocumented) - abstract waitForEditsToSubmit(): Promise; - // (undocumented) - abstract waitForPendingUpdates(): Promise; -} - -// @alpha -export enum CheckoutEvent { - ViewChange = "viewChange" -} - -// @alpha (undocumented) -export function comparePayloads(a: Payload, b: Payload): boolean; - -// @alpha -export type CompressedId = FinalCompressedId | LocalCompressedId; - -// @alpha -export interface Constraint { - readonly contentHash?: UuidString; - readonly effect: ConstraintEffect; - readonly identityHash?: UuidString; - readonly label?: TraitLabel; - readonly length?: number; - readonly parentNode?: NodeId; - readonly toConstrain: StableRange; - readonly type: typeof ChangeType.Constraint; -} - -// @alpha -export enum ConstraintEffect { - InvalidAndDiscard = 0, - InvalidRetry = 1, - ValidRetry = 2 -} - -// @alpha -export interface ConstraintInternal extends Omit { - readonly parentNode?: NodeId; - readonly toConstrain: StableRangeInternal; -} - -// @alpha -export interface ConstraintInternal_0_0_2 { - readonly contentHash?: UuidString; - readonly effect: ConstraintEffect; - readonly identityHash?: UuidString; - readonly label?: TraitLabel; - readonly length?: number; - readonly parentNode?: StableNodeId; - readonly toConstrain: StableRangeInternal_0_0_2; - readonly type: typeof ChangeTypeInternal.Constraint; -} - -// @alpha -export type Definition = UuidString & { - readonly Definition: 'c0ef9488-2a78-482d-aeed-37fba996354c'; -}; - -// @alpha -export interface Delta { - readonly added: readonly NodeId[]; - readonly changed: readonly NodeId[]; - readonly removed: readonly NodeId[]; -} - -// @alpha -export interface Detach { - // (undocumented) - readonly destination?: number; - // (undocumented) - readonly source: StableRange; - // (undocumented) - readonly type: typeof ChangeType.Detach; -} - -// @alpha -export type DetachedSequenceId = number & { - readonly DetachedSequenceId: 'f7d7903a-194e-45e7-8e82-c9ef4333577d'; -}; - -// @alpha -export interface DetachInternal extends Omit { - // (undocumented) - readonly source: StableRangeInternal; -} - -// @alpha -export interface DetachInternal_0_0_2 { - // (undocumented) - readonly destination?: DetachedSequenceId; - // (undocumented) - readonly source: StableRangeInternal_0_0_2; - // (undocumented) - readonly type: typeof ChangeTypeInternal.Detach; -} - -// @alpha @sealed -export class EagerCheckout extends Checkout { - constructor(tree: SharedTree); - // (undocumented) - protected get latestCommittedView(): RevisionView; - // (undocumented) - waitForEditsToSubmit(): Promise; - // (undocumented) - waitForPendingUpdates(): Promise; -} - -// @alpha -export interface Edit extends EditBase { - readonly id: EditId; -} - -// @alpha -export type EditApplicationOutcome = { - readonly view: RevisionView; - readonly status: EditStatus.Applied; -} | { - readonly failure: TransactionInternal.Failure; - readonly status: EditStatus.Invalid | EditStatus.Malformed; -}; - -// @alpha -export interface EditBase { - readonly changes: readonly TChange[]; - readonly pastAttemptCount?: number; -} - -// @alpha -export interface EditCommittedEventArguments { - readonly editId: EditId; - readonly local: boolean; - readonly tree: SharedTree; -} - -// @alpha -export type EditCommittedHandler = (args: EditCommittedEventArguments) => void; - -// @alpha -export type EditId = UuidString & { - readonly EditId: '56897beb-53e4-4e66-85da-4bf5cd5d0d49'; -}; - -// @alpha -export interface EditingResultBase { - readonly before: RevisionView; - readonly changes: readonly ChangeInternal[]; - readonly status: EditStatus; - readonly steps: readonly ReconciliationChange[]; -} - -// @alpha -export enum EditStatus { - Applied = 2, - Invalid = 1, - Malformed = 0 -} - -// @alpha -export enum EditValidationResult { - Invalid = 1, - Malformed = 0, - Valid = 2 -} - -// @alpha -export type FinalCompressedId = number & { - readonly FinalCompressedId: '5d83d1e2-98b7-4e4e-a889-54c855cfa73d'; - readonly OpNormalized: '9209432d-a959-4df7-b2ad-767ead4dbcae'; -}; - -// @alpha -export class Forest { - add(nodes: Iterable): Forest; - assertConsistent(): void; - attachRangeOfChildren(parentId: NodeId, label: TraitLabel, index: number, childIds: readonly NodeId[]): Forest; - static create(expensiveValidation?: boolean): Forest; - delete(ids: Iterable, deleteChildren: boolean): Forest; - delta(forest: Forest): Delta; - detachRangeOfChildren(parentId: NodeId, label: TraitLabel, startIndex: number, endIndex: number): { - forest: Forest; - detached: readonly NodeId[]; - }; - equals(forest: Forest): boolean; - // (undocumented) - get(id: NodeId): ForestNode; - // (undocumented) - getParent(id: NodeId): ParentData; - // (undocumented) - has(id: NodeId): boolean; - setValue(nodeId: NodeId, value: Payload | null): Forest; - get size(): number; - // (undocumented) - tryGet(id: NodeId): ForestNode | undefined; - // (undocumented) - tryGetParent(id: NodeId): ParentData | undefined; -} - -// @alpha -export interface ForestNode extends NodeData { - // (undocumented) - readonly traits: ReadonlyMap; -} - -// @alpha -export interface HasTraits { - // (undocumented) - readonly traits: TraitMap; -} - -// @alpha -export interface HasVariadicTraits { - // (undocumented) - readonly traits?: { - readonly [key: string]: TChild | TreeNodeSequence | undefined; - }; -} - -// @alpha -export interface ICheckoutEvents extends IErrorEvent { - // (undocumented) - (event: 'viewChange', listener: (before: TreeView, after: TreeView) => void): any; -} - -// @alpha -export const initialTree: ChangeNode_0_0_2; - -// @alpha -export interface Insert { - // (undocumented) - readonly destination: StablePlace; - // (undocumented) - readonly source: number; - // (undocumented) - readonly type: typeof ChangeType.Insert; -} - -// @alpha -export interface InsertInternal extends Omit { - // (undocumented) - readonly destination: StablePlaceInternal; -} - -// @alpha -export interface InsertInternal_0_0_2 { - // (undocumented) - readonly destination: StablePlaceInternal_0_0_2; - // (undocumented) - readonly source: DetachedSequenceId; - // (undocumented) - readonly type: typeof ChangeTypeInternal.Insert; -} - -// @alpha -export interface InternalizedChange { - // (undocumented) - InternalChangeBrand: '2cae1045-61cf-4ef7-a6a3-8ad920cb7ab3'; -} - -// @alpha -export interface IRevertible { - discard(): any; - revert(): any; -} - -// @alpha -export interface ISharedTreeEvents extends ISharedObjectEvents { - // (undocumented) - (event: 'committedEdit', listener: EditCommittedHandler): any; - // (undocumented) - (event: 'appliedSequencedEdit', listener: SequencedEditAppliedHandler): any; -} - -// @alpha -export interface IUndoConsumer { - pushToCurrentOperation(revertible: IRevertible): any; -} - -// @alpha -export type LocalCompressedId = number & { - readonly LocalCompressedId: '6fccb42f-e2a4-4243-bd29-f13d12b9c6d1'; -} & SessionUnique; - -// @alpha -export interface LogViewer { - // @deprecated - getRevisionView(revision: Revision): Promise; - getRevisionViewInMemory(revision: Revision): RevisionView; - // @deprecated - getRevisionViewInSession(revision: Revision): RevisionView; -} - -// @alpha -export interface NodeData { - readonly definition: Definition; - readonly identifier: TId; - readonly payload?: Payload; -} - -// @alpha -export type NodeId = number & SessionSpaceCompressedId & NodeIdBrand; - -// @alpha (undocumented) -export interface NodeIdBrand { - // (undocumented) - readonly NodeId: 'e53e7d6b-c8b9-431a-8805-4843fc639342'; -} - -// @alpha -export interface NodeIdContext extends NodeIdGenerator, NodeIdConverter { -} - -// @alpha -export interface NodeIdConverter { - convertToNodeId(id: StableNodeId): NodeId; - convertToStableNodeId(id: NodeId): StableNodeId; - tryConvertToNodeId(id: StableNodeId): NodeId | undefined; - tryConvertToStableNodeId(id: NodeId): StableNodeId | undefined; -} - -// @alpha -export interface NodeIdGenerator { - generateNodeId(override?: string): NodeId; -} - -// @alpha @sealed -export interface OrderedEditSet { - readonly editIds: readonly EditId[]; - // @deprecated (undocumented) - getEditAtIndex(index: number): Promise>; - // @deprecated (undocumented) - getEditInSessionAtIndex(index: number): Edit; - // (undocumented) - getIdAtIndex(index: number): EditId; - // (undocumented) - getIndexOfId(editId: EditId): number; - getLocalEdits(): Iterable>; - readonly length: number; - // @deprecated (undocumented) - tryGetEdit(editId: EditId): Promise | undefined>; - // (undocumented) - tryGetEditAtIndex(index: number): Edit | undefined; - // (undocumented) - tryGetEditFromId(editId: EditId): Edit | undefined; - // (undocumented) - tryGetIndexOfId(editId: EditId): number | undefined; -} - -// @alpha -export interface ParentData { - // (undocumented) - readonly parentId: NodeId; - // (undocumented) - readonly traitParent: TraitLabel; -} - -// @alpha -export type Payload = any; - -// @alpha -export type PlaceIndex = number & { - readonly PlaceIndex: unique symbol; -}; - -// @alpha -export enum PlaceValidationResult { - // (undocumented) - Malformed = "Malformed", - // (undocumented) - MissingParent = "MissingParent", - // (undocumented) - MissingSibling = "MissingSibling", - // (undocumented) - SiblingIsRootOrDetached = "SiblingIsRootOrDetached", - // (undocumented) - Valid = "Valid" -} - -// @alpha -export type RangeValidationResult = RangeValidationResultKind.Valid | RangeValidationResultKind.PlacesInDifferentTraits | RangeValidationResultKind.Inverted | { - kind: RangeValidationResultKind.BadPlace; - place: StablePlaceInternal; - placeFailure: BadPlaceValidationResult; -}; - -// @alpha -export enum RangeValidationResultKind { - // (undocumented) - BadPlace = "BadPlace", - // (undocumented) - Inverted = "Inverted", - // (undocumented) - PlacesInDifferentTraits = "PlacesInDifferentTraits", - // (undocumented) - Valid = "Valid" -} - -// @alpha -export interface ReconciliationChange { - readonly after: TransactionView; - readonly resolvedChange: ChangeInternal; -} - -// @alpha -export interface ReconciliationEdit { - readonly [index: number]: ReconciliationChange; - readonly after: TreeView; - readonly before: TreeView; - readonly length: number; -} - -// @alpha -export interface ReconciliationPath { - readonly [index: number]: ReconciliationEdit; - readonly length: number; -} - -// @alpha -export type Revision = number; - -// @alpha -export class RevisionView extends TreeView { - // (undocumented) - equals(view: TreeView): boolean; - static fromTree>(root: T, expensiveValidation?: boolean): RevisionView; - static fromTree>(root: T, idConverter: NodeIdConverter, expensiveValidation?: boolean): RevisionView; - openForTransaction(): TransactionView; -} - -// @alpha -export interface SequencedEditAppliedEventArguments { - readonly edit: Edit; - readonly logger: ITelemetryLoggerExt; - readonly outcome: EditApplicationOutcome; - readonly reconciliationPath: ReconciliationPath; - readonly tree: SharedTree; - readonly wasLocal: boolean; -} - -// @alpha -export type SequencedEditAppliedHandler = (args: SequencedEditAppliedEventArguments) => void; - -// @alpha -export type SessionSpaceCompressedId = CompressedId & SessionUnique; - -// @alpha -export interface SessionUnique { - // (undocumented) - readonly SessionUnique: 'cea55054-6b82-4cbf-ad19-1fa645ea3b3e'; -} - -// @alpha -export interface SetValue { - // (undocumented) - readonly nodeToModify: NodeId; - readonly payload: Payload | null; - // (undocumented) - readonly type: typeof ChangeType.SetValue; -} - -// @alpha -export interface SetValueInternal extends Omit { - // (undocumented) - readonly nodeToModify: NodeId; -} - -// @alpha -export interface SetValueInternal_0_0_2 { - // (undocumented) - readonly nodeToModify: StableNodeId; - readonly payload: Payload | null; - // (undocumented) - readonly type: typeof ChangeTypeInternal.SetValue; -} - -// @alpha -export class SharedTree extends SharedObject implements NodeIdContext { - constructor(runtime: IFluidDataStoreRuntime, id: string, ...args: SharedTreeArgs); - constructor(runtime: IFluidDataStoreRuntime, id: string, ...args: SharedTreeArgs); - applyEdit(...changes: readonly Change[]): Edit; - // (undocumented) - applyEdit(changes: readonly Change[]): Edit; - applyEditInternal(editOrChanges: Edit | readonly ChangeInternal[]): Edit; - protected applyStashedOp(op: unknown): void; - attributeNodeId(id: NodeId): AttributionId; - get attributionId(): AttributionId; - convertToNodeId(id: StableNodeId): NodeId; - convertToStableNodeId(id: NodeId): StableNodeId; - static create(runtime: IFluidDataStoreRuntime, id?: string): SharedTree; - // (undocumented) - get currentView(): RevisionView; - // (undocumented) - get edits(): OrderedEditSet; - equals(sharedTree: SharedTree): boolean; - generateNodeId(override?: string): NodeId; - getAttachSummary(fullTree?: boolean | undefined, trackState?: boolean | undefined, telemetryContext?: ITelemetryContext | undefined): ISummaryTreeWithStats; - static getFactory(...args: SharedTreeArgs): SharedTreeFactory; - // (undocumented) - static getFactory(...args: SharedTreeArgs): SharedTreeFactory; - static getFactory(): SharedTreeFactory; - // (undocumented) - getRuntime(): IFluidDataStoreRuntime; - getWriteFormat(): WriteFormat; - internalizeChange(change: Change): ChangeInternal; - protected loadCore(storage: IChannelStorageService): Promise; - loadSerializedSummary(blobData: string): ITelemetryBaseProperties; - loadSummary(summary: SharedTreeSummaryBase): void; - readonly logger: ITelemetryLoggerExt; - get logViewer(): LogViewer; - mergeEditsFrom(other: SharedTree, edits: Iterable>, stableIdRemapper?: (id: StableNodeId) => StableNodeId): EditId[]; - protected onDisconnect(): void; - protected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void; - protected registerCore(): void; - // (undocumented) - protected reSubmitCore(op: unknown, localOpMetadata?: StashedLocalOpMetadata): void; - revert(editId: EditId): EditId | undefined; - revertChanges(changes: readonly InternalizedChange[], before: RevisionView): ChangeInternal[] | undefined; - saveSerializedSummary(options?: { - serializer?: IFluidSerializer; - }): string; - saveSummary(): SharedTreeSummaryBase; - summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats; - tryConvertToNodeId(id: StableNodeId): NodeId | undefined; - tryConvertToStableNodeId(id: NodeId): StableNodeId | undefined; -} - -// @alpha -export type SharedTreeArgs = [writeFormat: WF, options?: SharedTreeOptions]; - // @beta @legacy export const SharedTreeAttributes: IChannelAttributes; -// @alpha -export interface SharedTreeBaseOptions { - editEvictionFrequency?: number; - inMemoryHistorySize?: number; -} - -// @alpha -export enum SharedTreeEvent { - EditCommitted = "committedEdit", - SequencedEditApplied = "sequencedEditApplied" -} - -// @alpha -export class SharedTreeFactory implements IChannelFactory { - constructor(...args: SharedTreeArgs); - static Attributes: IChannelAttributes; - get attributes(): IChannelAttributes; - create(runtime: IFluidDataStoreRuntime, id: string): SharedTree; - load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, _channelAttributes: Readonly): Promise; - static Type: string; - get type(): string; -} - // @beta @legacy export const SharedTreeFactoryType = "SharedTree"; -// @alpha -export type SharedTreeOptions = SharedTreeBaseOptions & Omit; - -// @alpha -export interface SharedTreeOptions_0_0_2 { - summarizeHistory?: boolean; -} - -// @alpha -export interface SharedTreeOptions_0_1_1 { - attributionId?: AttributionId; - summarizeHistory?: false | { - uploadEditChunks: boolean; - }; -} - -// @alpha -export interface SharedTreeSummaryBase { - readonly version: WriteFormat; -} - -// @alpha -export class SharedTreeUndoRedoHandler { - constructor(stackManager: IUndoConsumer); - attachTree(tree: SharedTree): void; - detachTree(tree: SharedTree): void; -} - -// @alpha -export enum Side { - // (undocumented) - After = 1, - // (undocumented) - Before = 0 -} - -// @alpha -export type StableNodeId = string & { - readonly StableNodeId: 'a0843b38-699d-4bb2-aa7a-16c502a71151'; -}; - -// @alpha -export interface StablePlace { - readonly referenceSibling?: NodeId; - readonly referenceTrait?: TraitLocation; - readonly side: Side; -} - -// @alpha (undocumented) -export const StablePlace: { - before: (node: NodeData | NodeId) => StablePlace; - after: (node: NodeData | NodeId) => StablePlace; - atStartOf: (trait: TraitLocation) => StablePlace; - atEndOf: (trait: TraitLocation) => StablePlace; -}; - -// @alpha -export interface StablePlaceInternal extends Omit { - readonly referenceSibling?: NodeId; - readonly referenceTrait?: TraitLocationInternal; -} - -// @alpha (undocumented) -export const StablePlaceInternal: { - before: (node: NodeData | NodeId) => StablePlaceInternal; - after: (node: NodeData | NodeId) => StablePlaceInternal; - atStartOf: (trait: TraitLocationInternal) => StablePlaceInternal; - atEndOf: (trait: TraitLocationInternal) => StablePlaceInternal; -}; - -// @alpha -export interface StablePlaceInternal_0_0_2 { - readonly referenceSibling?: StableNodeId; - readonly referenceTrait?: TraitLocationInternal_0_0_2; - readonly side: Side; -} - -// @alpha -export interface StableRange { - // (undocumented) - readonly end: StablePlace; - // (undocumented) - readonly start: StablePlace; -} - -// @alpha (undocumented) -export const StableRange: { - from: (start: StablePlace) => { - to: (end: StablePlace) => StableRange; - }; - only: (node: NodeData | NodeId) => StableRange; - all: (trait: TraitLocation) => StableRange; -}; - -// @alpha -export interface StableRangeInternal { - // (undocumented) - readonly end: StablePlaceInternal; - // (undocumented) - readonly start: StablePlaceInternal; -} - -// @alpha (undocumented) -export const StableRangeInternal: { - from: (start: StablePlaceInternal) => { - to: (end: StablePlaceInternal) => StableRangeInternal; - }; - only: (node: NodeData | NodeId) => StableRangeInternal; - all: (trait: TraitLocationInternal) => StableRangeInternal; -}; - -// @alpha -export interface StableRangeInternal_0_0_2 { - // (undocumented) - readonly end: StablePlaceInternal_0_0_2; - // (undocumented) - readonly start: StablePlaceInternal_0_0_2; -} - -// @alpha -export interface StashedLocalOpMetadata { - transformedEdit?: Edit; -} - -// @alpha -export interface SucceedingTransactionState { - readonly changes: readonly ChangeInternal[]; - readonly status: EditStatus.Applied; - readonly steps: readonly ReconciliationChange[]; - readonly view: TransactionView; -} - -// @alpha -export type TraitLabel = UuidString & { - readonly TraitLabel: '613826ed-49cc-4df3-b2b8-bfc6866af8e3'; -}; - -// @alpha -export interface TraitLocation { - // (undocumented) - readonly label: TraitLabel; - // (undocumented) - readonly parent: NodeId; -} - -// @alpha -export interface TraitLocationInternal extends Omit { - // (undocumented) - readonly parent: NodeId; -} - -// @alpha -export interface TraitLocationInternal_0_0_2 { - // (undocumented) - readonly label: TraitLabel; - // (undocumented) - readonly parent: StableNodeId; -} - -// @alpha -export interface TraitMap { - // (undocumented) - readonly [key: string]: TreeNodeSequence; -} - -// @alpha -export type TraitNodeIndex = number & { - readonly TraitNodeIndex: unique symbol; -}; - -// @alpha -export class Transaction extends TypedEventEmitter { - constructor(tree: SharedTree); - apply(...changes: readonly Change[]): EditStatus; - // (undocumented) - apply(changes: readonly Change[]): EditStatus; - closeAndCommit(): void; - get currentView(): TreeView; - get isOpen(): boolean; - readonly startingView: TreeView; - get status(): EditStatus; - // (undocumented) - readonly tree: SharedTree; -} - -// @alpha -export enum TransactionEvent { - ViewChange = "viewChange" -} - -// @alpha -export interface TransactionEvents extends IErrorEvent { - // (undocumented) - (event: TransactionEvent.ViewChange, listener: (before: TreeView, after: TreeView) => void): any; -} - -// @alpha -export namespace TransactionInternal { - export interface BadPlaceFailure { - readonly change: ChangeInternal; - readonly kind: FailureKind.BadPlace; - readonly place: StablePlaceInternal; - readonly placeFailure: BadPlaceValidationResult; - } - export interface BadRangeFailure { - readonly change: ChangeInternal; - readonly kind: FailureKind.BadRange; - readonly range: StableRangeInternal; - readonly rangeFailure: BadRangeValidationResult; - } - export interface ConstraintViolationFailure { - readonly constraint: ConstraintInternal; - readonly kind: FailureKind.ConstraintViolation; - readonly violation: ConstraintViolationResult; - } - export enum ConstraintViolationKind { - BadLabel = "BadLabel", - BadLength = "BadLength", - BadParent = "BadParent", - BadRange = "BadRange" - } - export type ConstraintViolationResult = { - readonly kind: ConstraintViolationKind.BadRange; - readonly rangeFailure: BadRangeValidationResult; - } | { - readonly kind: ConstraintViolationKind.BadLength; - readonly actual: number; - } | { - readonly kind: ConstraintViolationKind.BadParent; - readonly actual: NodeId; - } | { - readonly kind: ConstraintViolationKind.BadLabel; - readonly actual: TraitLabel; - }; - export interface DetachedSequenceIdAlreadyInUseFailure { - readonly change: ChangeInternal; - readonly kind: FailureKind.DetachedSequenceIdAlreadyInUse; - readonly sequenceId: DetachedSequenceId; - } - export interface DetachedSequenceNotFoundFailure { - readonly change: ChangeInternal; - readonly kind: FailureKind.DetachedSequenceNotFound; - readonly sequenceId: DetachedSequenceId; - } - export interface DuplicateIdInBuildFailure { - readonly change: ChangeInternal; - readonly id: NodeId; - readonly kind: FailureKind.DuplicateIdInBuild; - } - export type Failure = UnusedDetachedSequenceFailure | DetachedSequenceIdAlreadyInUseFailure | DetachedSequenceNotFoundFailure | DuplicateIdInBuildFailure | IdAlreadyInUseFailure | UnknownIdFailure | BadPlaceFailure | BadRangeFailure | ConstraintViolationFailure; - export enum FailureKind { - BadPlace = "BadPlace", - BadRange = "BadRange", - ConstraintViolation = "ConstraintViolation", - DetachedSequenceIdAlreadyInUse = "DetachedSequenceIdAlreadyInUse", - DetachedSequenceNotFound = "DetachedSequenceNotFound", - DuplicateIdInBuild = "DuplicateIdInBuild", - IdAlreadyInUse = "IdAlreadyInUse", - UnknownId = "UnknownId", - UnusedDetachedSequence = "UnusedDetachedSequence" - } - export interface IdAlreadyInUseFailure { - readonly change: ChangeInternal; - readonly id: NodeId; - readonly kind: FailureKind.IdAlreadyInUse; - } - export interface UnknownIdFailure { - readonly change: ChangeInternal; - readonly id: NodeId; - readonly kind: FailureKind.UnknownId; - } - export interface UnusedDetachedSequenceFailure { - readonly kind: FailureKind.UnusedDetachedSequence; - readonly sequenceId: DetachedSequenceId; - } - // (undocumented) - export type ValidState = SucceedingTransactionState; - {}; -} - -// @alpha -export class TransactionView extends TreeView { - addNodes(sequence: Iterable): TransactionView; - attachRange(nodesToAttach: readonly NodeId[], place: TreeViewPlace): TransactionView; - close(): RevisionView; - deleteNodes(nodes: Iterable): TransactionView; - detachRange(rangeToDetach: TreeViewRange): { - view: TransactionView; - detached: readonly NodeId[]; - }; - // (undocumented) - equals(view: TreeView): boolean; - setNodeValue(nodeId: NodeId, value: Payload): TransactionView; -} - -// @alpha -export interface TreeNode extends NodeData, HasTraits { -} - -// @alpha -export type TreeNodeSequence = readonly TChild[]; - -// @alpha -export abstract class TreeView { - // (undocumented) - [Symbol.iterator](): IterableIterator; - protected constructor(root: NodeId, forest: Forest); - assertConsistent(): void; - delta(view: TreeView): Delta; - // (undocumented) - abstract equals(view: TreeView): boolean; - // (undocumented) - findIndexWithinTrait(place: TreeViewPlace): PlaceIndex; - // (undocumented) - protected readonly forest: Forest; - // (undocumented) - getIndexInTrait(id: NodeId): TraitNodeIndex; - // (undocumented) - getParentViewNode(id: NodeId): TreeViewNode; - // (undocumented) - getTrait(traitLocation: TraitLocation): readonly NodeId[]; - // (undocumented) - getTraitLabel(id: NodeId): TraitLabel; - // (undocumented) - getTraitLocation(id: NodeId): TraitLocation; - // (undocumented) - getViewNode(id: NodeId): TreeViewNode; - // (undocumented) - hasEqualForest(view: TreeView, strict?: boolean): boolean; - // (undocumented) - hasNode(id: NodeId): boolean; - // (undocumented) - readonly root: NodeId; - // (undocumented) - get size(): number; - // (undocumented) - tryGetIndexInTrait(id: NodeId): TraitNodeIndex | undefined; - // (undocumented) - tryGetParentViewNode(id: NodeId): TreeViewNode | undefined; - // (undocumented) - tryGetTraitLabel(id: NodeId): TraitLabel | undefined; - // (undocumented) - tryGetTraitLocation(id: NodeId): TraitLocation | undefined; - // (undocumented) - tryGetViewNode(id: NodeId): TreeViewNode | undefined; -} - -// @alpha -export interface TreeViewNode extends NodeData { - readonly parentage?: TraitLocation; - readonly traits: ReadonlyMap; -} - -// @alpha -export interface TreeViewPlace { - // (undocumented) - readonly sibling?: NodeId; - // (undocumented) - readonly side: Side; - // (undocumented) - readonly trait: TraitLocation; -} - -// @alpha -export interface TreeViewRange { - // (undocumented) - readonly end: TreeViewPlace; - // (undocumented) - readonly start: TreeViewPlace; -} - -// @alpha -export type UuidString = string & { - readonly UuidString: '9d40d0ae-90d9-44b1-9482-9f55d59d5465'; -}; - -// @alpha -export interface ValidEditingResult extends EditingResultBase { - readonly after: RevisionView; - readonly status: EditStatus.Applied; -} - -// @alpha -export enum WriteFormat { - v0_0_2 = "0.0.2", - v0_1_1 = "0.1.1" -} - ``` diff --git a/experimental/dds/tree/src/ChangeTypes.ts b/experimental/dds/tree/src/ChangeTypes.ts index bd80e915dd24..b24cbb9fc5ec 100644 --- a/experimental/dds/tree/src/ChangeTypes.ts +++ b/experimental/dds/tree/src/ChangeTypes.ts @@ -13,7 +13,7 @@ import { ConstraintEffect, NodeData, Payload, Side, TreeNodeSequence } from './p /** * An object which may have traits with children of the given type underneath it - * @alpha + * @internal */ export interface HasVariadicTraits { readonly traits?: { @@ -23,7 +23,7 @@ export interface HasVariadicTraits { /** * The type of a Change - * @alpha + * @internal */ export enum ChangeType { Insert, @@ -45,14 +45,14 @@ export enum ChangeType { * ```typescript * Change.insert(sourceId, destination) * ``` - * @alpha + * @internal */ export type Change = Insert | Detach | Build | SetValue | Constraint; /** * Node or a detached sequence of nodes (referred to by a detached sequence ID) for use in a Build change. * See `BuildTreeNode` for more. - * @alpha + * @internal */ export type BuildNode = BuildTreeNode | number; @@ -63,7 +63,7 @@ export type BuildNode = BuildTreeNode | number; * BuildTreeNode can be observed. If `identifier` is not supplied, one will be generated for it in an especially efficient manner * that allows for compact storage and transmission and thus this property should be omitted if convenient. * See the SharedTree readme for more on the tree format. - * @alpha + * @internal */ export interface BuildTreeNode extends HasVariadicTraits { definition: string; @@ -77,7 +77,7 @@ export interface BuildTreeNode extends HasVariadicTraits { * * Valid if (transitively) all DetachedSequenceId are used according to their rules (use here counts as a destination), * and all Nodes' identifiers are previously unused. - * @alpha + * @internal */ export interface Build { readonly destination: number; @@ -88,7 +88,7 @@ export interface Build { /** * Inserts a sequence of nodes at the specified destination. * The source can be constructed either by a Build (used to insert new nodes) or a Detach (amounts to a "move" operation). - * @alpha + * @internal */ export interface Insert { readonly destination: StablePlace; @@ -101,7 +101,7 @@ export interface Insert { * If a destination is specified, the detached sequence is associated with that ID and held for possible reuse * by later changes in this same Edit (such as by an Insert). * A Detach without a destination is a deletion of the specified sequence, as is a Detach with a destination that is not used later. - * @alpha + * @internal */ export interface Detach { readonly destination?: number; @@ -111,7 +111,7 @@ export interface Detach { /** * Modifies the payload of a node. - * @alpha + * @internal */ export interface SetValue { readonly nodeToModify: NodeId; @@ -132,7 +132,7 @@ export interface SetValue { * non-semantic ways. It is processed in order like any other Change in an Edit. It can cause an edit to fail if the * various constraints are not met at the time of evaluation (ex: the parentNode has changed due to concurrent editing). * Does not modify the document. - * @alpha + * @internal */ export interface Constraint { /** @@ -190,7 +190,7 @@ export interface Constraint { // Note: Documentation of this constant is merged with documentation of the `Change` interface. /** - * @alpha + * @internal */ export const Change = { build: (source: BuildNode | TreeNodeSequence, destination: number): Build => ({ @@ -295,7 +295,7 @@ export const Change = { * StablePlace.before(node) * StablePlace.atStartOf(trait) * ``` - * @alpha + * @internal */ export interface StablePlace { /** @@ -333,7 +333,7 @@ export interface StablePlace { * ```typescript * StableRange.from(StablePlace.before(startNode)).to(StablePlace.after(endNode)) * ``` - * @alpha + * @internal */ export interface StableRange { readonly start: StablePlace; @@ -350,7 +350,7 @@ export interface StableRange { // Note: Documentation of this constant is merged with documentation of the `StablePlace` interface. /** - * @alpha + * @internal */ export const StablePlace = { /** @@ -393,7 +393,7 @@ export const StablePlace = { // Note: Documentation of this constant is merged with documentation of the `StableRange` interface. /** - * @alpha + * @internal */ export const StableRange = { /** diff --git a/experimental/dds/tree/src/Checkout.ts b/experimental/dds/tree/src/Checkout.ts index 35a20a5632e3..06068dbbc70c 100644 --- a/experimental/dds/tree/src/Checkout.ts +++ b/experimental/dds/tree/src/Checkout.ts @@ -25,7 +25,7 @@ import { ChangeInternal, Edit, EditStatus } from './persisted-types/index.js'; /** * An event emitted by a `Checkout` to indicate a state change. See {@link ICheckoutEvents} for event argument information. - * @alpha + * @internal */ export enum CheckoutEvent { /** @@ -37,7 +37,7 @@ export enum CheckoutEvent { /** * Events which may be emitted by `Checkout`. See {@link CheckoutEvent} for documentation of event semantics. - * @alpha + * @internal */ export interface ICheckoutEvents extends IErrorEvent { (event: 'viewChange', listener: (before: TreeView, after: TreeView) => void); @@ -45,7 +45,7 @@ export interface ICheckoutEvents extends IErrorEvent { /** * The result of validation of an Edit. - * @alpha + * @internal */ export enum EditValidationResult { /** @@ -79,7 +79,7 @@ export enum EditValidationResult { * Events emitted by `Checkout` are documented in {@link CheckoutEvent}. * Exceptions thrown during event handling will be emitted as error events, which are automatically surfaced as error events on the * `SharedTree` used at construction time. - * @alpha + * @internal */ export abstract class Checkout extends EventEmitterWithErrorHandling implements IDisposable { /** diff --git a/experimental/dds/tree/src/EagerCheckout.ts b/experimental/dds/tree/src/EagerCheckout.ts index b194df2a85c7..4cc39bad1185 100644 --- a/experimental/dds/tree/src/EagerCheckout.ts +++ b/experimental/dds/tree/src/EagerCheckout.ts @@ -11,7 +11,7 @@ import { EditCommittedEventArguments, SharedTree } from './SharedTree.js'; * Checkout that always stays up to date with the SharedTree. * This means that {@link EagerCheckout.waitForPendingUpdates} is always a no-op since EagerCheckout is always up to date. * @sealed - * @alpha + * @internal */ export class EagerCheckout extends Checkout { /** diff --git a/experimental/dds/tree/src/EditLog.ts b/experimental/dds/tree/src/EditLog.ts index 50dcb7a2f9e9..06409988a955 100644 --- a/experimental/dds/tree/src/EditLog.ts +++ b/experimental/dds/tree/src/EditLog.ts @@ -19,7 +19,7 @@ import { Edit, EditLogSummary, EditWithoutId, FluidEditHandle } from './persiste * An ordered set of Edits associated with a SharedTree. * Supports fast lookup of edits by ID and enforces idempotence. * @sealed - * @alpha + * @internal */ export interface OrderedEditSet { /** @@ -206,7 +206,7 @@ export type EditEvictionHandler = (editsToEvict: number) => void; /** * Events which may be emitted by {@link EditLog} - * @alpha + * @internal */ export interface IEditLogEvents extends IEvent { (event: 'unexpectedHistoryChunk', listener: () => void); @@ -218,7 +218,7 @@ export interface IEditLogEvents extends IEvent { * Ordered first by locality (acked or local), then by time of insertion. * May not contain more than one edit with the same ID. * @sealed - * @alpha + * @internal */ export class EditLog extends TypedEventEmitter implements OrderedEditSet { private localEditSequence = 0; diff --git a/experimental/dds/tree/src/EditUtilities.ts b/experimental/dds/tree/src/EditUtilities.ts index 8d67fc0e5494..053f714e0619 100644 --- a/experimental/dds/tree/src/EditUtilities.ts +++ b/experimental/dds/tree/src/EditUtilities.ts @@ -409,7 +409,7 @@ export function validateStablePlace( /** * The result of validating a place. - * @alpha + * @internal */ export enum PlaceValidationResult { Valid = 'Valid', @@ -421,7 +421,7 @@ export enum PlaceValidationResult { /** * The result of validating a bad place. - * @alpha + * @internal */ export type BadPlaceValidationResult = Exclude; @@ -491,7 +491,7 @@ export function validateStableRange( /** * The kinds of result of validating a range. - * @alpha + * @internal */ export enum RangeValidationResultKind { Valid = 'Valid', @@ -502,7 +502,7 @@ export enum RangeValidationResultKind { /** * The result of validating a range. - * @alpha + * @internal */ export type RangeValidationResult = | RangeValidationResultKind.Valid @@ -516,7 +516,7 @@ export type RangeValidationResult = /** * The result of validating a bad range. - * @alpha + * @internal */ export type BadRangeValidationResult = Exclude; diff --git a/experimental/dds/tree/src/EventTypes.ts b/experimental/dds/tree/src/EventTypes.ts index 9129a79f0a5b..2a4df36a7551 100644 --- a/experimental/dds/tree/src/EventTypes.ts +++ b/experimental/dds/tree/src/EventTypes.ts @@ -6,7 +6,7 @@ /** * An event emitted by a `SharedTree` to indicate a state change. See {@link ISharedTreeEvents} for event * argument information. - * @alpha + * @internal */ export enum SharedTreeEvent { /** diff --git a/experimental/dds/tree/src/Forest.ts b/experimental/dds/tree/src/Forest.ts index aa5d4336bf9a..1f995bb28008 100644 --- a/experimental/dds/tree/src/Forest.ts +++ b/experimental/dds/tree/src/Forest.ts @@ -13,7 +13,7 @@ import { NodeData, Payload } from './persisted-types/index.js'; /** * A node that can be contained within a Forest - * @alpha + * @internal */ export interface ForestNode extends NodeData { readonly traits: ReadonlyMap; @@ -41,7 +41,7 @@ export function isParentedForestNode(node: ForestNode): node is ParentedForestNo /** * Information about a ForestNode's parent - * @alpha + * @internal */ export interface ParentData { readonly parentId: NodeId; @@ -50,7 +50,7 @@ export interface ParentData { /** * Differences from one forest to another. - * @alpha + * @internal */ export interface Delta { /** @@ -75,7 +75,7 @@ interface ForestState { /** * An immutable forest of ForestNode. * Enforces single parenting, and allows querying the parent. - * @alpha + * @internal */ export class Forest { /** diff --git a/experimental/dds/tree/src/Identifiers.ts b/experimental/dds/tree/src/Identifiers.ts index 2872ab5f824b..7827f4b37285 100644 --- a/experimental/dds/tree/src/Identifiers.ts +++ b/experimental/dds/tree/src/Identifiers.ts @@ -11,7 +11,7 @@ * A 128-bit Universally Unique IDentifier. Represented here * with a string of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, * where x is a lowercase hex digit. - * @alpha + * @internal */ export type UuidString = string & { readonly UuidString: '9d40d0ae-90d9-44b1-9482-9f55d59d5465'; @@ -19,7 +19,7 @@ export type UuidString = string & { /** * An identifier associated with a session for the purpose of attributing its created content to some user/entity. - * @alpha + * @internal */ export type AttributionId = UuidString; @@ -41,7 +41,7 @@ export type SessionId = StableId & { /** * Edit identifier - * @alpha + * @internal */ export type EditId = UuidString & { readonly EditId: '56897beb-53e4-4e66-85da-4bf5cd5d0d49' }; @@ -51,7 +51,7 @@ export type EditId = UuidString & { readonly EditId: '56897beb-53e4-4e66-85da-4b * Within a given Edit, any DetachedSequenceId must be a source at most once, and a destination at most once. * If used as a source, it must be after it is used as a destination. * If this is violated, the Edit is considered malformed. - * @alpha + * @internal */ export type DetachedSequenceId = number & { readonly DetachedSequenceId: 'f7d7903a-194e-45e7-8e82-c9ef4333577d'; @@ -59,7 +59,7 @@ export type DetachedSequenceId = number & { /** * An identifier (UUID) that has been shortened by a distributed compression algorithm. - * @alpha + * @internal */ export type CompressedId = FinalCompressedId | LocalCompressedId; @@ -73,7 +73,7 @@ export type InternedStringId = number & { /** * A brand for identity types that are unique within a particular session (SharedTree instance). - * @alpha + * @internal */ export interface SessionUnique { readonly SessionUnique: 'cea55054-6b82-4cbf-ad19-1fa645ea3b3e'; @@ -83,7 +83,7 @@ export interface SessionUnique { * A compressed ID that has been normalized into "session space" (see `IdCompressor` for more). * Consumer-facing APIs and data structures should use session-space IDs as their lifetime and equality is stable and tied to the * compressor that produced them. - * @alpha + * @internal */ export type SessionSpaceCompressedId = CompressedId & SessionUnique; @@ -101,7 +101,7 @@ export type OpSpaceCompressedId = CompressedId & { * 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. * It should not be persisted outside of the history as it can only be decompressed in the context of the originating document. * If external persistence is needed (e.g. by a client), a StableId should be used instead. - * @alpha + * @internal */ export type FinalCompressedId = number & { readonly FinalCompressedId: '5d83d1e2-98b7-4e4e-a889-54c855cfa73d'; @@ -114,14 +114,14 @@ export type FinalCompressedId = number & { * A compressed ID that is local to a session (can only be decompressed when paired with a SessionId). * It should not be persisted outside of the history as it can only be decompressed in the context of the originating session. * If external persistence is needed (e.g. by a client), a StableId should be used instead. - * @alpha + * @internal */ export type LocalCompressedId = number & { readonly LocalCompressedId: '6fccb42f-e2a4-4243-bd29-f13d12b9c6d1'; } & SessionUnique; // Same brand as CompressedId, as local IDs are always locally normalized /** - * @alpha + * @internal */ export interface NodeIdBrand { readonly NodeId: 'e53e7d6b-c8b9-431a-8805-4843fc639342'; @@ -130,7 +130,7 @@ export interface NodeIdBrand { /** * Node identifier. * Identifies a node within a document. - * @alpha + * @internal */ export type NodeId = number & SessionSpaceCompressedId & NodeIdBrand; @@ -145,7 +145,7 @@ export type OpSpaceNodeId = number & OpSpaceCompressedId & NodeIdBrand; /** * Globally unique node identifier. * Uniquely identifies a node within and across documents. Can be used across SharedTree instances. - * @alpha + * @internal */ export type StableNodeId = string & { readonly StableNodeId: 'a0843b38-699d-4bb2-aa7a-16c502a71151'; @@ -154,7 +154,7 @@ export type StableNodeId = string & { /** * Definition. * A full (Uuid) persistable definition. - * @alpha + * @internal */ export type Definition = UuidString & { readonly Definition: 'c0ef9488-2a78-482d-aeed-37fba996354c'; @@ -163,7 +163,7 @@ export type Definition = UuidString & { /** * Definition. * A full (Uuid) persistable label for a trait. - * @alpha + * @internal */ export type TraitLabel = UuidString & { readonly TraitLabel: '613826ed-49cc-4df3-b2b8-bfc6866af8e3'; diff --git a/experimental/dds/tree/src/InitialTree.ts b/experimental/dds/tree/src/InitialTree.ts index face33d12840..e97b4161098a 100644 --- a/experimental/dds/tree/src/InitialTree.ts +++ b/experimental/dds/tree/src/InitialTree.ts @@ -9,7 +9,7 @@ import { ChangeNode_0_0_2 } from './persisted-types/index.js'; /** * The initial tree. - * @alpha + * @internal */ export const initialTree: ChangeNode_0_0_2 = { traits: {}, diff --git a/experimental/dds/tree/src/LogViewer.ts b/experimental/dds/tree/src/LogViewer.ts index 86217e4b06a7..b274b31cddb5 100644 --- a/experimental/dds/tree/src/LogViewer.ts +++ b/experimental/dds/tree/src/LogViewer.ts @@ -144,7 +144,7 @@ export type CachedEditingResult = AttemptedEditResultCacheEntry & { /** * Creates `RevisionView`s for the revisions in an `EditLog` - * @alpha + * @internal */ export interface LogViewer { /** @@ -213,7 +213,7 @@ export interface ICachingLogViewerEvents extends IEvent { * * 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 * a CachingLogViewer instance, that instance should be disposed with `detachFromEditLog` to ensure it is garbage-collectable. - * @alpha + * @internal */ export class CachingLogViewer extends TypedEventEmitter implements LogViewer { public readonly log: EditLog; diff --git a/experimental/dds/tree/src/NodeIdUtilities.ts b/experimental/dds/tree/src/NodeIdUtilities.ts index 0c14fa0902fa..14d4ca910d14 100644 --- a/experimental/dds/tree/src/NodeIdUtilities.ts +++ b/experimental/dds/tree/src/NodeIdUtilities.ts @@ -10,13 +10,13 @@ import { NodeData } from './persisted-types/index.js'; /** * An object which can generate node IDs and convert node IDs between compressed and stable variants - * @alpha + * @internal */ export interface NodeIdContext extends NodeIdGenerator, NodeIdConverter {} /** * An object which can generate node IDs - * @alpha + * @internal */ export interface NodeIdGenerator { /** @@ -35,7 +35,7 @@ export interface NodeIdGenerator { /** * An object which can convert node IDs between compressed and stable variants - * @alpha + * @internal */ export interface NodeIdConverter { /** diff --git a/experimental/dds/tree/src/PayloadUtilities.ts b/experimental/dds/tree/src/PayloadUtilities.ts index 4edd96e129e6..e266002cbbac 100644 --- a/experimental/dds/tree/src/PayloadUtilities.ts +++ b/experimental/dds/tree/src/PayloadUtilities.ts @@ -41,7 +41,7 @@ import { Payload } from './persisted-types/index.js'; * IFluidHandle instances (detected via JavaScript feature detection pattern) are only compared by absolutePath. * * TODO:#54095: Is there a better way to do this comparison? - * @alpha + * @internal */ export function comparePayloads(a: Payload, b: Payload): boolean { // === is not reflective because of how NaN is handled, so use Object.is instead. diff --git a/experimental/dds/tree/src/ReconciliationPath.ts b/experimental/dds/tree/src/ReconciliationPath.ts index 6aaa76792a7a..57c5b6f0fc82 100644 --- a/experimental/dds/tree/src/ReconciliationPath.ts +++ b/experimental/dds/tree/src/ReconciliationPath.ts @@ -12,7 +12,7 @@ import { ChangeInternal } from './persisted-types/index.js'; * change is actually applied. * The path only contains edits that were successfully applied. * This path is always empty for a change that has no concurrent edits. - * @alpha + * @internal */ export interface ReconciliationPath { /** @@ -28,7 +28,7 @@ export interface ReconciliationPath { /** * An edit in the `ReconciliationPath`. - * @alpha + * @internal */ export interface ReconciliationEdit { /** @@ -52,7 +52,7 @@ export interface ReconciliationEdit { /** * A change in the `ReconciliationPath`. - * @alpha + * @internal */ export interface ReconciliationChange { /** diff --git a/experimental/dds/tree/src/RevisionValueCache.ts b/experimental/dds/tree/src/RevisionValueCache.ts index 08698dda625b..95e26ddbcb5e 100644 --- a/experimental/dds/tree/src/RevisionValueCache.ts +++ b/experimental/dds/tree/src/RevisionValueCache.ts @@ -18,7 +18,7 @@ import { compareFiniteNumbers, fail } from './Common.js'; * - revision 0 corresponds to the initialRevision. * * - revision 1 corresponds to the output of editLog[0] applied to the initialRevision. - * @alpha + * @internal */ export type Revision = number; diff --git a/experimental/dds/tree/src/RevisionView.ts b/experimental/dds/tree/src/RevisionView.ts index 64cd833eab5a..2ed3c2a3eb64 100644 --- a/experimental/dds/tree/src/RevisionView.ts +++ b/experimental/dds/tree/src/RevisionView.ts @@ -13,7 +13,7 @@ import { Payload, TreeNode, TreeNodeSequence } from './persisted-types/index.js' /** * An immutable view of a distributed tree. - * @alpha + * @internal */ export class RevisionView extends TreeView { /** @@ -86,7 +86,7 @@ export class RevisionView extends TreeView { /** * An view of a distributed tree that is part of an ongoing transaction between `RevisionView`s. - * @alpha + * @internal */ export class TransactionView extends TreeView { /** Conclude a transaction by generating an immutable `RevisionView` from this view */ diff --git a/experimental/dds/tree/src/SharedTree.ts b/experimental/dds/tree/src/SharedTree.ts index 5be54b8e93dc..038c04b10b83 100644 --- a/experimental/dds/tree/src/SharedTree.ts +++ b/experimental/dds/tree/src/SharedTree.ts @@ -108,13 +108,13 @@ import { SharedTreeAttributes, SharedTreeFactoryType } from './publicContracts.j /** * The write format and associated options used to construct a `SharedTree` - * @alpha + * @internal */ export type SharedTreeArgs = [writeFormat: WF, options?: SharedTreeOptions]; /** * The type of shared tree options for a given write format - * @alpha + * @internal */ export type SharedTreeOptions< WF extends WriteFormat, @@ -131,7 +131,7 @@ export type SharedTreeOptions< /** * Configuration options for SharedTree that are independent of write format versions. - * @alpha + * @internal */ export interface SharedTreeBaseOptions { /** @@ -152,7 +152,7 @@ export interface SharedTreeBaseOptions { /** * Configuration options for a SharedTree with write format 0.0.2 - * @alpha + * @internal */ export interface SharedTreeOptions_0_0_2 { /** @@ -174,7 +174,7 @@ export interface SharedTreeOptions_0_0_2 { /** * Configuration options for a SharedTree with write format 0.1.1 - * @alpha + * @internal */ export interface SharedTreeOptions_0_1_1 { /** @@ -199,7 +199,7 @@ export interface SharedTreeOptions_0_1_1 { /** * Factory for SharedTree. * Includes history in the summary. - * @alpha + * @internal */ export class SharedTreeFactory implements IChannelFactory { /** @@ -289,7 +289,7 @@ const sortedWriteVersions = [WriteFormat.v0_0_2, WriteFormat.v0_1_1]; /** * The arguments included when the EditCommitted SharedTreeEvent is emitted. - * @alpha + * @internal */ export interface EditCommittedEventArguments { /** The ID of the edit committed. */ @@ -302,7 +302,7 @@ export interface EditCommittedEventArguments { /** * The arguments included when the {@link SharedTreeEvent.SequencedEditApplied} SharedTreeEvent is emitted. - * @alpha + * @internal */ export interface SequencedEditAppliedEventArguments { /** The ID of the edit committed. */ @@ -321,7 +321,7 @@ export interface SequencedEditAppliedEventArguments { /** * The outcome of an edit. - * @alpha + * @internal */ export type EditApplicationOutcome = | { @@ -347,7 +347,7 @@ export type EditApplicationOutcome = /** * Events which may be emitted by `SharedTree`. See {@link SharedTreeEvent} for documentation of event semantics. - * @alpha + * @internal */ export interface ISharedTreeEvents extends ISharedObjectEvents { (event: 'committedEdit', listener: EditCommittedHandler); @@ -356,13 +356,13 @@ export interface ISharedTreeEvents extends ISharedObjectEvents { /** * Expected type for a handler of the `EditCommitted` event. - * @alpha + * @internal */ export type EditCommittedHandler = (args: EditCommittedEventArguments) => void; /** * Expected type for a handler of the {@link SharedTreeEvent.SequencedEditApplied} event. - * @alpha + * @internal */ export type SequencedEditAppliedHandler = (args: SequencedEditAppliedEventArguments) => void; @@ -372,7 +372,7 @@ const sharedTreeTelemetryProperties: ITelemetryLoggerPropertyBags = { /** * Contains information resulting from processing stashed shared tree ops - * @alpha + * @internal */ export interface StashedLocalOpMetadata { /** A modified version of the edit in an edit op that should be resubmitted rather than the original edit */ @@ -384,7 +384,7 @@ const stashedSessionId = '8477b8d5-cf6c-4673-8345-8f076a8f9bc6' as SessionId; /** * A {@link https://github.com/microsoft/FluidFramework/blob/main/experimental/dds/tree/README.md | distributed tree}. - * @alpha + * @internal */ export class SharedTree extends SharedObject implements NodeIdContext { /** diff --git a/experimental/dds/tree/src/Transaction.ts b/experimental/dds/tree/src/Transaction.ts index d4e5aa055409..2c4df613c3f6 100644 --- a/experimental/dds/tree/src/Transaction.ts +++ b/experimental/dds/tree/src/Transaction.ts @@ -17,7 +17,7 @@ import { ChangeInternal, Edit, EditStatus } from './persisted-types/index.js'; /** * An event emitted by a `Transaction` to indicate a state change. See {@link TransactionEvents} for event argument information. - * @alpha + * @internal */ export enum TransactionEvent { /** @@ -28,7 +28,7 @@ export enum TransactionEvent { /** * Events which may be emitted by `Transaction` - * @alpha + * @internal */ export interface TransactionEvents extends IErrorEvent { (event: TransactionEvent.ViewChange, listener: (before: TreeView, after: TreeView) => void); @@ -37,7 +37,7 @@ export interface TransactionEvents extends IErrorEvent { /** * Buffers changes to be applied to an isolated view of a `SharedTree` over time before applying them directly to the tree itself as a * single edit - * @alpha + * @internal */ export class Transaction extends TypedEventEmitter { /** The view of the tree when this transaction was created */ diff --git a/experimental/dds/tree/src/TransactionInternal.ts b/experimental/dds/tree/src/TransactionInternal.ts index ddc8c95511fe..ce2f12914f3a 100644 --- a/experimental/dds/tree/src/TransactionInternal.ts +++ b/experimental/dds/tree/src/TransactionInternal.ts @@ -44,7 +44,7 @@ export type EditingResult = FailedEditingResult | ValidEditingResult; /** * Basic result of applying a transaction. - * @alpha + * @internal */ export interface EditingResultBase { /** @@ -92,7 +92,7 @@ export interface FailedEditingResult extends EditingResultBase { /** * Result of applying a valid transaction. - * @alpha + * @internal */ export interface ValidEditingResult extends EditingResultBase { /** @@ -119,7 +119,7 @@ export type TransactionState = SucceedingTransactionState | FailingTransactionSt /** * The state of a transaction that has not encountered an error. - * @alpha + * @internal */ export interface SucceedingTransactionState { /** @@ -431,7 +431,7 @@ export interface GenericTransactionPolicy { * * No data outside the Transaction is modified by Transaction: * the results from `close` must be used to actually submit an `Edit`. - * @alpha + * @internal */ // eslint-disable-next-line @typescript-eslint/no-namespace export namespace TransactionInternal { @@ -835,7 +835,7 @@ export namespace TransactionInternal { /** * The kinds of failures that a transaction might encounter. - * @alpha + * @internal */ export enum FailureKind { /** @@ -878,7 +878,7 @@ export namespace TransactionInternal { /** * A failure encountered by a transaction. - * @alpha + * @internal */ export type Failure = | UnusedDetachedSequenceFailure @@ -893,7 +893,7 @@ export namespace TransactionInternal { /** * Error returned when a transaction is closed while there is an unused detached sequence. - * @alpha + * @internal */ export interface UnusedDetachedSequenceFailure { /** @@ -908,7 +908,7 @@ export namespace TransactionInternal { /** * Error thrown when a transaction encounters a build operation using an already in use DetachedSequenceID. - * @alpha + * @internal */ export interface DetachedSequenceIdAlreadyInUseFailure { /** @@ -927,7 +927,7 @@ export namespace TransactionInternal { /** * Error thrown when a transaction tries to operate on an unknown DetachedSequenceID - * @alpha + * @internal */ export interface DetachedSequenceNotFoundFailure { /** @@ -946,7 +946,7 @@ export namespace TransactionInternal { /** * Error thrown when a build uses a duplicated NodeId - * @alpha + * @internal */ export interface DuplicateIdInBuildFailure { /** @@ -965,7 +965,7 @@ export namespace TransactionInternal { /** * Error thrown when a build node ID is already used in the current state - * @alpha + * @internal */ export interface IdAlreadyInUseFailure { /** @@ -984,7 +984,7 @@ export namespace TransactionInternal { /** * Error thrown when a change is attempted on an unknown NodeId - * @alpha + * @internal */ export interface UnknownIdFailure { /** @@ -1003,7 +1003,7 @@ export namespace TransactionInternal { /** * Error thrown when an insert change uses an invalid Place - * @alpha + * @internal */ export interface BadPlaceFailure { /** @@ -1026,7 +1026,7 @@ export namespace TransactionInternal { /** * Error thrown when a detach operation is given an invalid or malformed Range - * @alpha + * @internal */ export interface BadRangeFailure { /** @@ -1049,7 +1049,7 @@ export namespace TransactionInternal { /** * Error thrown when a constraint fails to apply - * @alpha + * @internal */ export interface ConstraintViolationFailure { /** @@ -1068,7 +1068,7 @@ export namespace TransactionInternal { /** * The details of what kind of constraint was violated and caused a ConstraintViolationFailure error to occur - * @alpha + * @internal */ export type ConstraintViolationResult = | { @@ -1090,7 +1090,7 @@ export namespace TransactionInternal { /** * Enum of possible kinds of constraint violations that can be encountered - * @alpha + * @internal */ export enum ConstraintViolationKind { /** diff --git a/experimental/dds/tree/src/TreeView.ts b/experimental/dds/tree/src/TreeView.ts index 09ea5355b21b..ce36d1c6991c 100644 --- a/experimental/dds/tree/src/TreeView.ts +++ b/experimental/dds/tree/src/TreeView.ts @@ -12,7 +12,7 @@ import { NodeData, Side } from './persisted-types/index.js'; /** * Specifies the location of a trait (a labeled sequence of nodes) within the tree. - * @alpha + * @internal */ export interface TraitLocation { readonly parent: NodeId; @@ -21,7 +21,7 @@ export interface TraitLocation { /** * An immutable view of a distributed tree node. - * @alpha + * @internal */ export interface TreeViewNode extends NodeData { /** The IDs of the children under this node */ @@ -35,7 +35,7 @@ export interface TreeViewNode extends NodeData { * 0 = before all nodes, * 1 = after first node, * etc. - * @alpha + * @internal */ export type PlaceIndex = number & { readonly PlaceIndex: unique symbol }; @@ -44,14 +44,14 @@ export type PlaceIndex = number & { readonly PlaceIndex: unique symbol }; * 0 = first node, * 1 = second node, * etc. - * @alpha + * @internal */ export type TraitNodeIndex = number & { readonly TraitNodeIndex: unique symbol }; /** * 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. * Valid iff 'trait' is valid and, if provided, sibling is in the Location specified by 'trait'. - * @alpha + * @internal */ export interface TreeViewPlace { readonly sibling?: NodeId; @@ -62,7 +62,7 @@ export interface TreeViewPlace { /** * Specifies the range of nodes from `start` to `end` within a trait within a particular `TreeView`. * Valid iff start and end are valid and are within the same trait. - * @alpha + * @internal */ export interface TreeViewRange { readonly start: TreeViewPlace; @@ -80,7 +80,7 @@ export interface NodeInTrait { /** * A view of a distributed tree. - * @alpha + * @internal */ export abstract class TreeView { public readonly root: NodeId; diff --git a/experimental/dds/tree/src/UndoRedoHandler.ts b/experimental/dds/tree/src/UndoRedoHandler.ts index aa18182f1d0a..656c0fca704f 100644 --- a/experimental/dds/tree/src/UndoRedoHandler.ts +++ b/experimental/dds/tree/src/UndoRedoHandler.ts @@ -14,7 +14,7 @@ import { EditCommittedEventArguments, SharedTree } from './SharedTree.js'; /** * A revertible change * - * @alpha + * @internal */ export interface IRevertible { /** @@ -34,7 +34,7 @@ export interface IRevertible { * This interface is typically implemented by a stack which may optionally aggregate multiple * changes into one operation. * - * @alpha + * @internal */ export interface IUndoConsumer { /** @@ -47,7 +47,7 @@ export interface IUndoConsumer { * A shared tree undo redo handler that will add revertible local tree changes to the provided * undo redo stack manager * - * @alpha + * @internal */ export class SharedTreeUndoRedoHandler { constructor(private readonly stackManager: IUndoConsumer) {} diff --git a/experimental/dds/tree/src/persisted-types/0.0.2.ts b/experimental/dds/tree/src/persisted-types/0.0.2.ts index 66a72f661a40..d8f601ee151a 100644 --- a/experimental/dds/tree/src/persisted-types/0.0.2.ts +++ b/experimental/dds/tree/src/persisted-types/0.0.2.ts @@ -30,7 +30,7 @@ import type { * Each place can be specified, (aka 'anchored') in two ways (relative to the sibling before or after): * the choice of which way to anchor a place only matters when the kept across an edit, and thus evaluated in multiple contexts where the * two place description may no longer evaluate to the same place. - * @alpha + * @internal */ export enum Side { Before = 0, @@ -40,7 +40,7 @@ export enum Side { /** * A collection of changes to the tree that are applied atomically along with a unique identifier for the edit. * If any individual change fails to apply, the entire Edit will fail to apply. - * @alpha + * @internal */ export interface Edit extends EditBase { /** @@ -64,7 +64,7 @@ export interface EditWithoutId extends EditBase { /** * The information included in an edit. - * @alpha + * @internal */ export interface EditBase { /** @@ -91,7 +91,7 @@ export interface EditBase { * See {@link comparePayloads} for equality semantics and related details (like what is allowed to be lost when serializing) * * TODO:#51984: Allow opting into heuristic blobbing in snapshots with a special IFluid key. - * @alpha + * @internal */ export type Payload = any; @@ -99,7 +99,7 @@ export type Payload = any; * Json compatible map as object. * Keys are TraitLabels, * Values are the content of the trait specified by the key. - * @alpha + * @internal */ export interface TraitMap { readonly [key: string]: TreeNodeSequence; @@ -107,13 +107,13 @@ export interface TraitMap { /** * A sequence of Nodes that make up a trait under a Node - * @alpha + * @internal */ export type TreeNodeSequence = readonly TChild[]; /** * An object which may have traits with children of the given type underneath it - * @alpha + * @internal */ export interface HasTraits { readonly traits: TraitMap; @@ -121,7 +121,7 @@ export interface HasTraits { /** * The fields required by a node in a tree - * @alpha + * @internal */ export interface NodeData { /** @@ -143,7 +143,7 @@ export interface NodeData { /** * Satisfies `NodeData` and may contain children under traits (which may or may not be `TreeNodes`) - * @alpha + * @internal */ export interface TreeNode extends NodeData, HasTraits {} @@ -155,7 +155,7 @@ export type PlaceholderTree = TreeNode; /** * The status code of an attempt to apply the changes in an Edit. - * @alpha + * @internal */ export enum EditStatus { /** @@ -245,7 +245,7 @@ export interface SharedTreeEditOp_0_0_2 extends VersionedOp /** * Format versions that SharedTree supports writing. Changes to op or summary formats necessitate updates. - * @alpha + * @internal */ export enum WriteFormat { /** Stores all edits in their raw format. */ @@ -256,7 +256,7 @@ export enum WriteFormat { /** * The minimal information on a SharedTree summary. Contains the summary format version. - * @alpha + * @internal */ export interface SharedTreeSummaryBase { /** @@ -282,7 +282,7 @@ export interface SharedTreeSummary_0_0_2 extends SharedTreeSummaryBase { /** * {@inheritdoc ChangeType} - * @alpha + * @internal */ export enum ChangeTypeInternal { Insert, @@ -306,13 +306,13 @@ export type ChangeInternal_0_0_2 = /** * {@inheritdoc BuildNode} - * @alpha + * @internal */ export type BuildNodeInternal_0_0_2 = TreeNode | DetachedSequenceId; /** * {@inheritdoc Build} - * @alpha + * @internal */ export interface BuildInternal_0_0_2 { /** {@inheritdoc Build.destination } */ @@ -325,7 +325,7 @@ export interface BuildInternal_0_0_2 { /** * {@inheritdoc (Insert:interface)} - * @alpha + * @internal */ export interface InsertInternal_0_0_2 { /** {@inheritdoc (Insert:interface).destination } */ @@ -338,7 +338,7 @@ export interface InsertInternal_0_0_2 { /** * {@inheritdoc Detach} - * @alpha + * @internal */ export interface DetachInternal_0_0_2 { /** {@inheritdoc Detach.destination } */ @@ -351,7 +351,7 @@ export interface DetachInternal_0_0_2 { /** * {@inheritdoc SetValue} - * @alpha + * @internal */ export interface SetValueInternal_0_0_2 { /** {@inheritdoc SetValue.nodeToModify } */ @@ -365,7 +365,7 @@ export interface SetValueInternal_0_0_2 { /** * What to do when a Constraint is violated. - * @alpha + * @internal */ export enum ConstraintEffect { /** @@ -388,7 +388,7 @@ export enum ConstraintEffect { /** * {@inheritdoc Constraint} - * @alpha + * @internal */ export interface ConstraintInternal_0_0_2 { /** {@inheritdoc Constraint.toConstrain } */ @@ -411,7 +411,7 @@ export interface ConstraintInternal_0_0_2 { /** * {@inheritdoc (StablePlace:interface) } - * @alpha + * @internal */ export interface StablePlaceInternal_0_0_2 { /** @@ -432,7 +432,7 @@ export interface StablePlaceInternal_0_0_2 { /** * {@inheritdoc (StableRange:interface) } - * @alpha + * @internal */ export interface StableRangeInternal_0_0_2 { /** {@inheritdoc (StableRange:interface).start } */ diff --git a/experimental/dds/tree/src/persisted-types/0.1.1.ts b/experimental/dds/tree/src/persisted-types/0.1.1.ts index 5203839fe040..22f0ea9df059 100644 --- a/experimental/dds/tree/src/persisted-types/0.1.1.ts +++ b/experimental/dds/tree/src/persisted-types/0.1.1.ts @@ -52,7 +52,7 @@ import { /** * Specifies the location of a trait (a labeled sequence of nodes) within the tree. - * @alpha + * @internal */ export interface TraitLocationInternal extends Omit { readonly parent: NodeId; @@ -208,7 +208,7 @@ export type CompressedBuildNode = CompressedPlacehold * This type should be used as an opaque handle in the public API for `ChangeInternal` objects. * This is useful for supporting public APIs which involve working with a tree's edit history, * which will involve changes that have already been internalized. - * @alpha + * @internal */ export interface InternalizedChange { InternalChangeBrand: '2cae1045-61cf-4ef7-a6a3-8ad920cb7ab3'; @@ -216,19 +216,19 @@ export interface InternalizedChange { /** * {@inheritdoc (Change:type)} - * @alpha + * @internal */ export type ChangeInternal = InsertInternal | DetachInternal | BuildInternal | SetValueInternal | ConstraintInternal; /** * {@inheritdoc BuildNode} - * @alpha + * @internal */ export type BuildNodeInternal = TreeNode | DetachedSequenceId; /** * {@inheritdoc Build} - * @alpha + * @internal */ export interface BuildInternal extends Omit { readonly source: TreeNodeSequence; @@ -236,7 +236,7 @@ export interface BuildInternal extends Omit { /** * {@inheritdoc (Insert:interface)} - * @alpha + * @internal */ export interface InsertInternal extends Omit { /** {@inheritdoc (Insert:interface).destination } */ @@ -245,7 +245,7 @@ export interface InsertInternal extends Omit { /** {@inheritdoc Detach.source } */ @@ -254,7 +254,7 @@ export interface DetachInternal extends Omit { /** * {@inheritdoc SetValue} - * @alpha + * @internal */ export interface SetValueInternal extends Omit { /** {@inheritdoc SetValue.nodeToModify } */ @@ -263,7 +263,7 @@ export interface SetValueInternal extends Omit { /** {@inheritdoc Constraint.toConstrain } */ @@ -274,7 +274,7 @@ export interface ConstraintInternal extends Omit, destination: DetachedSequenceId): BuildInternal => ({ @@ -345,7 +345,7 @@ export const ChangeInternal = { /** * {@inheritdoc (StablePlace:interface) } - * @alpha + * @internal */ export interface StablePlaceInternal extends Omit { /** @@ -361,7 +361,7 @@ export interface StablePlaceInternal extends Omit { [counterId, SharedCounter.getFactory()], [directoryId, SharedDirectory.getFactory()], [treeId, SharedTree.getFactory()], - [arrayId, SharedArray.getFactory()], + [arrayId, (SharedArray as unknown as ISharedObjectKind).getFactory()], [signalId, SharedSignal.getFactory()], ]; From 21db2b9757a9d470c516d5c40438f6267ac9e2ca Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Wed, 11 Feb 2026 16:03:15 -0800 Subject: [PATCH 12/12] fix: collapse multi-line import to satisfy biome formatting --- .../end-to-end-tests/azure-client/src/test/TestDataObject.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/service-clients/end-to-end-tests/azure-client/src/test/TestDataObject.ts b/packages/service-clients/end-to-end-tests/azure-client/src/test/TestDataObject.ts index a9516267b475..93c86ded19ce 100644 --- a/packages/service-clients/end-to-end-tests/azure-client/src/test/TestDataObject.ts +++ b/packages/service-clients/end-to-end-tests/azure-client/src/test/TestDataObject.ts @@ -7,10 +7,7 @@ import type { SignalListener } from "@fluid-experimental/data-objects"; import { EventEmitter } from "@fluid-internal/client-utils"; // eslint-disable-next-line import-x/no-internal-modules -- TODO consider a test exposure to avoid /internal import { createDataObjectKind, DataObjectFactory } from "@fluidframework/aqueduct/internal"; -import { - DataObject, - type IDataObjectProps, -} from "@fluidframework/aqueduct/legacy"; +import { DataObject, type IDataObjectProps } from "@fluidframework/aqueduct/legacy"; import type { IErrorEvent, IFluidHandle } from "@fluidframework/core-interfaces"; import { SharedCounter } from "@fluidframework/counter/legacy"; import type { Jsonable } from "@fluidframework/datastore-definitions/legacy";