From fb6b3df01ad01ac8dffa5f36125d4cbff36c575c Mon Sep 17 00:00:00 2001 From: Taylor Williams <60717813+taylorsw04@users.noreply.github.com> Date: Wed, 3 Jan 2024 10:29:19 -0800 Subject: [PATCH] id-compressor: Remove deprecated compressor types from runtime definitions (#19031) This removes re-exported/deprecated compressor types from the runtime definitions public API. They were moved to the id-compressor package earlier. The removed APIs were technically public but are very unlikely to ever have been used. They were moved to a publicly available package in --- .changeset/small-cups-shine.md | 7 + experimental/dds/tree/package.json | 1 + .../tree/src/migration-shim/migrationShim.ts | 3 +- packages/dds/tree/api-report/tree.api.md | 4 +- packages/dds/tree/src/core/rebase/types.ts | 2 +- .../feature-libraries/flex-tree/lazyField.ts | 2 +- .../forest-summary/forestSummarizer.ts | 2 +- .../src/feature-libraries/node-key/nodeKey.ts | 2 +- .../dds/tree/src/shared-tree/treeCheckout.ts | 2 +- .../node-key/nodeKey.spec.ts | 2 +- .../edit-manager/editManagerCodecs.test.ts | 2 +- .../edit-manager/editManagerScenario.ts | 2 +- .../edit-manager/editManagerTestUtils.ts | 3 +- .../container-runtime/src/dataStoreContext.ts | 3 +- .../datastore/api-report/datastore.api.md | 2 +- packages/runtime/datastore/package.json | 1 + .../runtime/datastore/src/dataStoreRuntime.ts | 108 +++-------- .../api-report/runtime-definitions.api.md | 32 ---- .../runtime/runtime-definitions/package.json | 46 ++++- .../runtime/runtime-definitions/src/index.ts | 49 ----- ...ateRuntimeDefinitionsPrevious.generated.ts | 178 +++--------------- .../test/test-end-to-end-tests/package.json | 1 + .../src/test/idCompressor.spec.ts | 6 +- pnpm-lock.yaml | 6 + 24 files changed, 124 insertions(+), 342 deletions(-) create mode 100644 .changeset/small-cups-shine.md diff --git a/.changeset/small-cups-shine.md b/.changeset/small-cups-shine.md new file mode 100644 index 0000000000000..c5175826e83ba --- /dev/null +++ b/.changeset/small-cups-shine.md @@ -0,0 +1,7 @@ +--- +"@fluidframework/runtime-definitions": minor +--- + +Deprecated ID compressor related types have been removed. + +This change should be a no-op for consumers, as these types were almost certainly unused and are also available in the standalone package id-compressor (https://github.com/microsoft/FluidFramework/pull/18749). diff --git a/experimental/dds/tree/package.json b/experimental/dds/tree/package.json index d75c04c6ade51..7252f0b415857 100644 --- a/experimental/dds/tree/package.json +++ b/experimental/dds/tree/package.json @@ -46,6 +46,7 @@ "@fluidframework/core-interfaces": "workspace:~", "@fluidframework/core-utils": "workspace:~", "@fluidframework/datastore-definitions": "workspace:~", + "@fluidframework/id-compressor": "workspace:~", "@fluidframework/protocol-definitions": "^3.1.0-223007", "@fluidframework/runtime-definitions": "workspace:~", "@fluidframework/shared-object-base": "workspace:~", diff --git a/experimental/dds/tree/src/migration-shim/migrationShim.ts b/experimental/dds/tree/src/migration-shim/migrationShim.ts index e15f937e1d429..14685f1867243 100644 --- a/experimental/dds/tree/src/migration-shim/migrationShim.ts +++ b/experimental/dds/tree/src/migration-shim/migrationShim.ts @@ -15,14 +15,13 @@ import { type IGarbageCollectionData, type ITelemetryContext, type ISummaryTreeWithStats, - IIdCompressorCore, - SessionId, } from '@fluidframework/runtime-definitions'; import { type ITree } from '@fluidframework/tree'; import { assert } from '@fluidframework/core-utils'; import { MessageType, type ISequencedDocumentMessage } from '@fluidframework/protocol-definitions'; import { type EventEmitterEventType } from '@fluid-internal/client-utils'; import { DataProcessingError, EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils'; +import type { SessionId, IIdCompressorCore } from '@fluidframework/id-compressor'; import { type SharedTreeFactory as LegacySharedTreeFactory, type SharedTree as LegacySharedTree } from '../SharedTree'; import { type IShimChannelServices, NoDeltasChannelServices } from './shimChannelServices.js'; import { MigrationShimDeltaHandler } from './migrationDeltaHandler.js'; diff --git a/packages/dds/tree/api-report/tree.api.md b/packages/dds/tree/api-report/tree.api.md index a982708a90738..275b1f91d29c6 100644 --- a/packages/dds/tree/api-report/tree.api.md +++ b/packages/dds/tree/api-report/tree.api.md @@ -17,8 +17,8 @@ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions'; import { ISharedObject } from '@fluidframework/shared-object-base'; import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions'; import { ITelemetryContext } from '@fluidframework/runtime-definitions'; -import { SessionSpaceCompressedId } from '@fluidframework/runtime-definitions'; -import { StableId } from '@fluidframework/runtime-definitions'; +import { SessionSpaceCompressedId } from '@fluidframework/id-compressor'; +import { StableId } from '@fluidframework/id-compressor'; import type { Static } from '@sinclair/typebox'; import type { TSchema } from '@sinclair/typebox'; diff --git a/packages/dds/tree/src/core/rebase/types.ts b/packages/dds/tree/src/core/rebase/types.ts index 28e05e7def44c..709e81f1e92fe 100644 --- a/packages/dds/tree/src/core/rebase/types.ts +++ b/packages/dds/tree/src/core/rebase/types.ts @@ -8,7 +8,7 @@ import { OpSpaceCompressedId, SessionId, SessionSpaceCompressedId, -} from "@fluidframework/runtime-definitions"; +} from "@fluidframework/id-compressor"; import { Brand, NestedMap, diff --git a/packages/dds/tree/src/feature-libraries/flex-tree/lazyField.ts b/packages/dds/tree/src/feature-libraries/flex-tree/lazyField.ts index 6a1352a6f0b09..5ca80e5dbf309 100644 --- a/packages/dds/tree/src/feature-libraries/flex-tree/lazyField.ts +++ b/packages/dds/tree/src/feature-libraries/flex-tree/lazyField.ts @@ -4,7 +4,7 @@ */ import { assert } from "@fluidframework/core-utils"; -import { StableId } from "@fluidframework/runtime-definitions"; +import { StableId } from "@fluidframework/id-compressor"; import { FieldKey, TreeNavigationResult, diff --git a/packages/dds/tree/src/feature-libraries/forest-summary/forestSummarizer.ts b/packages/dds/tree/src/feature-libraries/forest-summary/forestSummarizer.ts index 39008f396cad7..e8de16a70c472 100644 --- a/packages/dds/tree/src/feature-libraries/forest-summary/forestSummarizer.ts +++ b/packages/dds/tree/src/feature-libraries/forest-summary/forestSummarizer.ts @@ -9,10 +9,10 @@ import { ITelemetryContext, ISummaryTreeWithStats, IGarbageCollectionData, - IIdCompressor, } from "@fluidframework/runtime-definitions"; import { createSingleBlobSummary } from "@fluidframework/shared-object-base"; import { assert } from "@fluidframework/core-utils"; +import { IIdCompressor } from "@fluidframework/id-compressor"; import { applyDelta, DeltaFieldChanges, diff --git a/packages/dds/tree/src/feature-libraries/node-key/nodeKey.ts b/packages/dds/tree/src/feature-libraries/node-key/nodeKey.ts index 66cb6677774cb..864f1d14373a4 100644 --- a/packages/dds/tree/src/feature-libraries/node-key/nodeKey.ts +++ b/packages/dds/tree/src/feature-libraries/node-key/nodeKey.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. */ -import { SessionSpaceCompressedId, StableId } from "@fluidframework/runtime-definitions"; +import { SessionSpaceCompressedId, StableId } from "@fluidframework/id-compressor"; import { Brand, Opaque, brand } from "../../util/index.js"; import { TreeNodeSchemaIdentifier } from "../../core/index.js"; diff --git a/packages/dds/tree/src/shared-tree/treeCheckout.ts b/packages/dds/tree/src/shared-tree/treeCheckout.ts index 6dbb3185d4485..ac81f6c157e33 100644 --- a/packages/dds/tree/src/shared-tree/treeCheckout.ts +++ b/packages/dds/tree/src/shared-tree/treeCheckout.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. */ import { assert } from "@fluidframework/core-utils"; -import { IIdCompressor } from "@fluidframework/runtime-definitions"; +import { IIdCompressor } from "@fluidframework/id-compressor"; import { AnchorLocator, IForestSubscription, diff --git a/packages/dds/tree/src/test/feature-libraries/node-key/nodeKey.spec.ts b/packages/dds/tree/src/test/feature-libraries/node-key/nodeKey.spec.ts index dc71b3e3790fe..bd9f5e0238d97 100644 --- a/packages/dds/tree/src/test/feature-libraries/node-key/nodeKey.spec.ts +++ b/packages/dds/tree/src/test/feature-libraries/node-key/nodeKey.spec.ts @@ -5,7 +5,7 @@ import { strict as assert, fail } from "assert"; import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions"; -import { IIdCompressor } from "@fluidframework/runtime-definitions"; +import { IIdCompressor } from "@fluidframework/id-compressor"; import { LocalNodeKey, StableNodeKey, diff --git a/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerCodecs.test.ts b/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerCodecs.test.ts index 78b1c436f772b..89eed7aabc1c6 100644 --- a/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerCodecs.test.ts +++ b/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerCodecs.test.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. */ -import { SessionId } from "@fluidframework/runtime-definitions"; +import { SessionId } from "@fluidframework/id-compressor"; import { makeCodecFamily, withDefaultBinaryEncoding } from "../../../codec/index.js"; import { typeboxValidator } from "../../../external-utilities/index.js"; import { TestChange } from "../../testChange.js"; diff --git a/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerScenario.ts b/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerScenario.ts index e63f3442b97fc..c001f77904342 100644 --- a/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerScenario.ts +++ b/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerScenario.ts @@ -5,7 +5,7 @@ import { fail, strict as assert } from "assert"; import { unreachableCase } from "@fluidframework/core-utils"; -import { SessionId } from "@fluidframework/runtime-definitions"; +import { SessionId } from "@fluidframework/id-compressor"; import { ChangeRebaser, ChangeFamilyEditor, emptyDelta } from "../../../core/index.js"; import { TestChangeFamily, TestChange, asDelta } from "../../testChange.js"; import { Commit, EditManager, SeqNumber } from "../../../shared-tree-core/index.js"; diff --git a/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerTestUtils.ts b/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerTestUtils.ts index 60c3c2220afde..5f8794b45e0e3 100644 --- a/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerTestUtils.ts +++ b/packages/dds/tree/src/test/shared-tree-core/edit-manager/editManagerTestUtils.ts @@ -3,8 +3,7 @@ * Licensed under the MIT License. */ -import { createIdCompressor } from "@fluidframework/id-compressor"; -import { SessionId } from "@fluidframework/runtime-definitions"; +import { createIdCompressor, SessionId } from "@fluidframework/id-compressor"; import { ChangeFamily, ChangeRebaser, diff --git a/packages/runtime/container-runtime/src/dataStoreContext.ts b/packages/runtime/container-runtime/src/dataStoreContext.ts index e7fa961e2294e..2b497f8fcfe42 100644 --- a/packages/runtime/container-runtime/src/dataStoreContext.ts +++ b/packages/runtime/container-runtime/src/dataStoreContext.ts @@ -49,8 +49,6 @@ import { ISummarizerNodeWithGC, SummarizeInternalFn, ITelemetryContext, - IIdCompressor, - IIdCompressorCore, VisibilityState, ISummaryTreeWithStats, } from "@fluidframework/runtime-definitions"; @@ -67,6 +65,7 @@ import { tagCodeArtifacts, ThresholdCounter, } from "@fluidframework/telemetry-utils"; +import { IIdCompressor, IIdCompressorCore } from "@fluidframework/id-compressor"; import { dataStoreAttributesBlobName, hasIsolatedChannels, diff --git a/packages/runtime/datastore/api-report/datastore.api.md b/packages/runtime/datastore/api-report/datastore.api.md index f0196d55bae01..d8ace36e996ec 100644 --- a/packages/runtime/datastore/api-report/datastore.api.md +++ b/packages/runtime/datastore/api-report/datastore.api.md @@ -19,7 +19,7 @@ import { IFluidDataStoreRuntimeEvents } from '@fluidframework/datastore-definiti import { IFluidHandle } from '@fluidframework/core-interfaces'; import { IFluidHandleContext } from '@fluidframework/core-interfaces'; import { IGarbageCollectionData } from '@fluidframework/runtime-definitions'; -import { IIdCompressor } from '@fluidframework/runtime-definitions'; +import { IIdCompressor } from '@fluidframework/id-compressor'; import { IInboundSignalMessage } from '@fluidframework/runtime-definitions'; import { ILoaderOptions } from '@fluidframework/container-definitions'; import { IQuorumClients } from '@fluidframework/protocol-definitions'; diff --git a/packages/runtime/datastore/package.json b/packages/runtime/datastore/package.json index 08f40c7ee1a19..8e03dacdd5095 100644 --- a/packages/runtime/datastore/package.json +++ b/packages/runtime/datastore/package.json @@ -124,6 +124,7 @@ "@fluidframework/datastore-definitions": "workspace:~", "@fluidframework/driver-definitions": "workspace:~", "@fluidframework/driver-utils": "workspace:~", + "@fluidframework/id-compressor": "workspace:~", "@fluidframework/protocol-definitions": "^3.1.0-223007", "@fluidframework/runtime-definitions": "workspace:~", "@fluidframework/runtime-utils": "workspace:~", diff --git a/packages/runtime/datastore/src/dataStoreRuntime.ts b/packages/runtime/datastore/src/dataStoreRuntime.ts index 3a786dd4cdb81..3824f25a41d64 100644 --- a/packages/runtime/datastore/src/dataStoreRuntime.ts +++ b/packages/runtime/datastore/src/dataStoreRuntime.ts @@ -51,8 +51,6 @@ import { ISummaryTreeWithStats, VisibilityState, ITelemetryContext, - IIdCompressor, - gcDataBlobKey, } from "@fluidframework/runtime-definitions"; import { convertSnapshotTreeToSummaryTree, @@ -65,8 +63,6 @@ import { exceptionToResponse, GCDataBuilder, unpackChildNodesUsedRoutes, - addBlobToSummary, - processAttachMessageGCData, } from "@fluidframework/runtime-utils"; import { IChannel, @@ -75,6 +71,7 @@ import { IChannelFactory, } from "@fluidframework/datastore-definitions"; import { v4 as uuid } from "uuid"; +import { IIdCompressor } from "@fluidframework/id-compressor"; import { IChannelContext, summarizeChannel } from "./channelContext"; import { LocalChannelContext, @@ -485,7 +482,7 @@ export class FluidDataStoreRuntime this.notBoundedChannelContextSet.delete(channel.id); // If our data store is attached, then attach the channel. if (this.isAttached) { - this.makeChannelLocallyVisible(channel); + this.attachChannel(channel); return; } @@ -613,13 +610,6 @@ export class FluidDataStoreRuntime const attachMessage = message.contents as IAttachMessage; const id = attachMessage.id; - // We need to process the GC Data for both local and remote attach messages - processAttachMessageGCData(attachMessage.snapshot, (nodeId, toPath) => { - // Note: nodeId will be "/" unless and until we support sub-DDS GC Nodes - const fromPath = `/${this.id}/${id}${nodeId === "/" ? "" : nodeId}`; - this.dataStoreContext.addedGCOutboundRoute?.(fromPath, toPath); - }); - // If a non-local operation then go and create the object // Otherwise mark it as officially attached. if (local) { @@ -822,64 +812,6 @@ export class FluidDataStoreRuntime } public getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats { - const summaryBuilder = new SummaryTreeBuilder(); - this.visitLocalBoundContextsDuringAttach( - (contextId: string, context: LocalChannelContextBase) => { - let summaryTree: ISummaryTreeWithStats; - if (context.isLoaded) { - const contextSummary = context.getAttachSummary(telemetryContext); - assert( - contextSummary.summary.type === SummaryType.Tree, - 0x180 /* "getAttachSummary should always return a tree" */, - ); - - summaryTree = { stats: contextSummary.stats, summary: contextSummary.summary }; - } else { - // If this channel is not yet loaded, then there should be no changes in the snapshot from which - // it was created as it is detached container. So just use the previous snapshot. - assert( - !!this.dataStoreContext.baseSnapshot, - 0x181 /* "BaseSnapshot should be there as detached container loaded from snapshot" */, - ); - summaryTree = convertSnapshotTreeToSummaryTree( - this.dataStoreContext.baseSnapshot.trees[contextId], - ); - } - summaryBuilder.addWithStats(contextId, summaryTree); - }, - ); - - return summaryBuilder.getSummaryTree(); - } - - /** - * Get the GC Data for the initial state being attached so remote clients can learn of this DataStore's outbound routes - */ - public getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData { - const gcDataBuilder = new GCDataBuilder(); - this.visitLocalBoundContextsDuringAttach( - (contextId: string, context: LocalChannelContextBase) => { - if (context.isLoaded) { - const contextGCData = context.getAttachGCData(telemetryContext); - - // Incorporate the GC Data for this context - gcDataBuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes); - } - // else: Rehydrating detached container case. GC doesn't run until the container is attached, so nothing to do here. - }, - ); - this.updateGCNodes(gcDataBuilder); - - return gcDataBuilder.getGCData(); - } - - /** - * Helper method for preparing to attach this dataStore. - * Runs the callback for each bound context to incorporate its data however the caller specifies - */ - private visitLocalBoundContextsDuringAttach( - visitor: (contextId: string, context: LocalChannelContextBase) => void, - ): void { /** * back-compat 0.59.1000 - getAttachSummary() is called when making a data store globally visible (previously * attaching state). Ideally, attachGraph() should have already be called making it locally visible. However, @@ -900,15 +832,39 @@ export class FluidDataStoreRuntime // "The data store should be locally visible when generating attach summary", // ); + const summaryBuilder = new SummaryTreeBuilder(); + + // Craft the .attributes file for each shared object for (const [contextId, context] of this.contexts) { if (!(context instanceof LocalChannelContextBase)) { throw new LoggingError("Should only be called with local channel handles"); } if (!this.notBoundedChannelContextSet.has(contextId)) { - visitor(contextId, context); + let summaryTree: ISummaryTreeWithStats; + if (context.isLoaded) { + const contextSummary = context.getAttachSummary(telemetryContext); + assert( + contextSummary.summary.type === SummaryType.Tree, + 0x180 /* "getAttachSummary should always return a tree" */, + ); + summaryTree = { stats: contextSummary.stats, summary: contextSummary.summary }; + } else { + // If this channel is not yet loaded, then there should be no changes in the snapshot from which + // it was created as it is detached container. So just use the previous snapshot. + assert( + !!this.dataStoreContext.baseSnapshot, + 0x181 /* "BaseSnapshot should be there as detached container loaded from snapshot" */, + ); + summaryTree = convertSnapshotTreeToSummaryTree( + this.dataStoreContext.baseSnapshot.trees[contextId], + ); + } + summaryBuilder.addWithStats(contextId, summaryTree); } } + + return summaryBuilder.getSummaryTree(); } public submitMessage(type: DataStoreMessageType, content: any, localOpMetadata: unknown) { @@ -934,10 +890,9 @@ export class FluidDataStoreRuntime } /** - * Assuming this DataStore is already attached, this will make the given channel locally visible - * by submitting its attach op. + * Attach channel should only be called after the data store has been attached */ - private makeChannelLocallyVisible(channel: IChannel): void { + private attachChannel(channel: IChannel): void { this.verifyNotClosed(); // If this handle is already attached no need to attach again. if (channel.handle.isAttached) { @@ -957,11 +912,6 @@ export class FluidDataStoreRuntime true /* fullTree */, false /* trackState */, ); - - // We need to include the channel's GC Data so remote clients can learn of this channel's outbound routes - const gcData = channel.getGCData(/* fullGC: */ true); - addBlobToSummary(summarizeResult, gcDataBlobKey, JSON.stringify(gcData)); - // Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree. const snapshot = convertSummaryTreeToITree(summarizeResult.summary); diff --git a/packages/runtime/runtime-definitions/api-report/runtime-definitions.api.md b/packages/runtime/runtime-definitions/api-report/runtime-definitions.api.md index fa1b1b0b18c06..5411137883e87 100644 --- a/packages/runtime/runtime-definitions/api-report/runtime-definitions.api.md +++ b/packages/runtime/runtime-definitions/api-report/runtime-definitions.api.md @@ -8,8 +8,6 @@ import { AttachState } from '@fluidframework/container-definitions'; import { FluidObject } from '@fluidframework/core-interfaces'; import { IAudience } from '@fluidframework/container-definitions'; import { IClientDetails } from '@fluidframework/protocol-definitions'; -import { IdCompressor } from '@fluidframework/id-compressor'; -import { IdCreationRange } from '@fluidframework/id-compressor'; import { IDeltaManager } from '@fluidframework/container-definitions'; import { IDisposable } from '@fluidframework/core-interfaces'; import { IDocumentMessage } from '@fluidframework/protocol-definitions'; @@ -18,7 +16,6 @@ import { IEvent } from '@fluidframework/core-interfaces'; import { IEventProvider } from '@fluidframework/core-interfaces'; import { IFluidHandle } from '@fluidframework/core-interfaces'; import { IIdCompressor } from '@fluidframework/id-compressor'; -import { IIdCompressorCore } from '@fluidframework/id-compressor'; import { ILoaderOptions } from '@fluidframework/container-definitions'; import { IProvideFluidHandleContext } from '@fluidframework/core-interfaces'; import { IQuorumClients } from '@fluidframework/protocol-definitions'; @@ -31,13 +28,6 @@ import { ISummaryTree } from '@fluidframework/protocol-definitions'; import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces'; import { ITree } from '@fluidframework/protocol-definitions'; import type { IUser } from '@fluidframework/protocol-definitions'; -import { OpSpaceCompressedId } from '@fluidframework/id-compressor'; -import { SerializedIdCompressor } from '@fluidframework/id-compressor'; -import { SerializedIdCompressorWithNoSession } from '@fluidframework/id-compressor'; -import { SerializedIdCompressorWithOngoingSession } from '@fluidframework/id-compressor'; -import { SessionId } from '@fluidframework/id-compressor'; -import { SessionSpaceCompressedId } from '@fluidframework/id-compressor'; -import { StableId } from '@fluidframework/id-compressor'; import { SummaryTree } from '@fluidframework/protocol-definitions'; import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces'; @@ -164,10 +154,6 @@ export interface IDataStore { trySetAlias(alias: string): Promise; } -export { IdCompressor } - -export { IdCreationRange } - // @alpha export interface IEnvelope { address: string; @@ -301,10 +287,6 @@ export interface IGarbageCollectionDetailsBase { usedRoutes?: string[]; } -export { IIdCompressor } - -export { IIdCompressorCore } - // @public export interface IInboundSignalMessage extends ISignalMessage { // (undocumented) @@ -444,20 +426,6 @@ export interface OpAttributionKey { type: "op"; } -export { OpSpaceCompressedId } - -export { SerializedIdCompressor } - -export { SerializedIdCompressorWithNoSession } - -export { SerializedIdCompressorWithOngoingSession } - -export { SessionId } - -export { SessionSpaceCompressedId } - -export { StableId } - // @alpha (undocumented) export type SummarizeInternalFn = (fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext) => Promise; diff --git a/packages/runtime/runtime-definitions/package.json b/packages/runtime/runtime-definitions/package.json index 4c584d616d7c9..1b3b3f3af8cab 100644 --- a/packages/runtime/runtime-definitions/package.json +++ b/packages/runtime/runtime-definitions/package.json @@ -93,11 +93,49 @@ }, "typeValidation": { "broken": { - "InterfaceDeclaration_IIdCompressorCore": { - "forwardCompat": false + "RemovedInterfaceDeclaration_IIdCompressorCore": { + "forwardCompat": false, + "backCompat": false }, - "ClassDeclaration_IdCompressor": { - "forwardCompat": false + "RemovedClassDeclaration_IdCompressor": { + "forwardCompat": false, + "backCompat": false + }, + "RemovedInterfaceDeclaration_IIdCompressor": { + "forwardCompat": false, + "backCompat": false + }, + "RemovedInterfaceDeclaration_IdCreationRange": { + "forwardCompat": false, + "backCompat": false + }, + "RemovedTypeAliasDeclaration_OpSpaceCompressedId": { + "forwardCompat": false, + "backCompat": false + }, + "RemovedTypeAliasDeclaration_SerializedIdCompressor": { + "forwardCompat": false, + "backCompat": false + }, + "RemovedTypeAliasDeclaration_SerializedIdCompressorWithNoSession": { + "forwardCompat": false, + "backCompat": false + }, + "RemovedTypeAliasDeclaration_SerializedIdCompressorWithOngoingSession": { + "forwardCompat": false, + "backCompat": false + }, + "RemovedTypeAliasDeclaration_SessionId": { + "forwardCompat": false, + "backCompat": false + }, + "RemovedTypeAliasDeclaration_SessionSpaceCompressedId": { + "forwardCompat": false, + "backCompat": false + }, + "RemovedTypeAliasDeclaration_StableId": { + "forwardCompat": false, + "backCompat": false } } } diff --git a/packages/runtime/runtime-definitions/src/index.ts b/packages/runtime/runtime-definitions/src/index.ts index 1da6f533eda98..9f525e98bd09d 100644 --- a/packages/runtime/runtime-definitions/src/index.ts +++ b/packages/runtime/runtime-definitions/src/index.ts @@ -66,52 +66,3 @@ export { SummarizeInternalFn, totalBlobSizePropertyName, } from "./summary"; - -// Re-exports for backwards compatibility. -// Will be removed in the future. -export { - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - IdCompressor, - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - IIdCompressor, - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - IIdCompressorCore, - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - IdCreationRange, - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - OpSpaceCompressedId, - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - SerializedIdCompressor, - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - SerializedIdCompressorWithNoSession, - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - SerializedIdCompressorWithOngoingSession, - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - SessionId, - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - SessionSpaceCompressedId, - /** - * @deprecated Import from `@fluidframework/id-compressor` instead. - */ - StableId, -} from "@fluidframework/id-compressor"; diff --git a/packages/runtime/runtime-definitions/src/test/types/validateRuntimeDefinitionsPrevious.generated.ts b/packages/runtime/runtime-definitions/src/test/types/validateRuntimeDefinitionsPrevious.generated.ts index afdc679dfc297..ffa314adad25e 100644 --- a/packages/runtime/runtime-definitions/src/test/types/validateRuntimeDefinitionsPrevious.generated.ts +++ b/packages/runtime/runtime-definitions/src/test/types/validateRuntimeDefinitionsPrevious.generated.ts @@ -648,51 +648,26 @@ use_old_InterfaceDeclaration_IGarbageCollectionDetailsBase( /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "InterfaceDeclaration_IIdCompressor": {"forwardCompat": false} +* "RemovedInterfaceDeclaration_IIdCompressor": {"forwardCompat": false} */ -declare function get_old_InterfaceDeclaration_IIdCompressor(): - TypeOnly; -declare function use_current_InterfaceDeclaration_IIdCompressor( - use: TypeOnly): void; -use_current_InterfaceDeclaration_IIdCompressor( - get_old_InterfaceDeclaration_IIdCompressor()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "InterfaceDeclaration_IIdCompressor": {"backCompat": false} +* "RemovedInterfaceDeclaration_IIdCompressor": {"backCompat": false} */ -declare function get_current_InterfaceDeclaration_IIdCompressor(): - TypeOnly; -declare function use_old_InterfaceDeclaration_IIdCompressor( - use: TypeOnly): void; -use_old_InterfaceDeclaration_IIdCompressor( - get_current_InterfaceDeclaration_IIdCompressor()); /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "InterfaceDeclaration_IIdCompressorCore": {"forwardCompat": false} +* "RemovedInterfaceDeclaration_IIdCompressorCore": {"forwardCompat": false} */ -declare function get_old_InterfaceDeclaration_IIdCompressorCore(): - TypeOnly; -declare function use_current_InterfaceDeclaration_IIdCompressorCore( - use: TypeOnly): void; -use_current_InterfaceDeclaration_IIdCompressorCore( - // @ts-expect-error compatibility expected to be broken - get_old_InterfaceDeclaration_IIdCompressorCore()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "InterfaceDeclaration_IIdCompressorCore": {"backCompat": false} +* "RemovedInterfaceDeclaration_IIdCompressorCore": {"backCompat": false} */ -declare function get_current_InterfaceDeclaration_IIdCompressorCore(): - TypeOnly; -declare function use_old_InterfaceDeclaration_IIdCompressorCore( - use: TypeOnly): void; -use_old_InterfaceDeclaration_IIdCompressorCore( - get_current_InterfaceDeclaration_IIdCompressorCore()); /* * Validate forward compat by using old type in place of current type @@ -1009,51 +984,26 @@ use_old_InterfaceDeclaration_ITelemetryContext( /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "ClassDeclaration_IdCompressor": {"forwardCompat": false} +* "RemovedClassDeclaration_IdCompressor": {"forwardCompat": false} */ -declare function get_old_ClassDeclaration_IdCompressor(): - TypeOnly; -declare function use_current_ClassDeclaration_IdCompressor( - use: TypeOnly): void; -use_current_ClassDeclaration_IdCompressor( - // @ts-expect-error compatibility expected to be broken - get_old_ClassDeclaration_IdCompressor()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "ClassDeclaration_IdCompressor": {"backCompat": false} +* "RemovedClassDeclaration_IdCompressor": {"backCompat": false} */ -declare function get_current_ClassDeclaration_IdCompressor(): - TypeOnly; -declare function use_old_ClassDeclaration_IdCompressor( - use: TypeOnly): void; -use_old_ClassDeclaration_IdCompressor( - get_current_ClassDeclaration_IdCompressor()); /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "InterfaceDeclaration_IdCreationRange": {"forwardCompat": false} +* "RemovedInterfaceDeclaration_IdCreationRange": {"forwardCompat": false} */ -declare function get_old_InterfaceDeclaration_IdCreationRange(): - TypeOnly; -declare function use_current_InterfaceDeclaration_IdCreationRange( - use: TypeOnly): void; -use_current_InterfaceDeclaration_IdCreationRange( - get_old_InterfaceDeclaration_IdCreationRange()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "InterfaceDeclaration_IdCreationRange": {"backCompat": false} +* "RemovedInterfaceDeclaration_IdCreationRange": {"backCompat": false} */ -declare function get_current_InterfaceDeclaration_IdCreationRange(): - TypeOnly; -declare function use_old_InterfaceDeclaration_IdCreationRange( - use: TypeOnly): void; -use_old_InterfaceDeclaration_IdCreationRange( - get_current_InterfaceDeclaration_IdCreationRange()); /* * Validate forward compat by using old type in place of current type @@ -1178,170 +1128,86 @@ use_old_InterfaceDeclaration_OpAttributionKey( /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_OpSpaceCompressedId": {"forwardCompat": false} +* "RemovedTypeAliasDeclaration_OpSpaceCompressedId": {"forwardCompat": false} */ -declare function get_old_TypeAliasDeclaration_OpSpaceCompressedId(): - TypeOnly; -declare function use_current_TypeAliasDeclaration_OpSpaceCompressedId( - use: TypeOnly): void; -use_current_TypeAliasDeclaration_OpSpaceCompressedId( - get_old_TypeAliasDeclaration_OpSpaceCompressedId()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_OpSpaceCompressedId": {"backCompat": false} +* "RemovedTypeAliasDeclaration_OpSpaceCompressedId": {"backCompat": false} */ -declare function get_current_TypeAliasDeclaration_OpSpaceCompressedId(): - TypeOnly; -declare function use_old_TypeAliasDeclaration_OpSpaceCompressedId( - use: TypeOnly): void; -use_old_TypeAliasDeclaration_OpSpaceCompressedId( - get_current_TypeAliasDeclaration_OpSpaceCompressedId()); /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_SerializedIdCompressor": {"forwardCompat": false} +* "RemovedTypeAliasDeclaration_SerializedIdCompressor": {"forwardCompat": false} */ -declare function get_old_TypeAliasDeclaration_SerializedIdCompressor(): - TypeOnly; -declare function use_current_TypeAliasDeclaration_SerializedIdCompressor( - use: TypeOnly): void; -use_current_TypeAliasDeclaration_SerializedIdCompressor( - get_old_TypeAliasDeclaration_SerializedIdCompressor()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_SerializedIdCompressor": {"backCompat": false} +* "RemovedTypeAliasDeclaration_SerializedIdCompressor": {"backCompat": false} */ -declare function get_current_TypeAliasDeclaration_SerializedIdCompressor(): - TypeOnly; -declare function use_old_TypeAliasDeclaration_SerializedIdCompressor( - use: TypeOnly): void; -use_old_TypeAliasDeclaration_SerializedIdCompressor( - get_current_TypeAliasDeclaration_SerializedIdCompressor()); /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_SerializedIdCompressorWithNoSession": {"forwardCompat": false} +* "RemovedTypeAliasDeclaration_SerializedIdCompressorWithNoSession": {"forwardCompat": false} */ -declare function get_old_TypeAliasDeclaration_SerializedIdCompressorWithNoSession(): - TypeOnly; -declare function use_current_TypeAliasDeclaration_SerializedIdCompressorWithNoSession( - use: TypeOnly): void; -use_current_TypeAliasDeclaration_SerializedIdCompressorWithNoSession( - get_old_TypeAliasDeclaration_SerializedIdCompressorWithNoSession()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_SerializedIdCompressorWithNoSession": {"backCompat": false} +* "RemovedTypeAliasDeclaration_SerializedIdCompressorWithNoSession": {"backCompat": false} */ -declare function get_current_TypeAliasDeclaration_SerializedIdCompressorWithNoSession(): - TypeOnly; -declare function use_old_TypeAliasDeclaration_SerializedIdCompressorWithNoSession( - use: TypeOnly): void; -use_old_TypeAliasDeclaration_SerializedIdCompressorWithNoSession( - get_current_TypeAliasDeclaration_SerializedIdCompressorWithNoSession()); /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_SerializedIdCompressorWithOngoingSession": {"forwardCompat": false} +* "RemovedTypeAliasDeclaration_SerializedIdCompressorWithOngoingSession": {"forwardCompat": false} */ -declare function get_old_TypeAliasDeclaration_SerializedIdCompressorWithOngoingSession(): - TypeOnly; -declare function use_current_TypeAliasDeclaration_SerializedIdCompressorWithOngoingSession( - use: TypeOnly): void; -use_current_TypeAliasDeclaration_SerializedIdCompressorWithOngoingSession( - get_old_TypeAliasDeclaration_SerializedIdCompressorWithOngoingSession()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_SerializedIdCompressorWithOngoingSession": {"backCompat": false} +* "RemovedTypeAliasDeclaration_SerializedIdCompressorWithOngoingSession": {"backCompat": false} */ -declare function get_current_TypeAliasDeclaration_SerializedIdCompressorWithOngoingSession(): - TypeOnly; -declare function use_old_TypeAliasDeclaration_SerializedIdCompressorWithOngoingSession( - use: TypeOnly): void; -use_old_TypeAliasDeclaration_SerializedIdCompressorWithOngoingSession( - get_current_TypeAliasDeclaration_SerializedIdCompressorWithOngoingSession()); /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_SessionId": {"forwardCompat": false} +* "RemovedTypeAliasDeclaration_SessionId": {"forwardCompat": false} */ -declare function get_old_TypeAliasDeclaration_SessionId(): - TypeOnly; -declare function use_current_TypeAliasDeclaration_SessionId( - use: TypeOnly): void; -use_current_TypeAliasDeclaration_SessionId( - get_old_TypeAliasDeclaration_SessionId()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_SessionId": {"backCompat": false} +* "RemovedTypeAliasDeclaration_SessionId": {"backCompat": false} */ -declare function get_current_TypeAliasDeclaration_SessionId(): - TypeOnly; -declare function use_old_TypeAliasDeclaration_SessionId( - use: TypeOnly): void; -use_old_TypeAliasDeclaration_SessionId( - get_current_TypeAliasDeclaration_SessionId()); /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_SessionSpaceCompressedId": {"forwardCompat": false} +* "RemovedTypeAliasDeclaration_SessionSpaceCompressedId": {"forwardCompat": false} */ -declare function get_old_TypeAliasDeclaration_SessionSpaceCompressedId(): - TypeOnly; -declare function use_current_TypeAliasDeclaration_SessionSpaceCompressedId( - use: TypeOnly): void; -use_current_TypeAliasDeclaration_SessionSpaceCompressedId( - get_old_TypeAliasDeclaration_SessionSpaceCompressedId()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_SessionSpaceCompressedId": {"backCompat": false} +* "RemovedTypeAliasDeclaration_SessionSpaceCompressedId": {"backCompat": false} */ -declare function get_current_TypeAliasDeclaration_SessionSpaceCompressedId(): - TypeOnly; -declare function use_old_TypeAliasDeclaration_SessionSpaceCompressedId( - use: TypeOnly): void; -use_old_TypeAliasDeclaration_SessionSpaceCompressedId( - get_current_TypeAliasDeclaration_SessionSpaceCompressedId()); /* * Validate forward compat by using old type in place of current type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_StableId": {"forwardCompat": false} +* "RemovedTypeAliasDeclaration_StableId": {"forwardCompat": false} */ -declare function get_old_TypeAliasDeclaration_StableId(): - TypeOnly; -declare function use_current_TypeAliasDeclaration_StableId( - use: TypeOnly): void; -use_current_TypeAliasDeclaration_StableId( - get_old_TypeAliasDeclaration_StableId()); /* * Validate back compat by using current type in place of old type * If breaking change required, add in package.json under typeValidation.broken: -* "TypeAliasDeclaration_StableId": {"backCompat": false} +* "RemovedTypeAliasDeclaration_StableId": {"backCompat": false} */ -declare function get_current_TypeAliasDeclaration_StableId(): - TypeOnly; -declare function use_old_TypeAliasDeclaration_StableId( - use: TypeOnly): void; -use_old_TypeAliasDeclaration_StableId( - get_current_TypeAliasDeclaration_StableId()); /* * Validate forward compat by using old type in place of current type diff --git a/packages/test/test-end-to-end-tests/package.json b/packages/test/test-end-to-end-tests/package.json index d1088935f2c8d..77dbe377c1684 100644 --- a/packages/test/test-end-to-end-tests/package.json +++ b/packages/test/test-end-to-end-tests/package.json @@ -95,6 +95,7 @@ "@fluidframework/datastore-definitions": "workspace:~", "@fluidframework/driver-definitions": "workspace:~", "@fluidframework/driver-utils": "workspace:~", + "@fluidframework/id-compressor": "workspace:~", "@fluidframework/ink": "workspace:~", "@fluidframework/map": "workspace:~", "@fluidframework/matrix": "workspace:~", diff --git a/packages/test/test-end-to-end-tests/src/test/idCompressor.spec.ts b/packages/test/test-end-to-end-tests/src/test/idCompressor.spec.ts index a1d1c9ef41f85..f9a5777e79433 100644 --- a/packages/test/test-end-to-end-tests/src/test/idCompressor.spec.ts +++ b/packages/test/test-end-to-end-tests/src/test/idCompressor.spec.ts @@ -16,11 +16,7 @@ import { } from "@fluidframework/test-utils"; import { ITestDataObject, describeCompat } from "@fluid-private/test-version-utils"; import type { SharedCell } from "@fluidframework/cell"; -import { - IIdCompressor, - SessionSpaceCompressedId, - StableId, -} from "@fluidframework/runtime-definitions"; +import { IIdCompressor, SessionSpaceCompressedId, StableId } from "@fluidframework/id-compressor"; import type { SharedObjectCore } from "@fluidframework/shared-object-base"; import { IFluidHandle, IRequest } from "@fluidframework/core-interfaces"; import { ContainerRuntime, IContainerRuntimeOptions } from "@fluidframework/container-runtime"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d4264b0278536..cdc05ae5679a1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5617,6 +5617,7 @@ importers: '@fluidframework/core-utils': workspace:~ '@fluidframework/datastore-definitions': workspace:~ '@fluidframework/eslint-config-fluid': ^3.2.0 + '@fluidframework/id-compressor': workspace:~ '@fluidframework/mocha-test-setup': workspace:~ '@fluidframework/protocol-definitions': ^3.1.0-223007 '@fluidframework/runtime-definitions': workspace:~ @@ -5658,6 +5659,7 @@ importers: '@fluidframework/core-interfaces': link:../../../packages/common/core-interfaces '@fluidframework/core-utils': link:../../../packages/common/core-utils '@fluidframework/datastore-definitions': link:../../../packages/runtime/datastore-definitions + '@fluidframework/id-compressor': link:../../../packages/runtime/id-compressor '@fluidframework/protocol-definitions': 3.1.0-223007 '@fluidframework/runtime-definitions': link:../../../packages/runtime/runtime-definitions '@fluidframework/shared-object-base': link:../../../packages/dds/shared-object-base @@ -9326,6 +9328,7 @@ importers: '@fluidframework/driver-definitions': workspace:~ '@fluidframework/driver-utils': workspace:~ '@fluidframework/eslint-config-fluid': ^3.2.0 + '@fluidframework/id-compressor': workspace:~ '@fluidframework/mocha-test-setup': workspace:~ '@fluidframework/protocol-definitions': ^3.1.0-223007 '@fluidframework/runtime-definitions': workspace:~ @@ -9359,6 +9362,7 @@ importers: '@fluidframework/datastore-definitions': link:../datastore-definitions '@fluidframework/driver-definitions': link:../../common/driver-definitions '@fluidframework/driver-utils': link:../../loader/driver-utils + '@fluidframework/id-compressor': link:../id-compressor '@fluidframework/protocol-definitions': 3.1.0-223007 '@fluidframework/runtime-definitions': link:../runtime-definitions '@fluidframework/runtime-utils': link:../runtime-utils @@ -10370,6 +10374,7 @@ importers: '@fluidframework/driver-definitions': workspace:~ '@fluidframework/driver-utils': workspace:~ '@fluidframework/eslint-config-fluid': ^3.2.0 + '@fluidframework/id-compressor': workspace:~ '@fluidframework/ink': workspace:~ '@fluidframework/map': workspace:~ '@fluidframework/matrix': workspace:~ @@ -10435,6 +10440,7 @@ importers: '@fluidframework/datastore-definitions': link:../../runtime/datastore-definitions '@fluidframework/driver-definitions': link:../../common/driver-definitions '@fluidframework/driver-utils': link:../../loader/driver-utils + '@fluidframework/id-compressor': link:../../runtime/id-compressor '@fluidframework/ink': link:../../dds/ink '@fluidframework/map': link:../../dds/map '@fluidframework/matrix': link:../../dds/matrix