Skip to content

improvement(client-core-interfaces): remove unused impls#26952

Open
jason-ha wants to merge 3 commits intomicrosoft:mainfrom
jason-ha:core-interfaces/erased-type-impl-cleanup
Open

improvement(client-core-interfaces): remove unused impls#26952
jason-ha wants to merge 3 commits intomicrosoft:mainfrom
jason-ha:core-interfaces/erased-type-impl-cleanup

Conversation

@jason-ha
Copy link
Copy Markdown
Contributor

@jason-ha jason-ha commented Apr 6, 2026

ErasedType is never to be instantiated nor checked for instanceof. Thus, don't need implementations. Remove those implementations.

`ErasedType` and `ErasedBaseType` are never to be instantiated nor checked for instanceof. Thus don't need implementations.
Remove those implementations.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make ErasedType / ErasedBaseType purely compile-time brands by removing their runtime implementations.

Changes:

  • Converted ErasedType and ErasedBaseType from emitted classes to declare classes.
  • Replaced the runtime Symbol.hasInstance throw in ErasedType with a declaration-only signature.
  • Removed constructor bodies (converted to signature-only) to keep the types unconstructable.

*
* This class should only be a `type` package export, preventing users from extending it directly.
* But since {@link ErasedTypeImplementation} does extend it an implementation
* for ctor must be provided, unlike {@link ErasedType}.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* for ctor must be provided, unlike {@link ErasedType}.
* for `constructor` must be provided, unlike {@link ErasedType}.

See https://github.com/microsoft/FluidFramework/wiki/Coding-Guidelines#-avoid-using-abbreviations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants