Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split public and internal IFluidHandle APIs #20123

Merged
merged 91 commits into from
May 3, 2024

Conversation

CraigMacomber
Copy link
Contributor

@CraigMacomber CraigMacomber commented Mar 14, 2024

Description

Split IFluidHandle into two interfaces, IFluidHandle and IFluidHandleInternal.

Breaking Changes

Deprecated members of IFluidHandle are split off into new IFluidHandleInternal interface.

See included changeset for more details.

Reviewer Guidance

The review process is outlined on this wiki page.

@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: tree area: runtime Runtime related issues public api change Changes to a public API base: main PRs targeted against main branch labels Mar 14, 2024
@github-actions github-actions bot added the area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct label Mar 15, 2024
@github-actions github-actions bot added area: dds: sharedstring area: tests Tests to add, test infrastructure improvements, etc labels Mar 27, 2024
@anthony-murphy anthony-murphy self-assigned this Apr 29, 2024
@CraigMacomber CraigMacomber merged commit ed0bbe4 into microsoft:main May 3, 2024
30 checks passed
@CraigMacomber CraigMacomber deleted the brandMore branch May 3, 2024 20:00
Comment on lines +71 to +90
* @alpha
*/
export function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {
if (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {
if (enableBackwardsCompatibility && IFluidHandle in handle) {
return handle[IFluidHandle] as IFluidHandleInternal<T>;
}
throw new TypeError("Invalid IFluidHandle");
}

// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone
// implements their own IFluidHandle in terms of an existing handle, it won't break anything.
return handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;
}

/**
* Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.
* @alpha
*/
export function toFluidHandleErased<T>(handle: IFluidHandleInternal<T>): IFluidHandleErased<T> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't possible to make these internal (yet)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds: sharedstring area: dds: tree area: dds Issues related to distributed data structures area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch dependencies Pull requests that update a dependency file public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants