diff --git a/.changeset/sweet-tires-bathe.md b/.changeset/sweet-tires-bathe.md new file mode 100644 index 000000000000..7210f7abec35 --- /dev/null +++ b/.changeset/sweet-tires-bathe.md @@ -0,0 +1,10 @@ +--- +"@fluidframework/container-runtime": minor +--- +--- +"section": legacy +--- + +Removed SummarizerStopReason, ISummarizeEventProps, and ISummarizerEvents + +`SummarizerStopReason`, `ISummarizeEventProps`, and `ISummarizerEvents` have all been removed from the `"@fluidframework/container-runtime"` package. Please migrate all uses of these APIs to their respective copies in the `"@fluidframework/container-runtime-definitions"` package. diff --git a/packages/runtime/container-runtime/api-report/container-runtime.legacy.alpha.api.md b/packages/runtime/container-runtime/api-report/container-runtime.legacy.alpha.api.md index 8dd1ec9a80f9..e440a53cd5c1 100644 --- a/packages/runtime/container-runtime/api-report/container-runtime.legacy.alpha.api.md +++ b/packages/runtime/container-runtime/api-report/container-runtime.legacy.alpha.api.md @@ -140,7 +140,7 @@ export interface IBroadcastSummaryResult { // @alpha export interface ICancellableSummarizerController extends ISummaryCancellationToken { // (undocumented) - stop(reason: SummarizerStopReason_2): void; + stop(reason: SummarizerStopReason): void; } // @alpha @@ -389,33 +389,21 @@ export interface ISubmitSummaryOptions extends ISummarizeOptions { readonly summaryLogger: ITelemetryLoggerExt; } -// @alpha @deprecated (undocumented) -export interface ISummarizeEventProps { - // (undocumented) - currentAttempt: number; - // (undocumented) - error?: any; - // (undocumented) - maxAttempts: number; - // (undocumented) - result: "success" | "failure" | "canceled"; -} - // @alpha export interface ISummarizeOptions { readonly fullTree?: boolean; } // @alpha (undocumented) -export interface ISummarizer extends IEventProvider { +export interface ISummarizer extends IEventProvider { // (undocumented) close(): void; enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult; readonly ISummarizer?: ISummarizer; // (undocumented) - run(onBehalfOf: string): Promise; + run(onBehalfOf: string): Promise; // (undocumented) - stop(reason: SummarizerStopReason_2): void; + stop(reason: SummarizerStopReason): void; summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults; } @@ -426,12 +414,6 @@ export interface ISummarizeResults { readonly summarySubmitted: Promise>; } -// @alpha @deprecated (undocumented) -export interface ISummarizerEvents extends IEvent { - // (undocumented) - (event: "summarize", listener: (props: ISummarizeEventProps) => void): any; -} - // @alpha (undocumented) export interface ISummarizerInternalsProvider { refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise; @@ -483,7 +465,7 @@ export interface ISummaryBaseConfiguration { } // @alpha -export type ISummaryCancellationToken = ICancellationToken; +export type ISummaryCancellationToken = ICancellationToken; // @alpha (undocumented) export interface ISummaryCollectionOpEvents extends IEvent { @@ -601,7 +583,7 @@ export interface SubmitSummaryFailureData { export type SubmitSummaryResult = IBaseSummarizeResult | IGenerateSummaryTreeResult | IUploadSummaryResult | ISubmitSummaryOpResult; // @alpha -export class Summarizer extends TypedEventEmitter implements ISummarizer { +export class Summarizer extends TypedEventEmitter implements ISummarizer { constructor( runtime: ISummarizerRuntime, configurationGetter: () => ISummaryConfiguration, internalsProvider: ISummarizerInternalsProvider, handleContext: IFluidHandleContext, summaryCollection: SummaryCollection, runCoordinatorCreateFn: (runtime: IConnectableRuntime) => Promise); @@ -615,9 +597,9 @@ export class Summarizer extends TypedEventEmitter implement // (undocumented) recordSummaryAttempt?(summaryRefSeqNum?: number): void; // (undocumented) - run(onBehalfOf: string): Promise; - stop(reason: SummarizerStopReason_2): void; - static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason_2): boolean; + run(onBehalfOf: string): Promise; + stop(reason: SummarizerStopReason): void; + static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean; // (undocumented) summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults; // (undocumented) @@ -635,33 +617,6 @@ export type SummarizeResultPart = { error: IRetriableFailureError; }; -// @alpha @deprecated (undocumented) -export type SummarizerStopReason = -/** Summarizer client failed to summarize in all attempts. */ -"failToSummarize" -/** Parent client reported that it is no longer connected. */ -| "parentNotConnected" -/** -* Parent client reported that it is no longer elected the summarizer. -* This is the normal flow; a disconnect will always trigger the parent -* client to no longer be elected as responsible for summaries. Then it -* tries to stop its spawned summarizer client. -*/ -| "notElectedParent" -/** -* We are not already running the summarizer and we are not the current elected client id. -*/ -| "notElectedClient" -/** Summarizer client was disconnected */ -| "summarizerClientDisconnected" -/** running summarizer threw an exception */ -| "summarizerException" -/** -* The previous summary state on the summarizer is not the most recently acked summary. this also happens when the -* first submitSummary attempt fails for any reason and there's a 2nd summary attempt without an ack -*/ -| "latestSummaryStateStale"; - // @alpha export class SummaryCollection extends TypedEventEmitter { constructor(deltaManager: IDeltaManager, logger: ITelemetryLoggerExt); diff --git a/packages/runtime/container-runtime/package.json b/packages/runtime/container-runtime/package.json index 4b4b078f4b59..59308b47df30 100644 --- a/packages/runtime/container-runtime/package.json +++ b/packages/runtime/container-runtime/package.json @@ -230,6 +230,18 @@ }, "ClassStatics_ContainerRuntime": { "backCompat": false + }, + "TypeAlias_SummarizerStopReason": { + "backCompat": false, + "forwardCompat": false + }, + "Interface_ISummarizeEventProps": { + "backCompat": false, + "forwardCompat": false + }, + "Interface_ISummarizerEvents": { + "backCompat": false, + "forwardCompat": false } }, "entrypoint": "legacy" diff --git a/packages/runtime/container-runtime/src/index.ts b/packages/runtime/container-runtime/src/index.ts index c3e979d53a11..6cb1c022215b 100644 --- a/packages/runtime/container-runtime/src/index.ts +++ b/packages/runtime/container-runtime/src/index.ts @@ -55,7 +55,6 @@ export { ISummaryCancellationToken, neverCancelledSummaryToken, Summarizer, - SummarizerStopReason, SummaryCollection, EnqueueSummarizeResult, IAckSummaryResult, @@ -75,7 +74,6 @@ export { ISubmitSummaryOptions, ISerializedElection, ISummarizeOptions, - ISummarizerEvents, ISummarizerInternalsProvider, ISummarizerRuntime, ISummarizingWarning, @@ -95,7 +93,6 @@ export { SubmitSummaryFailureData, SummaryStage, IRetriableFailureError, - ISummarizeEventProps, IdCompressorMode, IDocumentSchema, DocumentSchemaValueType, diff --git a/packages/runtime/container-runtime/src/summary/index.ts b/packages/runtime/container-runtime/src/summary/index.ts index a7f77aed7039..4310aa13f131 100644 --- a/packages/runtime/container-runtime/src/summary/index.ts +++ b/packages/runtime/container-runtime/src/summary/index.ts @@ -44,12 +44,10 @@ export { ISummarizeHeuristicData, ISummarizer, ISummarizeResults, - ISummarizerEvents, ISummarizerInternalsProvider, ISummarizerRuntime, ISummaryCancellationToken, SubmitSummaryResult, - SummarizerStopReason, EnqueueSummarizeResult, IAckSummaryResult, IBaseSummarizeResult, @@ -67,7 +65,6 @@ export { SubmitSummaryFailureData, SummaryStage, IRetriableFailureError, - ISummarizeEventProps, } from "./summarizerTypes.js"; export { IAckedSummary, diff --git a/packages/runtime/container-runtime/src/summary/summarizerTypes.ts b/packages/runtime/container-runtime/src/summary/summarizerTypes.ts index 8a0d0f68cc54..a41755823461 100644 --- a/packages/runtime/container-runtime/src/summary/summarizerTypes.ts +++ b/packages/runtime/container-runtime/src/summary/summarizerTypes.ts @@ -8,11 +8,10 @@ import { ContainerWarning, } from "@fluidframework/container-definitions/internal"; import type { - ISummarizerEvents as NewISummarizerEvents, - SummarizerStopReason as NewSummarizerStopReason, + ISummarizerEvents, + SummarizerStopReason, } from "@fluidframework/container-runtime-definitions/internal"; import { - IEvent, IEventProvider, ITelemetryBaseProperties, ITelemetryBaseLogger, @@ -58,7 +57,7 @@ export interface ICancellationToken { * @legacy * @alpha */ -export type ISummaryCancellationToken = ICancellationToken; +export type ISummaryCancellationToken = ICancellationToken; /** * Data required to update internal tracking state after receiving a Summary Ack. @@ -401,60 +400,8 @@ export type EnqueueSummarizeResult = /** * @legacy * @alpha - * @deprecated Use SummarizerStopReason from the "\@fluidframework/container-runtime-definitions" package */ -export type SummarizerStopReason = - /** Summarizer client failed to summarize in all attempts. */ - | "failToSummarize" - /** Parent client reported that it is no longer connected. */ - | "parentNotConnected" - /** - * Parent client reported that it is no longer elected the summarizer. - * This is the normal flow; a disconnect will always trigger the parent - * client to no longer be elected as responsible for summaries. Then it - * tries to stop its spawned summarizer client. - */ - | "notElectedParent" - /** - * We are not already running the summarizer and we are not the current elected client id. - */ - | "notElectedClient" - /** Summarizer client was disconnected */ - | "summarizerClientDisconnected" - /** running summarizer threw an exception */ - | "summarizerException" - /** - * The previous summary state on the summarizer is not the most recently acked summary. this also happens when the - * first submitSummary attempt fails for any reason and there's a 2nd summary attempt without an ack - */ - | "latestSummaryStateStale"; - -/** - * @legacy - * @alpha - * @deprecated Use ISummarizeEventProps from the "\@fluidframework/container-runtime-definitions" package - */ -export interface ISummarizeEventProps { - result: "success" | "failure" | "canceled"; - currentAttempt: number; - maxAttempts: number; - error?: any; -} - -/** - * @legacy - * @alpha - * @deprecated Use ISummarizerEvents from the "\@fluidframework/container-runtime-definitions" package - */ -export interface ISummarizerEvents extends IEvent { - (event: "summarize", listener: (props: ISummarizeEventProps) => void); -} - -/** - * @legacy - * @alpha - */ -export interface ISummarizer extends IEventProvider { +export interface ISummarizer extends IEventProvider { /** * Allows {@link ISummarizer} to be used with our {@link @fluidframework/core-interfaces#FluidObject} pattern. */ @@ -465,12 +412,12 @@ export interface ISummarizer extends IEventProvider { * Summarizer will finish current processes, which may take a while. * For example, summarizer may complete last summary before exiting. */ - stop(reason: NewSummarizerStopReason): void; + stop(reason: SummarizerStopReason): void; /* Closes summarizer. Any pending processes (summary in flight) are abandoned. */ close(): void; - run(onBehalfOf: string): Promise; + run(onBehalfOf: string): Promise; /** * Attempts to generate a summary on demand. If already running, takes no action. diff --git a/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts b/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts index a9f4bad04ac1..a3ffb58f58cb 100644 --- a/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts +++ b/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts @@ -744,6 +744,7 @@ declare type current_as_old_for_Interface_ISubmitSummaryOptions = requireAssigna * typeValidation.broken: * "Interface_ISummarizeEventProps": {"forwardCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type old_as_current_for_Interface_ISummarizeEventProps = requireAssignableTo, TypeOnly> /* @@ -753,6 +754,7 @@ declare type old_as_current_for_Interface_ISummarizeEventProps = requireAssignab * typeValidation.broken: * "Interface_ISummarizeEventProps": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_ISummarizeEventProps = requireAssignableTo, TypeOnly> /* @@ -816,6 +818,7 @@ declare type current_as_old_for_Interface_ISummarizeResults = requireAssignableT * typeValidation.broken: * "Interface_ISummarizerEvents": {"forwardCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type old_as_current_for_Interface_ISummarizerEvents = requireAssignableTo, TypeOnly> /* @@ -825,6 +828,7 @@ declare type old_as_current_for_Interface_ISummarizerEvents = requireAssignableT * typeValidation.broken: * "Interface_ISummarizerEvents": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_ISummarizerEvents = requireAssignableTo, TypeOnly> /* @@ -1428,6 +1432,7 @@ declare type current_as_old_for_TypeAlias_SummarizeResultPart = requireAssignabl * typeValidation.broken: * "TypeAlias_SummarizerStopReason": {"forwardCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type old_as_current_for_TypeAlias_SummarizerStopReason = requireAssignableTo, TypeOnly> /* @@ -1437,6 +1442,7 @@ declare type old_as_current_for_TypeAlias_SummarizerStopReason = requireAssignab * typeValidation.broken: * "TypeAlias_SummarizerStopReason": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_TypeAlias_SummarizerStopReason = requireAssignableTo, TypeOnly> /*