RuntimeDefinitions: Add and use asAlpha#25509
Merged
anthony-murphy merged 1 commit intomicrosoft:mainfrom Sep 22, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a new utility function asAlpha to safely cast IContainerRuntimeBase to ContainerRuntimeBaseAlpha, standardizing how alpha functionality is accessed throughout the codebase. The change replaces direct type assertions with a centralized function, improving type safety and code clarity.
Key changes:
- Added
asAlphautility function in runtime-definitions package - Updated multiple test files to use the new function instead of direct type casting
- Exported the function through the public API for broader usage
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime/runtime-definitions/src/stagingMode.ts | Added the new asAlpha utility function |
| packages/runtime/runtime-definitions/src/index.ts | Exported the new function in the public API |
| packages/runtime/runtime-definitions/api-report/runtime-definitions.legacy.alpha.api.md | Updated API report to reflect the new export |
| packages/test/test-end-to-end-tests/src/test/stagingMode.spec.ts | Replaced direct type assertion with asAlpha function |
| packages/test/local-server-tests/src/test/stagingMode.spec.ts | Updated to use asAlpha instead of direct casting |
| packages/test/local-server-tests/src/test/documentDirty.spec.ts | Simplified casting logic using the new utility function |
| packages/test/local-server-stress-tests/src/stressDataObject.ts | Replaced manual type assertion with asAlpha |
noencke
approved these changes
Sep 22, 2025
Contributor
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
noencke
added a commit
that referenced
this pull request
Sep 23, 2025
This will allow future APIs that follow the same pattern to share the same common `asAlpha` API. This also aligns the tree API with the [recently introduced container-runtime API](#25509).
anthony-murphy-agent
pushed a commit
to anthony-murphy-agent/FluidFramework
that referenced
this pull request
Jan 14, 2026
This pull request introduces a new utility function, `asAlpha`, to safely cast `IContainerRuntimeBase` to `ContainerRuntimeBaseAlpha` and exposes it throughout the codebase. This change simplifies and standardizes how alpha functionality is accessed in both production and test code, replacing direct type assertions with the new function. Several test files are updated to use `asAlpha`, improving type safety and clarity.
anthony-murphy-agent
pushed a commit
to anthony-murphy-agent/FluidFramework
that referenced
this pull request
Jan 14, 2026
This will allow future APIs that follow the same pattern to share the same common `asAlpha` API. This also aligns the tree API with the [recently introduced container-runtime API](microsoft#25509).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new utility function,
asAlpha, to safely castIContainerRuntimeBasetoContainerRuntimeBaseAlphaand exposes it throughout the codebase. This change simplifies and standardizes how alpha functionality is accessed in both production and test code, replacing direct type assertions with the new function. Several test files are updated to useasAlpha, improving type safety and clarity.