[Beta Breaking 2.100] Make IIdCompressorCore internal#27146
[Beta Breaking 2.100] Make IIdCompressorCore internal#27146markfields merged 5 commits intomicrosoft:mainfrom
Conversation
Complete the transition started in microsoft#26865: move the `IIdCompressorCore` interface from `@legacy @beta` to `@internal`, and narrow the return types of `createIdCompressor`/`deserializeIdCompressor` from `IIdCompressor & IIdCompressorCore` to `IIdCompressor`. Consumers that still need access to the core methods can use the existing `toIdCompressorWithCore` internal helper. This PR also updates `MockFluidDataStoreContext` and `MockFluidDataStoreRuntime` in test-runtime-utils to type their `idCompressor` field as `IIdCompressor` rather than the intersection type.
|
Hey! You look nice today! Want me to review this PR? Based on the diff (286 lines, 20 files), I've queued these reviewers:
Toggle checkboxes to adjust, then reply yes to start — or ask me anything! |
There was a problem hiding this comment.
Pull request overview
This PR updates the @fluidframework/id-compressor legacy API surface to stop exposing the internal control interface IIdCompressorCore, keeping it @internal while preserving internal runtime access via a dedicated helper. It also updates downstream runtime/test utilities and type-validation expectations to reflect the narrowed public types.
Changes:
- Mark
IIdCompressorCoreas@internaland remove it from the legacy API report; narrowcreateIdCompressor/deserializeIdCompressorreturn types toIIdCompressor. - Introduce/standardize internal access via
toIdCompressorWithCore(...)and update call sites/tests to use it (orserializeIdCompressor(...)where appropriate). - Update API reports, type-validation “broken” settings, and generated compatibility tests to match the new surface.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime/test-runtime-utils/src/test/types/validateTestRuntimeUtilsPrevious.generated.ts | Adds @ts-expect-error markers for acknowledged compatibility breaks in mocked runtime types. |
| packages/runtime/test-runtime-utils/src/mocksDataStoreContext.ts | Narrows mocked idCompressor type to IIdCompressor (no core surface). |
| packages/runtime/test-runtime-utils/src/mocks.ts | Switches internal core-method usage to toIdCompressorWithCore(...); narrows exposed types. |
| packages/runtime/test-runtime-utils/package.json | Records expected type-validation breaks for updated mock types. |
| packages/runtime/test-runtime-utils/api-report/test-runtime-utils.legacy.beta.api.md | Updates legacy API report to reflect narrowed idCompressor types. |
| packages/runtime/id-compressor/src/types/idCompressor.ts | Marks IIdCompressorCore as @internal (removing legacy surface exposure). |
| packages/runtime/id-compressor/src/test/types/validateIdCompressorPrevious.generated.ts | Adds @ts-expect-error for acknowledged compatibility breaks related to IIdCompressorCore. |
| packages/runtime/id-compressor/src/test/snapshots/summary.spec.ts | Updates tests to recover core surface via toIdCompressorWithCore(...) before calling core methods. |
| packages/runtime/id-compressor/src/test/idCompressorTestUtilities.ts | Returns compressors typed with core via toIdCompressorWithCore(...) in helpers used by tests. |
| packages/runtime/id-compressor/src/test/idCompressor.spec.ts | Updates tests to use toIdCompressorWithCore(...) where core methods are invoked. |
| packages/runtime/id-compressor/src/idCompressor.ts | Narrows factory/deserializer return types; documents and provides toIdCompressorWithCore(...) for internal core access. |
| packages/runtime/id-compressor/package.json | Records expected type-validation breaks for IIdCompressorCore. |
| packages/runtime/id-compressor/api-report/id-compressor.legacy.beta.api.md | Removes IIdCompressorCore from the legacy API report; updates factory/deserializer return types. |
| packages/runtime/container-runtime/src/containerRuntime.ts | Wraps factory/deserializer results with toIdCompressorWithCore(...) to retain internal core access. |
| packages/dds/tree/src/test/shared-tree/fuzz/fuzzUtils.ts | Uses toIdCompressorWithCore(...) when returning a compressor typed with core for fuzz utilities. |
| packages/dds/tree/src/test/rebase/revisionTagCodec.spec.ts | Uses toIdCompressorWithCore(...) for core range operations in tests. |
| packages/dds/tree/src/test/feature-libraries/chunked-forest/codec/schemaBasedEncode.spec.ts | Recovers core surface via toIdCompressorWithCore(...) for finalize/take range operations in tests. |
| packages/dds/test-dds-utils/src/ddsFuzzHarness.ts | Narrows idCompressorFactory to IIdCompressor and uses toIdCompressorWithCore(...) where core methods are needed. |
| packages/dds/test-dds-utils/src/clientLoading.ts | Switches serialization to serializeIdCompressor(...) instead of calling compressor.serialize(...). |
| .changeset/remove-id-compressor-core.md | Adds release notes + migration guidance for the legacy surface change. |
yes |
noencke
left a comment
There was a problem hiding this comment.
Changes look good, approved assuming this break has been communicated and coordinated with office-bohemia
Josmithr
left a comment
There was a problem hiding this comment.
@markfields Please review Copilot's docs suggestions. Otherwise, tree/api/docs changes look good to me.
Fix verb tense Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| Remove IIdCompressorCore from legacy API surface | ||
|
|
||
| The `IIdCompressorCore` interface has been removed from the `@legacy` API surface and is now `@internal`. This was previously deprecated in 2.92.0. | ||
| The `IIdCompressorCore` interface has been removed from the `@legacy` |
There was a problem hiding this comment.
Nit: I think the formatting suggestion was to break along sentence boundaries (which is our general guidance). I don't think this line formatting is generally what we want.
There was a problem hiding this comment.
Yeah I didn't like it either haha. Will fix.
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
Fixes #26903
Description
Removed IIdCompressorCore from legacy API surface
The
IIdCompressorCoreinterface has been removed from the@legacyAPI surface and is now@internal. This was previously deprecated in 2.92.0.The return types of
createIdCompressoranddeserializeIdCompressorhave been narrowed fromIIdCompressor & IIdCompressorCoretoIIdCompressor.Breaking Changes
serialize(): Use theserializeIdCompressor(compressor, withSession)free function instead of callingcompressor.serialize(withSession)directly.takeNextCreationRange(),takeUnfinalizedCreationRange(),finalizeCreationRange(),beginGhostSession(): These are internal runtime operations that should not be called by external consumers. If you depend on these APIs, please file an issue on the FluidFramework repository describing your use case.createIdCompressor/deserializeIdCompressor: Type your variables asIIdCompressorrather thanIIdCompressor & IIdCompressorCore.