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

refactor(tree2): tree builds can be centralized in ModularChangeFamily changesets #18386

Merged
merged 16 commits into from Nov 20, 2023

Conversation

yann-achard-MS
Copy link
Contributor

Key changes:

  • At the changeset layer, tree builds can now be centralized at the root of ModularChangeFamily changesets. This is however not mandatory.
  • At the delta layer, tree builds can now be centralized at the root of deltas. This is however not mandatory.
  • Sequence field now leverages the above capabilities.

Note that in this first version, the builds are atomized.

Punted:

  • Using a non atomized in-memory and on-wire representation (task)
  • Migrating other field kinds to using the centralized builds (task)

@yann-achard-MS yann-achard-MS requested review from a team as code owners November 18, 2023 00:04
@github-actions github-actions bot added base: main PRs targeted against main branch area: dds Issues related to distributed data structures area: dds: tree public api change Changes to a public API labels Nov 18, 2023
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Nov 18, 2023

@fluid-example/bundle-size-tests: +871 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 447.55 KB 447.55 KB +2 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 240.64 KB 240.64 KB No change
loader.js 165.06 KB 165.07 KB +2 Bytes
map.js 48.06 KB 48.06 KB +2 Bytes
matrix.js 141.84 KB 141.85 KB +2 Bytes
odspDriver.js 90.35 KB 90.35 KB +2 Bytes
odspPrefetchSnapshot.js 41.82 KB 41.82 KB +2 Bytes
sharedString.js 162.75 KB 162.75 KB No change
sharedTree2.js 275.44 KB 276.28 KB +857 Bytes
Total Size 1.73 MB 1.73 MB +871 Bytes

Baseline commit: 0bb85e9

Generated by 🚫 dangerJS against 1c5a67f

@@ -121,7 +122,7 @@ function invertMark<TNodeChange>(
id: mark.id,
cellId: outputId,
count: mark.count,
detachIdOverride: mark.cellId,
detachIdOverride: getInputCellId(mark, revision, revisionMetadata),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this related to the rest of the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was needed when I was trying to avoid using AttachAndDetach marks for cases where the attach is a new insert.
As we dicussed I can't make that work yet because we need to keep the insert effect (so we can compare its ID to the the ID of the cell).
That said, this change is still good. I've just pushed a pair of tests that fail if getInputCellId is not used.

return undefined;
}
const encoded: EncodedBuilds = nestedMapToFlatList(builds).map(([r, i, t]) =>
r !== undefined ? [r, i, t] : [i, t],
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels like a potentially unnecessary optimization. Maybe at least add a quick comment either here or in the format file about this optimization.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why unnecessary? Here's the comment I'm considering:

// `undefined` does not round-trip through JSON strings, so it needs special handling.
// Most entries will have an undefined revision due to the revision information being inherited from the `ModularChangeset`.
// We therefore optimize for the common case by omitting the revision when it is undefined.

@yann-achard-MS yann-achard-MS enabled auto-merge (squash) November 20, 2023 18:37
@yann-achard-MS yann-achard-MS merged commit 0e49747 into microsoft:main Nov 20, 2023
25 checks passed
@yann-achard-MS yann-achard-MS deleted the global-tree-building branch November 20, 2023 19:08
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 public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants