Skip to content

Commit bca3f41

Browse files
RuntimeDefinitions: Rename asAlpha to asLegacyAlpha (#25514)
This pull request updates the naming of the function used to cast a container runtime to its alpha interface, changing it from `asAlpha` to `asLegacyAlpha`. This change is applied throughout the codebase to improve clarity and consistency, especially in preparation for future API changes. All imports, exports, and usages of this function are updated accordingly in both runtime and test files.
1 parent 03b2415 commit bca3f41

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

packages/runtime/runtime-definitions/api-report/runtime-definitions.legacy.alpha.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
export type AliasResult = "Success" | "Conflict" | "AlreadyAliased";
99

1010
// @alpha @sealed @legacy
11-
export function asAlpha(base: IContainerRuntimeBase): ContainerRuntimeBaseAlpha;
11+
export function asLegacyAlpha(base: IContainerRuntimeBase): ContainerRuntimeBaseAlpha;
1212

1313
// @beta @legacy
1414
export interface AttributionInfo {

packages/runtime/runtime-definitions/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,5 @@ export {
8989
type CommitStagedChangesOptionsExperimental,
9090
type IContainerRuntimeBaseExperimental,
9191
type StageControlsExperimental,
92-
asAlpha,
92+
asLegacyAlpha,
9393
} from "./stagingMode.js";

packages/runtime/runtime-definitions/src/stagingMode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ export interface ContainerRuntimeBaseAlpha extends IContainerRuntimeBase {
122122
* @legacy @alpha
123123
* @sealed
124124
*/
125-
export function asAlpha(base: IContainerRuntimeBase): ContainerRuntimeBaseAlpha {
125+
export function asLegacyAlpha(base: IContainerRuntimeBase): ContainerRuntimeBaseAlpha {
126126
return base as ContainerRuntimeBaseAlpha;
127127
}

packages/test/local-server-stress-tests/src/stressDataObject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import type {
3232
import { modifyClusterSize } from "@fluidframework/id-compressor/internal/test-utils";
3333
import { ISharedMap, SharedMap } from "@fluidframework/map/internal";
3434
import {
35-
asAlpha,
35+
asLegacyAlpha,
3636
type StageControlsAlpha,
3737
} from "@fluidframework/runtime-definitions/internal";
3838
import { RuntimeHeaders, toFluidHandleInternal } from "@fluidframework/runtime-utils/internal";
@@ -304,7 +304,7 @@ export class DefaultStressDataObject extends StressDataObject {
304304
}
305305

306306
private stageControls: StageControlsAlpha | undefined;
307-
private readonly containerRuntimeExp = asAlpha(this.context.containerRuntime);
307+
private readonly containerRuntimeExp = asLegacyAlpha(this.context.containerRuntime);
308308
public enterStagingMode() {
309309
assert(
310310
this.containerRuntimeExp.enterStagingMode !== undefined,

packages/test/local-server-tests/src/test/documentDirty.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
LocalResolver,
1919
} from "@fluidframework/local-driver/internal";
2020
import { type ISharedMap, SharedMap } from "@fluidframework/map/internal";
21-
import { asAlpha } from "@fluidframework/runtime-definitions/internal";
21+
import { asLegacyAlpha } from "@fluidframework/runtime-definitions/internal";
2222
import {
2323
ILocalDeltaConnectionServer,
2424
LocalDeltaConnectionServer,
@@ -299,7 +299,7 @@ describe("Document Dirty", () => {
299299
// Submit a non-dirtyable op
300300
containerRuntime.submit(nonDirtyableOp);
301301

302-
const stageControls = asAlpha(containerRuntime).enterStagingMode();
302+
const stageControls = asLegacyAlpha(containerRuntime).enterStagingMode();
303303

304304
// Submit an op in staging mode - we will discard it later
305305
sharedMap.set("key", "value");

packages/test/local-server-tests/src/test/stagingMode.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
import type { SessionSpaceCompressedId } from "@fluidframework/id-compressor/internal";
3030
import { SharedMap } from "@fluidframework/map/internal";
3131
import {
32-
asAlpha,
32+
asLegacyAlpha,
3333
type StageControlsExperimental,
3434
} from "@fluidframework/runtime-definitions/internal";
3535
import {
@@ -58,7 +58,7 @@ class DataObjectWithStagingMode extends DataObject {
5858
? -1
5959
: DataObjectWithStagingMode.instanceCount++;
6060

61-
private readonly containerRuntimeExp = asAlpha(this.context.containerRuntime);
61+
private readonly containerRuntimeExp = asLegacyAlpha(this.context.containerRuntime);
6262
get DataObjectWithStagingMode() {
6363
return this;
6464
}

packages/test/test-end-to-end-tests/src/test/stagingMode.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { DataObjectFactory } from "@fluidframework/aqueduct/internal";
1010
import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal";
1111
import type { ISharedDirectory } from "@fluidframework/map/internal";
1212
import {
13-
asAlpha,
13+
asLegacyAlpha,
1414
type IFluidDataStoreChannel,
1515
type IFluidDataStoreContext,
1616
type IFluidDataStorePolicies,
@@ -74,7 +74,7 @@ describeCompat(
7474
const { _context, _runtime, _root } =
7575
await getContainerEntryPointBackCompat<ITestDataObject>(container);
7676

77-
const containerRuntime = asAlpha(_context.containerRuntime);
77+
const containerRuntime = asLegacyAlpha(_context.containerRuntime);
7878
return {
7979
container,
8080
containerRuntime,

0 commit comments

Comments
 (0)