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

tree: Track which fields change in anchorSet #22367

Merged
merged 7 commits into from
Sep 3, 2024

Conversation

CraigMacomber
Copy link
Contributor

Description

Split off from #22229 for a smaller review.

Reviewer Guidance

The review process is outlined on this wiki page.

@CraigMacomber CraigMacomber requested a review from a team as a code owner September 3, 2024 20:09
@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: tree base: main PRs targeted against main branch labels Sep 3, 2024
if (event === "childrenChangedAfterBatch") {
const fieldKeys = this.bufferedEvents
.filter((e) => e.node === node && e.event === event)
.map((e) => e.changedField as FieldKey);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should use brand for a safer conversion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, this is not casting a string to FIeldKey, but casting away undefined. If unchecked, this should use ! rather than as for much better clarity and type safety. I'm going to make it checked via ?? instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@CraigMacomber CraigMacomber enabled auto-merge (squash) September 3, 2024 20:50
bufferedEvents: [] as {
node: PathNode;
event: keyof AnchorEvents;
changedField?: FieldKey;
Copy link
Contributor

Choose a reason for hiding this comment

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

What does it mean for this to be undefined? Might be worth adding an explicit type for this so we can more easily document the properties.

Copy link
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.

Left a couple of nitpick suggestions, but otherwise looks good to me.

@CraigMacomber CraigMacomber enabled auto-merge (squash) September 3, 2024 21:25
@msfluid-bot
Copy link
Collaborator

@fluid-example/bundle-size-tests: +1.74 KB
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 459.92 KB 459.95 KB +35 Bytes
azureClient.js 557.96 KB 558.01 KB +49 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 260.75 KB 260.76 KB +14 Bytes
fluidFramework.js 398.55 KB 399.31 KB +781 Bytes
loader.js 134.26 KB 134.28 KB +14 Bytes
map.js 42.39 KB 42.39 KB +7 Bytes
matrix.js 146.56 KB 146.56 KB +7 Bytes
odspClient.js 525.23 KB 525.28 KB +49 Bytes
odspDriver.js 97.72 KB 97.74 KB +21 Bytes
odspPrefetchSnapshot.js 42.78 KB 42.79 KB +14 Bytes
sharedString.js 163.26 KB 163.26 KB +7 Bytes
sharedTree.js 389.06 KB 389.82 KB +774 Bytes
Total Size 3.29 MB 3.29 MB +1.74 KB

Baseline commit: 6468aea

Generated by 🚫 dangerJS against d14cd89

@CraigMacomber CraigMacomber merged commit 04849aa into microsoft:main Sep 3, 2024
30 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants