Skip to content
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

Remove extra calls to bind when not attached #21213

Merged
merged 9 commits into from
May 28, 2024

Conversation

jzaffiro
Copy link
Contributor

With the change to the ordering of getting the attachment summary in #20998 and the testing in #20995 and #21132, we can now remove the workarounds that call bindHandles or makeSerializable when not in an attached state.

@github-actions github-actions bot added area: dds Issues related to distributed data structures base: main PRs targeted against main branch labels May 23, 2024
@jzaffiro jzaffiro requested a review from markfields May 23, 2024 00:21
@@ -7,7 +7,7 @@ import type { TypedEventEmitter } from "@fluid-internal/client-utils";
import type { IFluidHandle } from "@fluidframework/core-interfaces";
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
import type { IFluidSerializer } from "@fluidframework/shared-object-base/internal";
import { ValueType, bindHandles } from "@fluidframework/shared-object-base/internal";
Copy link
Member

Choose a reason for hiding this comment

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

You can also delete this function, it's not used anywhere else, and isn't an ideal implementation. @Abe27342 what's the task you pinged me about fixing the function? We can close it if this PR works out.

@github-actions github-actions bot added the public api change Changes to a public API label May 23, 2024
@@ -84,8 +80,6 @@ export interface IMapDataObjectSerialized {
type MapKeyLocalOpMetadata = IMapKeyEditLocalOpMetadata | IMapKeyAddLocalOpMetadata;
type MapLocalOpMetadata = IMapClearLocalOpMetadata | MapKeyLocalOpMetadata;

/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */
Copy link
Member

Choose a reason for hiding this comment

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

Do we know why these aren't necessary anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think they were unrelated, but I have format on save turned on and it removed a bunch of lints that were no longer used apparently.

@@ -147,6 +147,11 @@
"typescript": "~5.3.3"
},
"typeValidation": {
"broken": {}
"broken": {
"RemovedFunctionDeclaration_bindHandles": {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this running on @internal things? Oh well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought this seemed odd too, but it removed the entries from validateSharedObjectPrevious which seemed like the right thing to do.

@markfields
Copy link
Member

markfields commented May 23, 2024

Fixes AB#7316

Copy link
Member

@markfields markfields left a comment

Choose a reason for hiding this comment

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

Thanks for knocking this out!

const localValue = this.directory.localValueMaker.fromInMemory(value);
const serializableValue = makeSerializable(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@markfields I actually don't think this can be removed - without this, the visibility of the datastores is not getting set correctly. This also predated #19242, so I would think it's ok to leave.

Copy link
Member

Choose a reason for hiding this comment

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

As discussed - sounds like a bug. We'll follow up separately.

@msfluid-bot
Copy link
Collaborator

msfluid-bot commented May 28, 2024

@fluid-example/bundle-size-tests: -115 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 453.27 KB 453.25 KB -14 Bytes
azureClient.js 552.5 KB 552.49 KB -14 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 256.95 KB 256.95 KB No change
fluidFramework.js 359.88 KB 359.88 KB No change
loader.js 134.38 KB 134.38 KB No change
map.js 41.53 KB 41.46 KB -73 Bytes
matrix.js 143.75 KB 143.75 KB No change
odspClient.js 520.87 KB 520.85 KB -14 Bytes
odspDriver.js 97.3 KB 97.3 KB No change
odspPrefetchSnapshot.js 42.16 KB 42.16 KB No change
sharedString.js 160.27 KB 160.27 KB No change
sharedTree.js 359.86 KB 359.86 KB No change
Total Size 3.2 MB 3.2 MB -115 Bytes

Baseline commit: 936f247

Generated by 🚫 dangerJS against 6040a46

@github-actions github-actions bot removed the public api change Changes to a public API label May 28, 2024
@jzaffiro jzaffiro merged commit 68e5eb3 into microsoft:main May 28, 2024
30 checks passed
@jzaffiro jzaffiro deleted the bindCleanup branch May 28, 2024 21:33
this.serializer,
this.directory.handle,
);
bindHandles(localValue, this.serializer, this.directory.handle);
Copy link
Member

Choose a reason for hiding this comment

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

For when we revisit this - I think it can/should go in the isAttached block

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 base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants