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

Emit events from Unhydrated SharedTree Nodes #22661

Merged
merged 10 commits into from
Sep 28, 2024

Conversation

noencke
Copy link
Contributor

@noencke noencke commented Sep 27, 2024

Description

Currently, unhydrated nodes can be edited but they do not emit any change events. This PR fixes that by properly emitting events. Changes include:

  • Removing the anchor parameter from the relevant events on AnchorEvents. This allows those events to be implemented by things that don't have anchors (like UnhydratedFlexTreeNode) and things that only sometimes have anchors (like TreeNodeKernel). Nobody uses that parameter currently anyway because it is redundant (it's the same as the object that the event is being registered on).
  • Emitting a change event from UnhydratedFlexTreeNode when one of its fields is edited. This is listened to by the TreeNodeKernel, which can then emit its own corresponding event.
  • Adding distinct types for the "unhydrated" and "hydrated" versions of the state in TreeNodeKernel. This makes it more obvious what the state transition is, and makes the type checking and safety more explicit.
  • Adding a lazy function helper to better encapsulate the lazy-getting of the events in TreeNodeKernel.

@noencke noencke requested review from a team as code owners September 27, 2024 16:41
@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: tree changeset-present base: main PRs targeted against main branch labels Sep 27, 2024
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Sep 27, 2024

@fluid-example/bundle-size-tests: +1.18 KB
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 461.07 KB 461.11 KB +35 Bytes
azureClient.js 558.69 KB 558.74 KB +49 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 261.33 KB 261.35 KB +14 Bytes
fluidFramework.js 401.93 KB 402.42 KB +496 Bytes
loader.js 134.17 KB 134.19 KB +14 Bytes
map.js 42.43 KB 42.44 KB +7 Bytes
matrix.js 146.8 KB 146.8 KB +7 Bytes
odspClient.js 525.84 KB 525.89 KB +49 Bytes
odspDriver.js 97.8 KB 97.82 KB +21 Bytes
odspPrefetchSnapshot.js 42.76 KB 42.78 KB +14 Bytes
sharedString.js 163.79 KB 163.8 KB +7 Bytes
sharedTree.js 392.4 KB 392.88 KB +489 Bytes
Total Size 3.3 MB 3.3 MB +1.18 KB

Baseline commit: a9a07c6

Generated by 🚫 dangerJS against 9d48431

@noencke noencke merged commit d1eade6 into microsoft:main Sep 28, 2024
30 checks passed
@noencke noencke deleted the unhydrated-events branch September 28, 2024 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds: tree area: dds Issues related to distributed data structures base: main PRs targeted against main branch changeset-present
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants