Skip to content

[Beta Breaking 2.100] Make IIdCompressorCore internal#27146

Merged
markfields merged 5 commits intomicrosoft:mainfrom
markfields:fix-26903-iidcompressorcore-internal
Apr 23, 2026
Merged

[Beta Breaking 2.100] Make IIdCompressorCore internal#27146
markfields merged 5 commits intomicrosoft:mainfrom
markfields:fix-26903-iidcompressorcore-internal

Conversation

@markfields
Copy link
Copy Markdown
Member

Fixes #26903

Description

Removed 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 return types of createIdCompressor and deserializeIdCompressor have been narrowed from IIdCompressor & IIdCompressorCore to IIdCompressor.

Breaking Changes

  • serialize(): Use the serializeIdCompressor(compressor, withSession) free function instead of calling compressor.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.
  • Return types of createIdCompressor / deserializeIdCompressor: Type your variables as IIdCompressor rather than IIdCompressor & IIdCompressorCore.

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.
Copilot AI review requested due to automatic review settings April 23, 2026 21:07
@markfields markfields requested review from a team as code owners April 23, 2026 21:07
@markfields markfields changed the title Fix 26903 iidcompressorcore internal [Beta Breaking 2.100] Make IIdCompressorCore internal Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Hey! You look nice today! Want me to review this PR?

Based on the diff (286 lines, 20 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

Toggle checkboxes to adjust, then reply yes to start — or ask me anything!

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 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 IIdCompressorCore as @internal and remove it from the legacy API report; narrow createIdCompressor/deserializeIdCompressor return types to IIdCompressor.
  • Introduce/standardize internal access via toIdCompressorWithCore(...) and update call sites/tests to use it (or serializeIdCompressor(...) 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.

Comment thread .changeset/remove-id-compressor-core.md Outdated
Comment thread .changeset/remove-id-compressor-core.md Outdated
@markfields
Copy link
Copy Markdown
Member Author

Hey! You look nice today! Want me to review this PR?

Based on the diff (286 lines, 20 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

Toggle checkboxes to adjust, then reply yes to start — or ask me anything!

yes

@markfields markfields added the release-blocking Must be addressed before we cut and publish the next release label Apr 23, 2026
Copy link
Copy Markdown
Contributor

@noencke noencke left a comment

Choose a reason for hiding this comment

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

Changes look good, approved assuming this break has been communicated and coordinated with office-bohemia

Copy link
Copy Markdown
Contributor

@Josmithr Josmithr left a comment

Choose a reason for hiding this comment

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

@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>
@markfields markfields enabled auto-merge (squash) April 23, 2026 22:31
Comment thread .changeset/remove-id-compressor-core.md Outdated
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`
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.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah I didn't like it either haha. Will fix.

@github-actions
Copy link
Copy Markdown
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  287071 links
    1898 destination URLs
    2148 URLs ignored
       0 warnings
       0 errors


@markfields markfields merged commit a0d3a13 into microsoft:main Apr 23, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-blocking Must be addressed before we cut and publish the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove legacy+beta export of IIdCompressorCore

4 participants