-
Notifications
You must be signed in to change notification settings - Fork 548
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 haveISharedMap
extend it instead ofMap<string, any>
- Replace the handwritten
MapFactory
class with a call tomakeChannelFactory
and wire upmapKernelFactory
- Update tests to use the new kernel-based
SharedMap
(viamakeChannelFactory
) and to calltoFluidHandleInternal
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 () => {
This is failing tests due to the access of runtime.idCompressor making its way to I believe this is a bug unrelated to this test, but detected by this change. |
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
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.