Граф коммитов

21374 Коммитов

Автор SHA1 Сообщение Дата
MarioJGMsoft d94bd42b34
Testing getDeltas fetchReason addition (#23057)
## Description

Create new test to make sure that the added code is functioning as
intended and see what is going to be sent from now to AFR

## Reviewer Guidance

Let me know if there's a better way to create the test

Fixes:
[AB#21454](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/21454)
2024-11-20 16:46:48 -08:00
Ji Kim 5abfa015af
Add Clone to SharedTree Revertible (#23044)
#### Description


[13864](https://dev.azure.com/fluidframework/internal/_workitems/edit/13864/)

This PR adds forkable revertible feature to the `Revertible` object of
SharedTree.

- Removed `DisposableRevertible` and replaced by `RevertibleAlpha`.
- Added `clone()` method to the new interface.
- Uses `TreeBranch` (which is subset of `TreeCheckout`) to access data
necessary for revert operation.

---------

Co-authored-by: Noah Encke <78610362+noencke@users.noreply.github.com>
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
Co-authored-by: Jenn <jennle@microsoft.com>
2024-11-20 15:45:41 -08:00
Matt Rakow d3bf90ca08
feat(migration-tools): Minimize model loading pattern presence in favor of entryPoint (#23119) 2024-11-20 15:01:49 -08:00
Noah Encke 224f59adf4
Strengthen branch event types and remove usages of `oob()` by adding array helper utilities (#23157)
## Description

This adds a collection of utilities that help to strongly-type arrays
which are known to have one or more elements in them. This allows some
of the SharedTreeBranchEvent arrays of commits to be more strongly typed
and benefit from these helpers. This PR also removes many usages of
`oob()` in favor of the new utilities. While `oob()` is still
appropriate in many places, the new utilities can help retrieve either
the first or the last element of an array in a type-safe way that is
(unlike `oob()`) enforced by the compiler.
2024-11-20 14:43:58 -08:00
Matt Rakow a410ce44df
fix(version-migration-separate-container): Fix component unmounting and migrationTool updating (#23163) 2024-11-20 14:07:02 -08:00
Craig Macomber (Microsoft) dc3c30019e
fix: Empty ObjectNode type safety (#23162)
## Description

ObjectNodes with no fields will now emit a compiler error if constructed
from an object literal with fields.
This matches the behavior of non-empty ObjectNodes which already gave
errors when unexpected properties were provided.

Also adds an "unsound union properties" test demoing a type soundness
issue which impacts tree but is a limitation of TypeScript which Tree
can no workaround.

## Breaking Changes

Any code which constructed object nodes with no fields from object
literals with fields should have those fields removed as they have no
impact at runtime.

---------

Co-authored-by: Craig Macomber <Craig.Macomber@microsoft.com>
2024-11-20 13:52:03 -08:00
Shubhangi 9830a0ee76
Add listeners for sigint, sigquit, sighup (#23148)
## Description

Adding event listeners for SIGINT, SIGQUIT, SIGHUP to log these events.

Co-authored-by: Shubhangi Agarwal <shuagarwal@microsoft.com>
2024-11-20 21:30:49 +00:00
Joshua Smithrud ef46033a96
build(docs): Update dependencies (#23164)
Updated with `pnpm update`
2024-11-20 15:01:44 -06:00
dependabot[bot] e2a1aa0229
build(deps): bump cross-spawn in /tools/telemetry-generator (#23160)
Bumps and [cross-spawn](https://github.com/moxystudio/node-cross-spawn).
These dependencies needed to be updated together.
Updates `cross-spawn` from 6.0.5 to 7.0.6
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md">cross-spawn's
changelog</a>.</em></p>
<blockquote>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.5...v7.0.6">7.0.6</a>
(2024-11-18)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>update cross-spawn version to 7.0.5 in package-lock.json (<a
href="f700743918">f700743</a>)</li>
</ul>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.4...v7.0.5">7.0.5</a>
(2024-11-07)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>fix escaping bug introduced by backtracking (<a
href="640d391fde">640d391</a>)</li>
</ul>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.4">7.0.4</a>
(2024-11-07)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>disable regexp backtracking (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/160">#160</a>)
(<a
href="5ff3a07d9a">5ff3a07</a>)</li>
</ul>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.2...v7.0.3">7.0.3</a>
(2020-05-25)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>detect path key based on correct environment (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/133">#133</a>)
(<a
href="159e7e9785">159e7e9</a>)</li>
</ul>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.1...v7.0.2">7.0.2</a>
(2020-04-04)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>fix worker threads in Node &gt;=11.10.0 (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/132">#132</a>)
(<a
href="6c5b4f0158">6c5b4f0</a>)</li>
</ul>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.0...v7.0.1">7.0.1</a>
(2019-10-07)</h3>
<h3>Bug Fixes</h3>
<ul>
<li><strong>core:</strong> support worker threads (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/127">#127</a>)
(<a
href="https://github.com/moxystudio/node-cross-spawn/commit/cfd49c9">cfd49c9</a>)</li>
</ul>
<h2><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v6.0.5...v7.0.0">7.0.0</a>
(2019-09-03)</h2>
<h3>⚠ BREAKING CHANGES</h3>
<ul>
<li>
<p>drop support for Node.js &lt; 8</p>
</li>
<li>
<p>drop support for versions below Node.js 8 (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/125">#125</a>)
(<a
href="https://github.com/moxystudio/node-cross-spawn/commit/16feb53">16feb53</a>)</p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="77cd97f3ca"><code>77cd97f</code></a>
chore(release): 7.0.6</li>
<li><a
href="6717de49ff"><code>6717de4</code></a>
chore: upgrade standard-version</li>
<li><a
href="f700743918"><code>f700743</code></a>
fix: update cross-spawn version to 7.0.5 in package-lock.json</li>
<li><a
href="9a7e3b2165"><code>9a7e3b2</code></a>
chore: fix build status badge</li>
<li><a
href="085268352d"><code>0852683</code></a>
chore(release): 7.0.5</li>
<li><a
href="640d391fde"><code>640d391</code></a>
fix: fix escaping bug introduced by backtracking</li>
<li><a
href="bff0c87c8b"><code>bff0c87</code></a>
chore: remove codecov</li>
<li><a
href="a7c6abc6fe"><code>a7c6abc</code></a>
chore: replace travis with github workflows</li>
<li><a
href="9b9246e096"><code>9b9246e</code></a>
chore(release): 7.0.4</li>
<li><a
href="5ff3a07d9a"><code>5ff3a07</code></a>
fix: disable regexp backtracking (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/160">#160</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/moxystudio/node-cross-spawn/compare/v6.0.5...v7.0.6">compare
view</a></li>
</ul>
</details>
<br />

Updates `cross-spawn` from 7.0.3 to 7.0.6
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md">cross-spawn's
changelog</a>.</em></p>
<blockquote>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.5...v7.0.6">7.0.6</a>
(2024-11-18)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>update cross-spawn version to 7.0.5 in package-lock.json (<a
href="f700743918">f700743</a>)</li>
</ul>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.4...v7.0.5">7.0.5</a>
(2024-11-07)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>fix escaping bug introduced by backtracking (<a
href="640d391fde">640d391</a>)</li>
</ul>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.4">7.0.4</a>
(2024-11-07)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>disable regexp backtracking (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/160">#160</a>)
(<a
href="5ff3a07d9a">5ff3a07</a>)</li>
</ul>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.2...v7.0.3">7.0.3</a>
(2020-05-25)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>detect path key based on correct environment (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/133">#133</a>)
(<a
href="159e7e9785">159e7e9</a>)</li>
</ul>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.1...v7.0.2">7.0.2</a>
(2020-04-04)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>fix worker threads in Node &gt;=11.10.0 (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/132">#132</a>)
(<a
href="6c5b4f0158">6c5b4f0</a>)</li>
</ul>
<h3><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v7.0.0...v7.0.1">7.0.1</a>
(2019-10-07)</h3>
<h3>Bug Fixes</h3>
<ul>
<li><strong>core:</strong> support worker threads (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/127">#127</a>)
(<a
href="https://github.com/moxystudio/node-cross-spawn/commit/cfd49c9">cfd49c9</a>)</li>
</ul>
<h2><a
href="https://github.com/moxystudio/node-cross-spawn/compare/v6.0.5...v7.0.0">7.0.0</a>
(2019-09-03)</h2>
<h3>⚠ BREAKING CHANGES</h3>
<ul>
<li>
<p>drop support for Node.js &lt; 8</p>
</li>
<li>
<p>drop support for versions below Node.js 8 (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/125">#125</a>)
(<a
href="https://github.com/moxystudio/node-cross-spawn/commit/16feb53">16feb53</a>)</p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="77cd97f3ca"><code>77cd97f</code></a>
chore(release): 7.0.6</li>
<li><a
href="6717de49ff"><code>6717de4</code></a>
chore: upgrade standard-version</li>
<li><a
href="f700743918"><code>f700743</code></a>
fix: update cross-spawn version to 7.0.5 in package-lock.json</li>
<li><a
href="9a7e3b2165"><code>9a7e3b2</code></a>
chore: fix build status badge</li>
<li><a
href="085268352d"><code>0852683</code></a>
chore(release): 7.0.5</li>
<li><a
href="640d391fde"><code>640d391</code></a>
fix: fix escaping bug introduced by backtracking</li>
<li><a
href="bff0c87c8b"><code>bff0c87</code></a>
chore: remove codecov</li>
<li><a
href="a7c6abc6fe"><code>a7c6abc</code></a>
chore: replace travis with github workflows</li>
<li><a
href="9b9246e096"><code>9b9246e</code></a>
chore(release): 7.0.4</li>
<li><a
href="5ff3a07d9a"><code>5ff3a07</code></a>
fix: disable regexp backtracking (<a
href="https://redirect.github.com/moxystudio/node-cross-spawn/issues/160">#160</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/moxystudio/node-cross-spawn/compare/v6.0.5...v7.0.6">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/microsoft/FluidFramework/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-20 12:59:44 -08:00
Joshua Smithrud 9a8f69ab6e
build(devtools): Bundle `devtools-core` in API-Extractor (#23156)
Will ensure that core API members appear directly in website API docs
and will help detect transitive breaking changes from `devtools-core`.

Also updates `@packageDocumentation` comment with more details.
2024-11-20 12:23:17 -08:00
Joshua Smithrud 731a027cbb
fix(docs): Fix contrast ratio accessibility issues in the site's searchbar (#23154)
Fixes insufficient contrast ratio between the searchbar's text and its
background. Before and after screenshots below. Note: the difference is
significantly more pronounced in light mode.

| Scenario | Before | After |
| --- | --- | --- |
| Light mode (placeholder) |
![light-placeholder-before](https://github.com/user-attachments/assets/79436610-76c0-4428-9073-3998da7a6121)|
![light-placeholder-after](https://github.com/user-attachments/assets/b25a1433-e7a6-47fb-b445-1ee685c4f304)
|
| Light mode (filled) |
![light-filled-before](https://github.com/user-attachments/assets/e0320909-5ca4-4fbb-b0f7-a2388b0821c5)|
![light-filled-after](https://github.com/user-attachments/assets/19fbde84-191b-4d84-b6c8-ea29a8b0bc64)|
| Dark mode (placeholder) |
![dark-placeholder-before](https://github.com/user-attachments/assets/9d3dc8dc-a1a3-4363-a248-ed63c5cbd284)|
![dark-placeholder-after](https://github.com/user-attachments/assets/97db35fc-d5d6-4e5f-89fb-3aba4b524837)
|
| Dark mode (filled) |
![dark-filled-before](https://github.com/user-attachments/assets/f00c10ae-71e5-4cc9-9025-d4197d007a69)|
![dark-filled-after](https://github.com/user-attachments/assets/0acb8a09-c018-46e8-a1f5-5b56b90f621a)|


[AB#22718](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/22718)
2024-11-20 12:05:10 -08:00
Joshua Smithrud 6330f4a687
build(docs): Better API docs cleaning (#23153)
The API docs directories for the website contain a mix of generated and
manually authored files, so cleaning the API docs is not as simple as
just deleting the entire directory.

We previously had a sketchy workaround the cleaned all `.md` files, but
left any `.mdx` files alone, and had a script override in place to
ensure we ran `clean:api-documentation` before running
`build:api-documentation`.

This PR introduces a more wholistic solution to the fundamental problem,
which is that we want to clean up all of the git-ignored contents of the
API docs directories, while leaving the checked-in files alone.


[AB#24394](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/24394)
2024-11-20 18:37:42 +00:00
Matt Rakow 8e4df0d886
Share LocalDeltaConnectionServer between documents (#23146)
In SessionStorageModelLoader
2024-11-20 10:11:15 -08:00
Noah Encke 948fc52e8d
Simplify/Refactor BranchCommitEnricher (#23151)
## Description

This tightens the state machine space for `BranchCommitEnricher` and
makes various simplifications to the API and code.

* The API surface of `BranchCommitEnricher` is reduced to functions
that:
  1. Process branch changes
  2. Get enriched commits
  3. Acknowledge transaction state transitions
  
Item (i) used to be made of a few different methods whose invocations
needed to be coordinated by `SharedTreeCore`. Now,
`BranchCommitEnricher` manages this internally. Previously, it needed to
know whether or not the commit being submitted was the commit of the
outermost transaction. This could be problematic for future refactors of
SharedTreeCore, so the enricher now derives that information from its
internals (since it already keeps track of ongoing transactions via the
`TransactionEnricher`.
* The map of processed commits stored in the enricher is now a WeakMap,
meaning that the enricher does not need to worry about accidentally
holding on to commits forever. The logic that "purges" map entries
between changes has been removed since the entries will now be dropped
automatically as the commits become unreferenced.
* TransactionEnricher no longer allows getting the enriched change in
the middle of a transaction.
* We now properly throw an error if a the SharedTree is attached in the
middle of a transaction - we do not and cannot currently support this
scenario.
* Various renames, conditional refactors, inlining, etc. to shorten
lines, improve code flow, simplify conditional logic, etc. and
additional documentation.
2024-11-20 03:35:47 +00:00
Craig Macomber (Microsoft) 421ba40375
Fix areOnlyKeys handling of optional fields (#23152)
## Description

Fix areOnlyKeys handling of optional fields, add tests for it, and
document issue with index signatures.
2024-11-19 16:24:33 -08:00
Craig Macomber (Microsoft) 86ee6ad7bb
Update type tests to use 2.10 (#23145)
## Description

Update client type tests to use 2.10

Used: `pnpm run typetests:prepare`
2024-11-19 15:21:27 -08:00
Michael Zhen cef6ce1d36
(docs): build-docs pipeline without upload artifact (#23150)
previous build-docs pipeline for temporary deployment of static doc
changes.
excludes steps to upload-json artifacts
2024-11-19 15:08:37 -08:00
Joshua Smithrud dadfe49432
build(docs): Ensure API docs gen doesn't create "partial" documents (#23147)
Docusaurus treats document files whose names start with `_` as "partial"
documents, which don't get included in site output. We have a couple of
API exports that start with `_`, and result in files that end up treated
as partials. To work around this, we now prepend "u" to any files that
would otherwise start with an underscore.

"u" is a pretty arbitrary choice. We can't simply remove the underscore,
as that would be much more likely to create filename collisions. While
it is technically possible that we could export an API item that starts
with "u_", doing so would violate our naming conventions, and seems
pretty unlikely. If such an API item is added, Docusaurus will start
failing on duplicate routes, at which point we can change strategies.

See https://docusaurus.io/docs/create-doc for more details on partial
documents.


[AB#23443](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/23443)
2024-11-19 13:40:57 -08:00
Pranshu 580a3f77ae
added a new page for Presence (#23108)
## Description

Added a new page for the new Presence APIs and supported scenarios

---------

Co-authored-by: Rick Kirkham <Rick-Kirkham@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2024-11-19 11:50:27 -08:00
Tony Murphy 3426b434df
Enable Synchronous Child Datastore Creation (#23143)
## Overview

This feature introduces a new pattern for creating datastores
synchronously within the Fluid Framework. It allows for the synchronous
creation of a child datastore from an existing datastore, provided that
the child datastore is available synchronously via the existing
datastore's registry and that the child's factory supports synchronous
creation. This method also ensures strong typing for the consumer.

In this context, "child" refers specifically to the organization of
factories and registries, not to any hierarchical or hosting
relationship between datastores. The parent datastore does not control
the runtime behaviors of the child datastore beyond its creation.

The synchronous creation of child datastores enhances the flexibility of
datastore management within the Fluid Framework. It ensures type safety
and provides a different way to manage datastores within a container.
However, it is important to consider the overhead associated with
datastores, as they are stored, summarized, garbage collected, loaded,
and referenced independently. This overhead should be justified by the
scenario's requirements.

Datastores offer increased capabilities, such as the ability to
reference them via handles, allowing multiple references to exist and
enabling those references to be moved, swapped, or changed.
Additionally, datastores are garbage collected after becoming
unreferenced, which can simplify final cleanup across clients. This is
in contrast to subdirectories in a shared directory, which do not have
native capabilities for referencing or garbage collection but are very
low overhead to create.

Synchronous creation relies on both the factory and the datastore to
support it. This means that asynchronous operations, such as resolving
handles, some browser API calls, consensus-based operations, or other
asynchronous tasks, cannot be performed during the creation flow.
Therefore, synchronous child datastore creation is best limited to
scenarios where the existing asynchronous process cannot be used, such
as when a new datastore must be created in direct response to
synchronous user input.

## Key Benefits

- **Synchronous Creation**: Allows for the immediate creation of child
datastores without waiting for asynchronous operations.
- **Strong Typing**: Ensures type safety and better developer experience
by leveraging TypeScript's type system.

## Use Cases

### Example 1: Creating a Child Datastore

In this example, we demonstrate how to support creating a child
datastore synchronously from a parent datastore.

```typescript
/**
 * This is the parent DataObject, which is also a datastore. It has a
 * synchronous method to create child datastores, which could be called
 * in response to synchronous user input, like a key press.
 */
class ParentDataObject extends DataObject {
	get ParentDataObject() {
		return this;
	}
	protected override async initializingFirstTime(): Promise<void> {
		// create synchronously during initialization
		this.createChild("parentCreation");
	}

	createChild(name: string): ChildDataStore {
		assert(
			this.context.createChildDataStore !== undefined,
			"this.context.createChildDataStore",
		);
		// creates a detached context with a factory who's package path is the same
		// as the current datastore, but with another copy of its own type.
		const { entrypoint } = this.context.createChildDataStore(
			ChildDataStoreFactory.instance,
		);
		const dir = this.root.createSubDirectory("children");
		dir.set(name, entrypoint.handle);
		entrypoint.setProperty("childValue", name);

		return entrypoint;
	}

	getChild(name: string): IFluidHandle<ChildDataStore> | undefined {
		const dir = this.root.getSubDirectory("children");
		return dir?.get<IFluidHandle<ChildDataStore>>(name);
	}
}
```

For a complete example see the follow test:

https://github.com/microsoft/FluidFramework/blob/main/packages/test/local-server-tests/src/test/synchronousDataStoreCreation.spec.ts

---------

Co-authored-by: jzaffiro <110866475+jzaffiro@users.noreply.github.com>
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
2024-11-19 19:33:14 +00:00
Joshua Smithrud c11bc168c4
refactor(docs): Remove binary images from website source (#23137)
The removed images have been uploaded to our blob storage. The website
contents now refer to them by URL.
2024-11-19 19:30:15 +00:00
WillieHabi 13ee3b4b8f
Signal Tracking: update `connected` checks (#22758)
## Description
In this PR we remove any connected checks in signal tracking system and
reset the tracking metrics when a client reconnects.
2024-11-19 09:52:56 -08:00
Alex Villarreal a772c76c70
refactor(examples): Make all depdendencies into devDeps in the simplemde example (#23110)
## Description

Switches all dependencies in the simplemde example app to be
devDependencies.

The example apps in the repo are not production code and aren't
published or deployed anywhere. Having prod dependencies in them causes
our lockfiles to mark them as such, and consequently Component
Governance potentially flags them for prod-level security
vulnerabilities. We have one outstanding prod-level alert about the
simplemde package (which seems abandoned); this change should remove the
prod-level severity from it while we migrate to another package for this
example, or get rid of it altogether.

The [ai-collab sample app already showcases this
pattern](https://github.com/microsoft/FluidFramework/blob/main/examples/apps/ai-collab/package.json#L33).
2024-11-19 16:03:08 +00:00
Craig Macomber (Microsoft) adc25b0961
[bump] client: 2.10.0 => 2.11.0 (minor) (#23134)
## Description

Bumped client from 2.10.0 to 2.11.0.
2024-11-18 19:23:30 -08:00
Tyler Butler 50cb876bc4
build: Remove changelog entries for reverted change (#23139)
Removes changelog entries for the reverted changes in #23133. Also
removes some lingering entries in the release notes from that same
change. Finally, also fixes up some heading levels in the release notes
and TOC that were missed in review.
2024-11-18 19:10:19 -08:00
Jason Hartman b92a003c1e
revert: "Enable Synchronous Child Datastore Creation (#22962)" (#23133)
and collateral "Tag asserts for release (#23128)"

This reverts commits 67b5e4dca8 and
eefaaf3c2a.
2024-11-18 17:39:41 -08:00
Craig Macomber (Microsoft) 3cd1f01a14
Generate changelogs (#23132)
## Description

Generate change logs with `pnpm exec flub generate changelog -g client`
2024-11-19 00:16:38 +00:00
Ji Kim 116064a36e
feat(eslint-config-fluid): Add how to add a new eslint rule in `eslint-plugin-fluid` package. (#23004)
#### Description


[22739](https://dev.azure.com/fluidframework/internal/_workitems/edit/22739)

This PR adds step by step instructions for:
- Adding a new rule to the `estlint-plugin-fluid`
- Bumping the `eslint-plugin-fluid` version
- Bumping the `eslint-config-fluid` version

---------

Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
2024-11-18 23:52:48 +00:00
Joshua Smithrud a101fb23ba
fix(docs): Fix site title and description (#23131)
Current contents were copied from example boilerplate and were missed in
the initial Docusaurus PR.

This PR fixes the generated site title to be `Fluid Framework` instead
of `Fluid Framework | Hello from Fluid Framework!`.
Also removes the template page description.
2024-11-18 15:42:16 -08:00
Michael Zhen e8d8c654e1
(docs): update build-docs to deploy v2 artifacts (#22934)
Update to deployment and docs generation: adjustments to deploy v2
artifact instead of main artifacts. Note: while the update aims to
deploy artifacts from the latest release branches instead of main, the
actual website build is still done on the main branch. This will prevent
the pipeline from deploying docs which were generated with an outdated
version of the website.
Notable changes:

deploy-docs:
- shifted most of the stages from build-docs to deploy-docs
- build-docs now runs check_branch_version -> upload-json -> trigger
deploy

build-docs:
- shifted check_branch_version to the top since its output is required
to properly in the upload json step

upload-json-step:
- added a new upload step which uploads artifacts with the name
"latest-v*.tar.gz"
- takes in new parameters from check_branch_version to ensure it only
uploads with this name when the pipeline is running on the latest
release branch

latestVersions:
- since upload-json-step requires majorVersion, I figured it was best to
include it as an output variable for the function as it seems more
robust compared to relying on a string parsing script in the pipeline
itself

download-apis:
- update such that it only downloads "latest-v*.tar.gz" instead of the
main branch artifacts
2024-11-18 15:30:43 -08:00
Craig Macomber (Microsoft) 25d389a67f
Release notes for 2.10 (#23130)
## Description

Generate release notes with:

`pnpm exec flub generate releaseNotes -g client -t minor --out
RELEASE_NOTES/2.10.0.md`
2024-11-18 15:22:42 -08:00
Craig Macomber (Microsoft) eefaaf3c2a
Tag asserts for release (#23128)
## Description

Tag asserts for release
2024-11-18 22:00:04 +00:00
Jason Hartman c6559be1a6
fix(client-presence): restore initial state values (#23127)
Corrects regression from #23120
2024-11-18 21:20:32 +00:00
Jenn da348bb19e
fix(tree): do not fire changed event for rebases on branches (#23125)
This makes it so that changed events are not fired when rebases happen
on branches that are not the main branch and also adds a regression test
for this scenario. Rebases that happen on the main branch are remote
changes and therefore correct.
2024-11-18 20:56:09 +00:00
daesunp 87261f6a83
chunked forest memory benchmark tests (#23007)
## Description

Adds memory benchmark tests for initializing different types of trees
for chunked forest.

Currently the `defaultChunkPolicy` is being used during initialization,
which defaults to a polymorphic shape. Once this is resolved, the memory
benchmarks should see much better performance for chunked forest.

### SharedTree Memory Usage - Array of Monomorphic Leaves

| Status | Name | Total Time (s) | Heap Used Avg | Heap Used StdDev |
Margin of Error | Relative Margin of Error | Iterations |

|--------|---------------------------------------------------|----------------|----------------|-------------------|----------------|---------------------------|------------|
| ✔ | Initialize 1 nodes into tree using ObjectForest | 6.29 |
236,784.95 | 27,567.46 | ±5,895.40 | ±2.49% | 88 |
| ✔ | Initialize 1 nodes into tree using ChunkedForest | 4.07 |
198,545.04 | 18,408.64 | ±4,909.99 | ±2.47% | 57 |
| ✔ | Initialize 10 nodes into tree using ObjectForest | 3.54 |
205,398.64 | 6,858.28 | ±1,960.75 | ±0.95% | 50 |
| ✔ | Initialize 10 nodes into tree using ChunkedForest | 3.56 |
205,955.57 | 17,454.18 | ±4,990.07 | ±2.42% | 50 |
| ✔ | Initialize 100 nodes into tree using ObjectForest | 7.98 |
296,463.31 | 35,117.96 | ±6,749.45 | ±2.28% | 110 |
| ✔ | Initialize 100 nodes into tree using ChunkedForest| 3.63 |
332,212.26 | 24,223.60 | ±6,925.42 | ±2.08% | 50 |
| ✔ | Initialize 1000 nodes into tree using ObjectForest| 3.76 |
1,250,473.70 | 101,907.43 | ±29,134.86 | ±2.33% | 50 |
| ✔ | Initialize 1000 nodes into tree using ChunkedForest| 3.83 |
1,644,462.98 | 3,907.74 | ±1,117.20 | ±0.07% | 50 |

---

### SharedTree Memory Usage - Array of Polymorphic Leaves

| Status | Name | Total Time (s) | Heap Used Avg | Heap Used StdDev |
Margin of Error | Relative Margin of Error | Iterations |

|--------|---------------------------------------------------|----------------|----------------|-------------------|----------------|---------------------------|------------|
| ✔ | Initialize 1 nodes into tree using ObjectForest | 3.61 |
222,729.19 | 6,744.83 | ±1,928.32 | ±0.87% | 50 |
| ✔ | Initialize 1 nodes into tree using ChunkedForest | 3.56 |
198,200.85 | 5,705.92 | ±1,631.30 | ±0.82% | 50 |
| ✔ | Initialize 10 nodes into tree using ObjectForest | 5.01 |
200,724.97 | 19,817.98 | ±4,781.27 | ±2.38% | 70 |
| ✔ | Initialize 10 nodes into tree using ChunkedForest | 5.07 |
207,667.39 | 12,572.93 | ±3,033.34 | ±1.46% | 70 |
| ✔ | Initialize 100 nodes into tree using ObjectForest | 3.62 |
299,202.55 | 10,332.74 | ±2,954.08 | ±0.99% | 50 |
| ✔ | Initialize 100 nodes into tree using ChunkedForest| 5.10 |
338,058.06 | 3,393.39 | ±818.69 | ±0.24% | 70 |
| ✔ | Initialize 1000 nodes into tree using ObjectForest| 3.74 |
1,270,979.74 | 17,797.32 | ±5,088.17 | ±0.40% | 50 |
| ✔ | Initialize 1000 nodes into tree using ChunkedForest| 3.88 |
1,639,710.13 | 43,026.98 | ±12,301.22 | ±0.75% | 50 |

---

### SharedTree Memory Usage - Array of Deep Monomorphic Leaves

| Status | Name | Total Time (s) | Heap Used Avg | Heap Used StdDev |
Margin of Error | Relative Margin of Error | Iterations |

|--------|---------------------------------------------------|----------------|----------------|-------------------|----------------|---------------------------|------------|
| ✔ | Initialize 1 nodes into tree using ObjectForest | 3.77 |
241,242.72 | 19,135.28 | ±5,470.69 | ±2.27% | 50 |
| ✔ | Initialize 1 nodes into tree using ChunkedForest | 3.56 |
216,456.17 | 11,844.90 | ±3,386.40 | ±1.56% | 50 |
| ✔ | Initialize 10 nodes into tree using ObjectForest | 3.66 |
350,359.83 | 5,682.95 | ±1,624.73 | ±0.46% | 50 |
| ✔ | Initialize 10 nodes into tree using ChunkedForest | 3.69 |
338,993.87 | 9,305.82 | ±2,660.49 | ±0.78% | 50 |
| ✔ | Initialize 100 nodes into tree using ObjectForest | 5.53 |
1,700,227.76 | 155,393.86 | ±37,490.22 | ±2.21% | 70 |
| ✔ | Initialize 100 nodes into tree using ChunkedForest| 8.95 |
1,556,630.92 | 193,734.91 | ±37,234.65 | ±2.39% | 110 |
| ✔ | Initialize 1000 nodes into tree using ObjectForest| 11.03 |
15,515,518.13 | 5,076.09 | ±1,451.23 | ±0.01% | 50 |
| ✔ | Initialize 1000 nodes into tree using ChunkedForest| 12.95 |
13,930,719.83 | 2,269.00 | ±648.70 | ±0.00% | 50 |

---
2024-11-18 11:51:30 -08:00
Jason Hartman e3c4816e56
feat(client-presence): broadcast control defaults (#23120)
- `BroadcastControls` replace `LatestValueControls`
- `BroadcastControls` maybe specified on `PresenceStates` thru new
`controls` property as defaults for all value managers.
- `PresenceNotifications` redeclared apart from `PresenceStates` to
avoid `controls` exposure. Also yields better API documentation.
- `allowableUpdateLatencyMs` was renamed from `allowableUpdateLatency`
to clarify units are milliseconds. Specifying this value currently has
no effect.
- Unsupported `forcedRefreshInterval` has been removed until
implementation is closer.
2024-11-18 11:24:13 -08:00
Joshua Smithrud 233bcc4c08
style(docs): Format docs content with prettier (#23118)
Also makes some line-wrapping adjustments in accordance with [our
guidelines](https://github.com/microsoft/FluidFramework/wiki/Markdown-Best-Practices#line-breaks-along-sentence-boundaries).

I discovered while auditing the prettier output that prettier does not
seem to be able to handle some aspects of JSX syntax in .mdx files.
Specifically, comments. I've filed
[AB#24430](https://dev.azure.com/fluidframework/internal/_workitems/edit/24430)
to track investigations to make this work correctly.
2024-11-18 11:06:25 -08:00
Tony Murphy 53dd76c2c5
Remove Unnecessary Heading from Changeset (#23123)
The first line of a changeset shouldn't be unformatted. This change
removes an unnecessary heading from a this changeset.
2024-11-18 10:44:12 -08:00
Tony Murphy 67b5e4dca8
Enable Synchronous Child Datastore Creation (#22962)
## Overview

This feature introduces a new pattern for creating datastores
synchronously within the Fluid Framework. It allows for the synchronous
creation of a child datastore from an existing datastore, provided that
the child datastore is available synchronously via the existing
datastore's registry and that the child's factory supports synchronous
creation. This method also ensures strong typing for the consumer.

In this context, "child" refers specifically to the organization of
factories and registries, not to any hierarchical or hosting
relationship between datastores. The parent datastore does not control
the runtime behaviors of the child datastore beyond its creation.

The synchronous creation of child datastores enhances the flexibility of
datastore management within the Fluid Framework. It ensures type safety
and provides a different way to manage datastores within a container.
However, it is important to consider the overhead associated with
datastores, as they are stored, summarized, garbage collected, loaded,
and referenced independently. This overhead should be justified by the
scenario's requirements.

Datastores offer increased capabilities, such as the ability to
reference them via handles, allowing multiple references to exist and
enabling those references to be moved, swapped, or changed.
Additionally, datastores are garbage collected after becoming
unreferenced, which can simplify final cleanup across clients. This is
in contrast to subdirectories in a shared directory, which do not have
native capabilities for referencing or garbage collection but are very
low overhead to create.

Synchronous creation relies on both the factory and the datastore to
support it. This means that asynchronous operations, such as resolving
handles, some browser API calls, consensus-based operations, or other
asynchronous tasks, cannot be performed during the creation flow.
Therefore, synchronous child datastore creation is best limited to
scenarios where the existing asynchronous process cannot be used, such
as when a new datastore must be created in direct response to
synchronous user input.

## Key Benefits

- **Synchronous Creation**: Allows for the immediate creation of child
datastores without waiting for asynchronous operations.
- **Strong Typing**: Ensures type safety and better developer experience
by leveraging TypeScript's type system.

## Use Cases

### Example 1: Creating a Child Datastore

In this example, we demonstrate how to support creating a child
datastore synchronously from a parent datastore.

```typescript
/**
 * This is the parent DataObject, which is also a datastore. It has a
 * synchronous method to create child datastores, which could be called
 * in response to synchronous user input, like a key press.
 */
class ParentDataObject extends DataObject {
	get ParentDataObject() {
		return this;
	}
	protected override async initializingFirstTime(): Promise<void> {
		// create synchronously during initialization
		this.createChild("parentCreation");
	}

	createChild(name: string): ChildDataStore {
		assert(
			this.context.createChildDataStore !== undefined,
			"this.context.createChildDataStore",
		);
		// creates a detached context with a factory who's package path is the same
		// as the current datastore, but with another copy of its own type.
		const { entrypoint } = this.context.createChildDataStore(
			ChildDataStoreFactory.instance,
		);
		const dir = this.root.createSubDirectory("children");
		dir.set(name, entrypoint.handle);
		entrypoint.setProperty("childValue", name);

		return entrypoint;
	}

	getChild(name: string): IFluidHandle<ChildDataStore> | undefined {
		const dir = this.root.getSubDirectory("children");
		return dir?.get<IFluidHandle<ChildDataStore>>(name);
	}
}
```

For a complete example see the follow test:

https://github.com/microsoft/FluidFramework/blob/main/packages/test/local-server-tests/src/test/synchronousDataStoreCreation.spec.ts

---------

Co-authored-by: Matt Rakow <ChumpChief@users.noreply.github.com>
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
2024-11-18 18:43:40 +00:00
Mark Fields cfaa1deca8
Offline: Add recent batch info from DuplicateBatchDetector to summary (#22454)
We've added a new data structure for tracking "recent" (based on MSN)
batchIds which are at risk for seeing a duplicate sequence batchID come
in. This data structure is consulted and modified on each incoming
batch.

Whenever we summarize, we need to include this state as of the given
sequence number, and when we load from a snapshot we need to repopulate
it as well.

Why? Because summaries can happen at any time, and a future container
loading from that point will need to know the recent batch IDs that may
possibly be followed by a sequenced duplicate.

---------

Co-authored-by: Kian Thompson <102998837+kian-thompson@users.noreply.github.com>
2024-11-18 10:39:42 -08:00
Joshua Smithrud 0b6d14fe51
build(docs): Move static webapp config (#23116)
Publishing step needs this config to live in the build output directory.
Placing it under `static` ensures it is copied to the right place.

See https://github.com/Azure/static-web-apps/issues/1071 for more
details.

Confirmed that the swa-cli is able to find this when run locally. This
is also how the site was setup previously, I was just misled by the
documentation leading me to believe that moving it to the root was okay.
It also worked using the local swa-cli tooling 🤷‍♂️
2024-11-15 23:23:56 +00:00
Joshua Smithrud 74cb3f7a83
build(docs): Make all deps dev (#23115)
Since this isn't a package that we publish, none of the deps need to be
non-dev.
2024-11-15 15:02:06 -08:00
Joshua Smithrud cbe61192be
build(devtools-browser-extension): Update extension name to omit the " (preview)" postfix (#23109)
The extension was previously bumped to 1.0.0, so this postfix should
have been removed.
2024-11-15 22:58:56 +00:00
Joshua Smithrud ac5883c8b7
ci(docs): Fix build location (#23114)
Pipeline still had a couple lingering references to the "public"
directory, but the new Docusaurus site outputs to "build".
2024-11-15 22:22:27 +00:00
Alex Villarreal dc9b5ee9b8
refactor: Update mermaid to address GitHub advisory (#23112)
## Description

Update mermaid to address
https://github.com/advisories/GHSA-m4gq-x24j-jpmf.
2024-11-15 22:19:37 +00:00
Joshua Smithrud fca3fc4215
test(docs): Disable test (#23111)
Fixing this is tracked by
[AB#24415](https://dev.azure.com/fluidframework/internal/_workitems/edit/24415)
2024-11-15 21:56:35 +00:00
Jenn 155a7e573a
test(tree): event test clean up (#23101)
moves some event tests to tree view test file and changes them to be
less undo redo focused
2024-11-15 13:28:35 -08:00
Craig Macomber (Microsoft) 30c7392704
Tag asserts for release (#23107)
## Description

Tag asserts for release using `pnpm exec flub release -g client`
2024-11-15 13:24:52 -08:00
Tony Murphy d54b9dde14
SharedString DDS annotateAdjustRange (#22751)
This update introduces a new feature to the `SharedString` DDS, allowing
for the adjustment of properties over a specified range. The
`annotateAdjustRange` method enables users to apply adjustments to
properties within a given range, providing more flexibility and control
over property modifications.

An adjustment is a modification applied to a property value within a
specified range. Adjustments can be used to increment or decrement
property values dynamically. They are particularly useful in scenarios
where property values need to be updated based on user interactions or
other events. For example, in a rich text editor, adjustments can be
used for modifying indentation levels or font sizes, where multiple
users could apply differing numerical adjustments.

### Key Features and Use Cases:
- **Adjustments with Constraints**: Adjustments can include optional
minimum and maximum constraints to ensure the final value falls within
specified bounds. This is particularly useful for maintaining consistent
formatting in rich text editors.
- **Consistent Property Changes**: The feature ensures that property
changes are consistent, managing both local and remote changes
effectively. This is essential for collaborative rich text editing where
multiple users may be making adjustments simultaneously.
- **Rich Text Formatting**: Adjustments can be used to modify text
properties such as font size, indentation, or other formatting
attributes dynamically based on user actions.

### Configuration and Compatibility Requirements:
This feature is only available when the configuration
`Fluid.Sequence.mergeTreeEnableAnnotateAdjust` is set to `true`.
Additionally, all collaborating clients must have this feature enabled
to use it. If any client does not have this feature enabled, it will
lead to the client exiting collaboration. A future major version of
Fluid will enable this feature by default.

### Usage Example:
```typescript
sharedString.annotateAdjustRange(start, end, {
    key: { value: 5, min: 0, max: 10 }
});
```


[AB#11819](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/11819)

---------

Co-authored-by: Tyler Butler <tylerbu@microsoft.com>
2024-11-15 13:21:18 -08:00
Joshua Smithrud 65d9ac3dc3
feat(docs): Replace Hugo with Docusaurus (#22990)
# Docusaurus

Updates the website (/docs) to leverage
[Docusaurus](https://docusaurus.io/) in place of Hugo as its static site
generator.

## Functional changes

### Versioning

The existing Hugo-based site only has a partial versioning story.
The API docs are versioned, but the rest of the content isn't.
This creates a messy story where our hand-written docs likely only
discuss topics related to the current version, and we have no place to
put docs discussing earlier versions.
Or, even worse, we have a mixed bag of documentation for different
versions, creating a very unclear user story.

This prototype includes an end-to-end versioning story, [automated by
Docusaurus](https://docusaurus.io/docs/versioning).
Current (v2) docs live under `docs`.
Old (v1) docs live under `versioned_docs/version-1`.

Most of the documentation has been duplicated between the two versions,
but some minor changes have been made to make the docs better line up
with the corresponding version of the API.
These changes should be reviewed before being merged into main /
deploying the new website.

### Search

This branch includes an offline implementation of search.
An offline solution comes with some downsides (slower build, larger
bundle), and probably isn't what we want long term.
That said, it is much better than what our current website has (no
search whatsoever).

We should come back to this after v1 of our new website.

---------

Co-authored-by: Wayne Ferrao <wayneferrao@microsoft.com>
2024-11-15 21:04:34 +00:00