Skip to content

Use SharedObjectFromKernel for SharedMap #24876

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

CraigMacomber
Copy link
Contributor

Description

This makes SharedMap implemented using SharedObjectFromKernel.

This enables easier reuse of map code, for example in adapters like those in #23729.

This is a continuation of #24401 where this pattern was applied to SharedTree.

Reviewer Guidance

The review process is outlined on this wiki page.

@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 22:58
@CraigMacomber CraigMacomber requested a review from a team as a code owner June 18, 2025 22:58
@github-actions github-actions bot added base: main PRs targeted against main branch area: dds Issues related to distributed data structures area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct public api change Changes to a public API labels Jun 18, 2025
Copy link
Contributor

@Copilot 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 refactors SharedMap to use the SharedObjectFromKernel pattern, introducing a core kernel/view separation and updating the public API and tests to align with that change.

  • Introduce ISharedMapCore and have ISharedMap extend it instead of Map<string, any>
  • Replace the handwritten MapFactory class with a call to makeChannelFactory and wire up mapKernelFactory
  • Update tests to use the new kernel-based SharedMap (via makeChannelFactory) and to call toFluidHandleInternal for handle paths

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/framework/fluid-framework/src/index.ts Export ISharedMapCore alongside ISharedMap
packages/framework/fluid-framework/api-report/fluid-framework.legacy.alpha.api.md Update ISharedMap API to extend ISharedMapCore
packages/dds/shared-object-base/src/sharedObjectKernel.ts Export makeChannelFactory and adjust ESLint disables
packages/dds/shared-object-base/src/index.ts Re-export makeChannelFactory
packages/dds/map/tsconfig.json Disable noUnusedLocals for type-assertion-driven code
packages/dds/map/src/test/types/validateMapPrevious.generated.ts Add @ts-expect-error for broken MapFactory compatibility
packages/dds/map/src/test/mocha/reconnection.spec.ts Add a basic “can send ops” sanity test before reconnection tests
packages/dds/map/src/test/mocha/map.spec.ts Refactor to use kernel-backed SharedMap and a Hack helper
packages/dds/map/src/test/mocha/directory.spec.ts Switch handle path checks to toFluidHandleInternal
packages/dds/map/src/mapKernel.ts New MapKernel implementing SharedKernel / ISharedMapCore
packages/dds/map/src/mapFactory.ts Use makeChannelFactory for MapFactory
packages/dds/map/src/index.ts Export ISharedMapCore
packages/dds/map/package.json Mark ClassStatics_MapFactory backCompat as false
packages/dds/map/api-report/map.legacy.alpha.api.md Update API report for ISharedMapCore and MapFactory shape
Comments suppressed due to low confidence (1)

packages/dds/map/src/test/mocha/reconnection.spec.ts:58

  • [nitpick] This test lives under the "Reconnection" suite but does not test reconnection behavior; consider renaming it to clarify its intent or moving it to a more appropriate suite.
		it("can send ops", async () => {

@CraigMacomber
Copy link
Contributor Author

CraigMacomber commented Jun 19, 2025

This is failing tests due to the access of runtime.idCompressor making its way to ContainerRUntime.idCompresssor which instead of returning and idcompressor undefined, is asserting "0x8ea" becaise sessionSchema.idCompressorMode === "on" but _idCompressor !== undefined.

I believe this is a bug unrelated to this test, but detected by this change.

Copy link
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:
  225443 links
    1710 destination URLs
    1941 URLs ignored
       0 warnings
       0 errors


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds Issues related to distributed data structures area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant