-
Notifications
You must be signed in to change notification settings - Fork 562
refactor(tree): Update table schema classes to leverage private class members #25888
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CraigMacomber
approved these changes
Nov 17, 2025
anthony-murphy-agent
pushed a commit
to anthony-murphy-agent/FluidFramework
that referenced
this pull request
Jan 14, 2026
… members (microsoft#25888) Also extracts static method `assertValidRange` and leaves a TODO for future deduplication.
anthony-murphy
added a commit
to anthony-murphy/FluidFramework-1
that referenced
this pull request
Jan 14, 2026
* fix cross test issue
* all tests passing
* Update allowed-types-rollout.mdx file to use beta APIs (#25871)
## Description
This PR updates the `allowed-types-rollout.mdx` to use beta APIs
* ci: stop running e2e real service tests on lts (#25884)
Tests have been failing for some time, and we are decommissioning the
backing environment. I also disabled it for `next` since we haven't used
that branch in a long time, and if we bring it back, we'd want to
control the enabling of pipelines like this anyway.
* refactor(tree): Update table schema classes to leverage private class members (#25888)
Also extracts static method `assertValidRange` and leaves a TODO for future deduplication.
* Centralize test exception validation logic (#25882)
## Description
Tree's exception validation test logic was nice enough it got copies
twice into other places, which were then not updated as it was improved.
This is silly. Instead of duplication, we can have code sharing. This
deduplicates the code, and establishes a plan for a follow-up to update
validateAssertionError to match the cleaner API for validateUsageError.
experimental/tree has been updated to the validateAssertionError2 API to
show what its usage looks like. Larger changes to more likely to
conflict parts of the codebase will follow if this is approved.
* FieldKind cleanup (#25869)
## Description
Refactors to cleanup FlexFieldKind and its implementations.
* test(local-server-stress-tests): Remove ordered-collection from local server stress tests (#25891)
## Description
This PR removes `ConsensusOrderedCollection` from the local server
stress test suite. The `setTimeout` workaround seems to not prevent the
issue of the container being left in a dirty state, and CI is failing
non-deterministically. For now we can remove
`ConsensusOrderedCollection` from the local server stress test suite.
* Migrate most use of validateAssertionError to validateAssertionError2 (#25890)
## Description
Part of removing the old validateAssertionError.
* Add property binding to tree-agent (#25870)
## Description
This PR allows tree-agent to expose properties to the llm.
* tree: remove unsupported codecs (#25893)
## Description
Removes reading and writing capabilities for the following formats:
* EditManager: v1, v2
* Message: vUndefined, v1, v2
* SharedTreeChangeFormatVersion: v1, v2
* ModularChangeFormatVersion: v1, v2
* OptionalChangeset: v1
* SequenceChangeset: v1
Removing these formats reduces the package size and reduces the burden
of maintenance when introducing new in-memory representations.
## Breaking Changes
* Removes `SharedTreeFormatVersion` (exposed as alpha). It no longer
serves a purpose (and should have been removed with
https://github.com/microsoft/FluidFramework/pull/25752)
* Summaries and ops with `SharedTreeFormatVersion.v1` or
`SharedTreeFormatVersion.v2` configurations are no longer loadable (a
usage error explaining as much will be thrown). This is not expected to
cause issues because such formats were only used by default prior to
releasing FF 2.0 and have only been usable since through alpha APIs. We
do not know of any customer (1st or 3rd party) that depends on such
formats.
* build(server): upgrade eslint config and add compatibility workarounds (#25892)
* ConfigMap related cleanup and refactors (#25868)
## Description
This adjust several ConfigMap related internal APIs and behaviors,
making the code more strict about input and outputs.
* Simple to stored fixes and cleanup (#25899)
## Description
The new alpha APIs for handling simple schema as stored schema did not
work correctly for staged schema when the simple schema was not
implemented by a full view schema.
[AB#53901](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/53901)
Now that all the information needed to translate to stored schema is
present on simple schema (Including the SchemUpgrade toke added in this
change), it is possible to deduplicate the two code paths for simple
schema to stored schema. This change does this deduplication, and also
fixes the remaining code path to handle staged schema correctly.
Additionally, much more testing for this has been added.
* Remove old validateAssertionError (#25898)
## Description
Remove old validateAssertionError
* refactor(tree): Extract array index validation helpers into shared location and use in table schema APIs (#25896)
Also updates messaging to provide more information about invalid indices
/ ranges.
* Split out getConfigForMinVersionForCollab, add use of it in tree fixing 5 instances of a bug (#25900)
## Description
Expose getConfigForMinVersionForCollab.
Use it in tree fixing that clientVersionToDetachedFieldVersion and 4
other similar cases in tree codecs that did not compare version strings
correctly (used lexical string ordering, which would put 2.6.0 ahead of
2.52.0, enabling the new format when it should be disabled.
## Reviewer Guidance
The review process is outlined on [this wiki
page](https://github.com/microsoft/FluidFramework/wiki/PR-Guidelines#guidelines).
* test(local-server-stress-tests): Re-enable ConsensusOrderedCollection in local server stress tests (#25894)
## Description
This PR re-enables `ConsensusOrderedCollection` in local server stress
tests after being disabled in
https://github.com/microsoft/FluidFramework/pull/25891.
To validate, I ran the local server stress test suite (seed 152 only) in
a loop 500 times locally. With the old code (from
https://github.com/microsoft/FluidFramework/pull/25829), it would fail
consistently at some point in the loop. With the code in this PR it
passed all 500 times.
## Misc
[AB#53802](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/53802)
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* (compat) Updated build-tools to check that layer generation is updated during release (#25873)
Added a new check function that will run during a release. For minor and
patch releases, it will check the generation for layer compat has been
updated before releasing and bumping versions. The check function runs
the `pnpm run -r layerGeneration:gen` command and if there are any
changes, prompts to commit them before proceeding with the release. This
is similar to how type tests and release notes are updated.
Follow up to https://github.com/microsoft/FluidFramework/pull/25670 and
https://github.com/microsoft/FluidFramework/pull/25835.
[AB#51927](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/51927)
* build(client): tag asserts for 2.73.0 (#25906)
Tag asserts for the 2.73.0 release.
* build(client): generate release notes and changelogs for 2.73.0 (#25908)
Generate release notes for 2.73.0.
Commands used:
```
pnpm flub generate releaseNotes -g client -t minor --outFile RELEASE_NOTES/2.73.0.md
pnpm flub vnext generate changelog -g client
```
* Add unit tests for annotating a single multi-character segment (#25901)
Ensure that single segments with more than one character do not get
split when the full range is annotated.
[AB#51785](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/51785)
* build(client): bump to 2.74.0 (#25910)
Bumps client release group to 2.74.0.
Command used:
```
pnpm -r --include-workspace-root exec npm pkg set version=2.74.0
pnpm build --worker
```
* fix(gitrest): Remove object-sizeof in summary size checks (#25912)
## Description
This PR removes the use of `object-sizeof` from the summary size check
flow.
## Context
The [object-sizeof](https://www.npmjs.com/package/object-sizeof) library
has serious sizing inconsistencies, and has shown performance issues
with large data sizes.
Using the current dependency version of object-sizeof (1.6), we can see
a string of length 13 ("Hello, World!") shows up drastically different
in a few scenarios:
```plaintext
Original string length: 13 // str.length
Sizeof original string: 26 bytes
Original buffer length: 13 // buffer.bytelength
Sizeof original buffer: 2186 bytes
Compressed string length: 21 // using Pako.deflate
Sizeof compressed string: 232 bytes
Compressed buffer length: 21 // using Pako.deflate
Sizeof compressed buffer: 232 bytes
```
Even after upgrading to object-sizeof v2.6, we can see some oddities
```plaintext
Original string length: 13 // str.length
Sizeof original string: 28 bytes
Original buffer length: 13 // buffer.bytelength
Sizeof original buffer: 13 bytes
Compressed string length: 21
Sizeof compressed string: 21 bytes
Compressed buffer length: 21
Sizeof compressed buffer: 21 bytes
```
Sizeof is known to do _some_ amount of internal multipliers to align
sizes with ECMA storage values and memory allocation. For our use-case,
we want storage-size, and we have the ability to use built-in size
checks to achieve that.
* feat(server): add limits param to Nexus' session pruning (#25914)
## Description
In some scenarios, Nexus' session pruning will attempt to iterate over
too many sessions, causing a timeout or limit errors. We should allow
pre-emptively limiting the amount of sessions to retrieve from storage.
---------
Co-authored-by: zhangxin511 <xin.zhang511@gmail.com>
* docs(tree): Fix grammar and improve readability (#25913)
## Description
Fixes a grammatical mismatch (documents -> is) and a missing word.
## Reviewer Guidance
The review process is outlined on [this wiki
page](https://github.com/microsoft/FluidFramework/wiki/PR-Guidelines#guidelines).
* security: Update glob depdencies to 10.5.0 (#25920)
## Description
This PR updates our `glob` depdencies to `10.5.0` to avoid using
`10.4.5` which has security vulnerabilities. Since all
consumers of `10.4.5` are able to use `10.5.0`, we only need to update
the lockfiles.
To do so I did the following:
1. Add a pnpm override to use `glob@10.5.0`
2. Run `pnpm i --no-frozen-lockfile`
3. Remove the override
4. Run `pnpm i --no-frozen-lockfile` again
This results in the lock file no longer referencing the `10.4.5`
version.
## Misc
[AB#53799](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/53799)
* refactor(eslint-plugin-fluid): Simplify test infra (#25916)
Renames test modules, test-cases directory, and removes unneeded folder
hierarchy.
* build(deps): update oclif and related plugins (#25922)
This PR updates oclif and related plugins to their latest versions:
- Update @oclif/core from ^4.0.30 to ^4.8.0
- Update oclif from ^4.15.16 to ^4.22.50
- Update @oclif/plugin-autocomplete from ^3.2.7 to ^3.2.39
- Update @oclif/plugin-commands from ^4.1.5 to ^4.1.38
- Update @oclif/plugin-help from ^6.2.16 to ^6.2.36
- Update @oclif/plugin-not-found from ^3.2.24 to ^3.2.73
- Update @oclif/test from ^4.1.0 to ^4.1.15
* build(client): update typetest baselines to 2.73.0 (#25865)
Commands used:
```
pnpm exec flub typetests -g client --reset --normalize --previous
pnpm install --no-frozen-lockfile
pnpm run build
```
* build(build-tools): update dependencies (#25926)
* fix(eslint-plugin-fluid): `no-hyphen-after-jsdoc-tag` rule (#25923)
The RegEx used to implement this rule was overly permissive and yielded
lots of false positives. This PR updates the rule to leverage the TSDoc
parser directly to extract block tags/comments and evaluate them
explicitly.
Unfortunately, this makes it harder to implement auto-fix behavior, so
that has been removed.
[AB#50920](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/50920)
* build(eslint-config-fluid): update @typescript-eslint to v8 (#25663)
Updates @typescript-eslint packages from v7 to v8 with necessary rule
migrations and configuration adjustments.
## Changes
- Update @typescript-eslint/eslint-plugin and @typescript-eslint/parser
to v8
- Migrate rule: `no-throw-literal` → `only-throw-error`
- Remove deprecated and deleted rules: `ban-types`,
`no-empty-interface`, and others
- I removed all typescript-eslint rules that are deleted or deprecated.
This resulted in some trivial changes to the config of some rules
(rulesets often keep the old, even deleted, rules around for awhile
"just in case" -- they just set them to "off" -- so we'll still see them
in the printed configs).
- Update codebase for new rule requirements (explicit returns, type
annotations)
## Test plan
- CI passes with updated ESLint configuration
- All lint errors resolved across codebase
* (tree) Tag incremental summary APIs as @alpha (#25918)
The APIs neede to enable incremental summary have been tagged as @ alpha
so that they can be used by applications.
The list of APIs that are marked @ alpha:
- `configuredSharedTreeAlpha` - This is a new API which is similar to
`configuredSharedTreeBeta` but has a couple more options exposed for
configuring incremental summaries.
- `SharedTreeOptionsAlpha` - Extension of `SharedTreeOptionsBeta` that
includes options to enable incremental summarization.
- `IncrementalEncodingPolicy` - Policy type to determine whether a node
/ field should be incrementally encoded.
- `incrementalEncodingPolicyForAllowedTypes` - This function returns an
`IncrementalEncodingPolicy` which will determine if `AllowedTypes` are
opted into incremental summarization.
- `incrementalSummaryHint` - This is a symbol that should be put in the
metadata property of `AllowedTypes` to opt-in these types to be
incrementally summarized.
[AB#54252](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/54252)
[AB#46028](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/46028)
* Move StageTrace to services-core and add UTs (#25929)
## Description
There are several locations that we need/want to use `StageTrace`. It
should live in a shared location to facilitate that. This takes the move
from #25643 into its own PR.
## Breaking Changes
Not technically breaking: moves internal `StageTrace` API from Nexus and
R11s-base utils into `services-core`
## Reviewer Guidance
I'm open to moving this to `services-client`, but I think this is fine.
* fix(directory): Add clearInternal event and mark it as internal (#25927)
The standard clear event has the below limitation. It does not tell you
which subdirectory was cleared.
- It's emitted on the root SharedDirectory for all clear operations
- But it does NOT include the path of which directory was cleared
The event only provides:
- local: Whether it was a local or remote operation
- target: SharedDirectory itself
This limitation came to notice while adding event testing for directory:
https://github.com/microsoft/FluidFramework/pull/25477. The oracle needs
to track the state of every directory in the tree (root and all
subdirectories). When a clear operation happens:
- Without path information: The oracle would have to clear ALL
directories in its model, even though only one specific directory was
cleared
- Can't distinguish: A clear on /subdir1 vs /subdir2 vs root (/) would
all look the same
This change adds a new event `clearInternal` which takes in the absolute
path and it is marked as internal.
[AB#54326](https://dev.azure.com/fluidframework/internal/_workitems/edit/54326)
* build(docs): Update `@fluid-tools/api-markdown-documenter` (#25889)
Updates API docs infra to accommodate API changes in the library. Most
notably: custom transformation logic now targets
[mdast](https://github.com/syntax-tree/mdast) directly, rather than the
bespoke documentation tree representation that has been removed from the
library.
Also picks up some misc. fixes for API docs generation that have been
made in the documenter library.
* fix(eslint-plugin-fluid): Fix false-positives in `no-markdown-links-in-jsdoc` (#25930)
Also bumps package version for publishing.
[AB#51719](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/51719)
* fix(api-markdown-documenter): Fixed an issue where `MarkdownRenderer` would emit trailing `\` characters when processing certain summary comments. (#25933)
The issue here is somewhat complicated. The following is an attempt to
provide a high-level-ish overview of what's going on.
## The Problem
Keeping the description at a high-level, `CommonMark` specifies 2 ways
to force an explicit line break: either ending a line with 2 spaces or
ending a line with a backslash.
- https://commonmark.org/help/tutorial/03-paragraphs.html
`mdast-util-to-markdown`, the library we use to emit prefers the latter,
as it is more explicit.
In most cases, this is irrelevant, and Markdown parsers that adhere to
`CommonMark` should tolerate this. Docusaurus doesn't appear to, causing
spurious trailing backslash characters to appear in *some* of our API
documentation. E.g.
https://fluidframework.com/docs/api/fluid-framework/allowedtypesfullevaluated-typealias
But our library shouldn't need to output forced line breaks. We build
our Markdown AST trees manually, and so we control the output structure.
We generally avoid explicit line breaks, and instead use `Paragraph`
nodes when separating blocks of text.
But for contents parsed by `TSDoc`, we _transform_ their parsed content,
making certain assumptions about how the parser behaves.
The case that was causing problems for us is a case where `TSDoc` fails
to trim trailing whitespace from comment blocks (generally this
manifests in the summary component). In particular, when a summary
comment is followed by 2 or more modifier tags on a subsequent line,
TSDoc fails to trim the summary comment, yielding something with
trailing explicit line breaks.
### Example
Given the following comment:
```typescript
/**
* I am a comment
*
*/
```
The TSDoc parser will yield a summary block of `I am a comment`
But given the following comment:
```typescript
/**
* I am a comment
*
* @sealed @public
*/
```
The TSDoc parser will yield a summary block of `I am a comment \n`
## The Solution
The solution is to better trim paragraph contents given to us from the
`TSDoc` parser. Previously, we would trim any leading/trailing line
breaks we encountered. Now, we also trim and leading/trailing whitespace
content.
This simplifies the Paragraph trees we hand off to
`mdast-util-to-markdown`, removing the need for them to inject trailing
`\` characters to force line breaks.
[AB#53737](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/53737)
* improvement(eslint-plugin-fluid): Implement auto-fix for `no-hyphen-after-jsdoc-tag` rule and give better range info (#25935)
Now reports the text range containing the hyphen character and
surrounding whitespace, rather than the range containing the TSDoc tag.
Also implements auto-fix behavior (replacing hyphen character and
surrounding whitespace with a single space).
* build(docs): Update dependency on `api-markdown-documenter` (#25937)
Picks up a bug fix for
[AB#53737](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/53737)
* ci: update some actions to the latest version (#25857)
Updates the following actions to their latest versions:
- actions/github-script
- actions/labeler
- actions/download-artifact
- actions/upload-artifact
- beatlabs/delete-old-branches-action
- dawidd6/action-download-artifact
- errata-ai/vale-action
- Lehoczky/render-nunjucks-template-action
- marocchino/sticky-pull-request-comment
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor(gitrest): Add stage traces to the Git write summary flow (#25954)
## Description
After some recent difficulties in narrowing down performance issues in
the summary flow, this PR takes the first step to making that easier in
the future by adding stage traces to the summary flow. This will allow
us to more easily analyze where a problem is occurring.
## Reviewer Guidance
Bumped server package versions to consume newly shared `StageTrace` from
services-core
* Improve tree-agent TS rendering (#25902)
* Removed intermediate zod transformation from the main TS output
computation. Some processing of zod is still necessary for methods and
properties defined on the schema. These may be updated via an API change
in a later PR.
* Factored TS rendering into its own file
* Readonly properties are now marked as `readonly` rather than merely
having a "// readonly" comment
* Comments derived from metadata descriptions are now placed above
members rather than after.
* Note some issues with trackDirtyNodes API (#25949)
## Description
Note some issues which should be sorted out before stabilizing the
trackDirtyNodes APIs.
* Rename and better document allowsTreeSupersetOf (#25897)
## Description
Rename and better document allowsTreeSupersetOf
* Make options optional in independentView (#25939)
## Description
Makes `options` in `independentView` optional to stop having to pass in
`{}` every time.
* (compat) Rename package command layerCompatGeneration to compatLayerGeneration (#25951)
Renamed the package command `layerCompatGeneration` to
`compatLayerGeneration` to make it clearer that this command is for the
compatibility layers and not any other type of layer.
[AB#54418](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/54418)
* build(build-tools): Update dependencies and document limitations (#25928)
Updates build-tools dependencies with the following changes:
**Successfully Upgraded:**
- cosmiconfig: 8.x → 9.x
- change-case: 3.x → 5.x
- minimatch: 7.x → 10.x
- @inquirer/prompts: 7.x → 8.x
- picomatch: 2.x → 4.x
- ignore: 5.x → 7.x
- @fluid-tools/api-markdown-documenter: 0.17.x → 0.23.x
- @microsoft/api-extractor: 7.52.x → 7.55.x
**ESM-Only Dependencies (Cannot Upgrade):**
Multiple dependencies are pinned to older versions because newer
versions are ESM-only and incompatible with the CommonJS codebase:
- type-fest (pinned to ^2.x, latest: ^4.x)
- execa, globby, glob, multimatch, picospinner, read-pkg-up,
replace-in-file, date-fns, @manypkg/get-packages, detect-indent
**ESLint Plugin Migration:**
- Updated configs to use import-x/ rules (plugin renamed from import/)
- Updated inline eslint-disable comments throughout codebase
All changes are documented in DEV.md for future reference.
* refactor(tree): use string version tags for shared-branches formats (#25953)
## Description
* Allows versioned codecs to use string literals as version tags. This
allows strings to be used for format versions that are still in
development (i.e., not officially supported).
* Update codecs and formats that are specific to shared branches so they
use a string version tag.
* Fix the comments on `EditManagerFormatVersion` and
`MessageFormatVersion` members.
## Breaking Changes
Existing documents that were created using a SharedTree instance that
was configured to use shared branches will no longer be loadable.
Cross-version collaboration will fail with earlier clients that are
configured to use shared branches. Note that we did not and still do not
make guarantees about such scenarios.
* Make tree workspace test browser config use esm tests (#25963)
## Description
Adjust test browser config so it shows the esm versions of tests not the
common JS versions. Both should behave the same, but we care more about
ESM as all production use of our package uses ESM, and its generally
more modern with better tooling support and might process slightly
faster.
* bump(build-tools): Bump build-tools packages to 0.62.0 (#25970)
* (tree) Fixed incremental summary not working for map and record nodes (#25946)
Incremental summary / encoding is not working for map and record nodes
even if they are opted in via the schema. This is because the encoder
checks for the opt-in for object nodes only in `getNodeEncoder`.
This change fixes that by checking if incremental encoding is opted in
for map nodes and record nodes (which are also map nodes internally).
Also, updated the tests to validate that all node kinds are correctly
opted into incremental summary.
[AB#54413](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/54413)
* (test) Added support for testing compat versions of packages not available in older versions (#25915)
Currently, the test infra installs packages for older versions (than the
current) that were available in all the older versions that the test
supports, going back to 1.4.0.
This means that we don't get compat testing for packages that are not
available in these older versions. For example, the
"@fluidframework/tree" packages is available from version 2.0.0 onwards.
We would still want compat coverage for SharedTree - layer compat and
cross-client compat with versions that are 2.0.0+.
This change adds support for testing compat for these packages. The
basic idea is to have compat testing going back to the version that
these packages were first available:
1. In the `testApi.ts` file, added a `minVersion` to each package that
is installed by the test infra. The infra will only install the package
if the requested version is >= the `minVersion` for that package. For
`@fluidframework/tree` package, the `minVersion` is 2.0.0.
2. In the `CompatApis` exposed by the test infra, the entry
corresponding to packages that are not installed will be undefined. It
is the responsibility of the tests to ensure that it only runs in valid
compat configurations. For example, the `packages:tree` and `SharedTree`
properties of `dataRuntimeApi` will be undefined in version `1.4.0`. The
tests in `treeCompat.spec.ts` skips running the cross-client compat
tests in this configuration.
3. Added a `mode` property to `CompatApis` which tells whether the test
is running in layer compat, cross-client compat or no compat mode. This
will help tests skip running in certain configurations. The tests in
`treeCompat.spec.ts` uses this to skip running in cross-client compat
mode when one of the client versions is less than 2.0.0.
[AB#54447](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/54447)
* build(client): Remove LTS trigger in Build - client packages (#25966)
#### Description
LTS branch has been failing Real Service Stress Test pipeline since
September 14th, thus disabling the LTS trigger from the `Build - client
packages` until fix is applied.
#### Related PR
[Disable LTS Schedule
Run](https://github.com/microsoft/FluidFramework/compare/lts...test/lts-remove-schedule?expand=1)
* build(bundle-size-tools): replace pako with fflate (#25924)
## Summary
**Replaced `pako` with `fflate` in bundle-size-tools:**
- Removed `pako` and `@types/pako` dependencies
- Added `fflate` (already used in build-cli, consolidates compression
libraries)
- Updated `decompressStatsFile.ts` to use `gunzipSync` from fflate
- **Impact**: Reduced lockfile by 8 lines, removed 2 dev/dependencies
**Added dependency reduction plan document:**
- Created `build-tools/plans/` folder for planning documentation
- Detailed plan covering glob library consolidation opportunities
- Risk assessments and test coverage analysis
- Specific risk reduction steps including:
- Integration test recommendations
- Compatibility wrapper code for glob migration
- Incremental migration approach
* fix(intervalCollection): Fix bugs seen from oracle (#25961)
This PR fixes two bugs which were seen in the oracle testing for
interval collection.
1. Missing `deleteInterval` event when intervals slide off during
rebasing
When an interval slides off the string during rebasing the code was
calling `removeExistingInterval` which removes the interval without
emitting a `deleteInterval` event. The oracle still thinks the interval
exists, causing validation failures.
2. Events emitted for deleted intervals
When an interval has been deleted `latestInterval === undefined`, but
remote ops are still being acknowledged, the code emits events with
undefined as the interval, violating the API contract that says
`interval` must never be undefined.
* Sanitize friendly names for schema identifiers to be valid typescript (#25945)
## Description
This PR sanitizes our friendly names so that they are valid typescript.
For example:
`"com.fluidframework.foo!"` becomes `"foo_"` instead of `"foo!"`
* Revert PR #25915 due to "Full Compat" failures in test pipeline (#25973)
Reverts c0dbe89139ce47140b28af69561757f2ebbd4df5 to
unblock internal test pipelines
* feat(intervalCollection): Add oracle for event testing (#25391)
The oracle maintains a lightweight local snapshot of intervals by
listening to all events emitted by the interval collection (addInterval,
deleteInterval, changeInterval, propertyChanged, changed). It tracks
these events to build an independent view of the intervals' state and
validates that the events are correctly emitted according to the API
contract. The oracle can then compare its snapshot against the actual
collection state to ensure they remain consistent, catching bugs where
events are missing, incorrect, or violate API contracts.
This change also includes an update to intervalCollection.ts wherein the
`changed` event emitted was passing the properyDeltas as undefined which
violates API contract and instead should be an empty object.
* feat(check:policy): include mjs and mts files in header policy (#25975)
Change should be self-explanatory.
* test(build-tools): add glob and gitignore behavior tests (#25955)
## Summary
Adds comprehensive tests for glob and gitignore behavior in build-tools
to de-risk future migration from to .
## Changes
- Extract function from into for testability
- Add tests for wrapper covering wildcards, globstar, , , , , and
options
- Add tests for covering gitignore integration, pattern matching, and
directory exclusion
- Add runtime order randomization for glob tests to ensure consistent
cross-library behavior
- Add test data files for gitignore pattern testing
## Why
These tests document current glob behavior and will verify that the
upcoming migration preserves existing functionality.
---------
Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
* improvement(client-presence): remove deprecated DO based Presence (#25903)
Relocate basic DO support to example that needs some DO to satisfy
non-empty initialObjects requirement.
* (test) Added support for testing compat versions of packages not available in older versions (#25984)
Currently, the test infra installs packages for older versions (than the
current) that were available in all the older versions that the test
supports, going back to 1.4.0.
This means that we don't get compat testing for packages that are not
available in these older versions. For example, the
"@fluidframework/tree" packages is available from version 2.0.0 onwards.
We would still want compat coverage for SharedTree - layer compat and
cross-client compat with versions that are 2.0.0+.
This change adds support for testing compat for these packages. The
basic idea is to have compat testing going back to the version that
these packages were first available:
1. In the `testApi.ts` file, added a `minVersion` to each package that
is installed by the test infra. The infra will only install the package
if the requested version is >= the `minVersion` for that package. For
`@fluidframework/tree` package, the `minVersion` is 2.0.0.
2. In the `CompatApis` exposed by the test infra, the entry
corresponding to packages that are not installed will be undefined. It
is the responsibility of the tests to ensure that it only runs in valid
compat configurations. For example, the `packages:tree` and `SharedTree`
properties of `dataRuntimeApi` will be undefined in version `1.4.0`. The
tests in `treeCompat.spec.ts` skips running the cross-client compat
tests in this configuration.
3. Added a `mode` property to `CompatApis` which tells whether the test
is running in layer compat, cross-client compat or no compat mode. This
will help tests skip running in certain configurations. The tests in
`treeCompat.spec.ts` uses this to skip running in cross-client compat
mode when one of the client versions is less than 2.0.0.
4. Incremented the `revision` for the installed packages so that they
are re-installed and not used from cache.
[AB#54447](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/54447)
* refactor(tinylicious): Fix some linter violations from recommended config (#25983)
Pre-fixes a number of eslint errors relative to our "recommended"
config. This PR does not promote the config itself due to some current
infra issues. It just pre-fixes some violations to make future config
promotion easier.
* feat(eslint-config-fluid): Re-enable `@fluid-internal/fluid/no-hyphen-after-jsdoc-tag` rule (#25948)
Bumps the dependency on `eslint-plugin-fluid` to a version that includes
the associated fixes for that disabled rule and re-enables it.
[AB#50920](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/50920)
* refactor(presence-tracker): Promote eslint config and fix violations (#25986)
Promotes the app's eslint config from "minimal-deprecated" to
"recommended" and fixes resulting violations.
---------
Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
* Shared Tree: Bugfix for `checkCompatibility` in snapshotCompatibilityChecker.ts, additional tests for schema compatibility cases (#25883)
Follow-up for #25861.
## Description
This change fixes a bug in `checkCompatibility` affecting cases where
the view schema passed as `viewWhichCreatedStoredSchema` contained
staged upgrades. The allowed types filter incorrectly specified that
staged types should be include. Additionally, before #25899 the stored
schema conversion did not respect the allowed types filter. The
implementation now use `toInitialSchema` which filters out staged
allowed types.
It also adds tests around a couple interesting compatibility cases:
- Using `allowUnknownOptionalFields` to allow for forward compatibility.
This is the case where the original schema specifies that it can view
content persisted with future schemas whose fields it does not know.
- Staged schema upgrades, which prevent the future schema from viewing
content persisted by the previous schema until the upgrades are applied.
Other:
- Fixed a bug in one of the roundtrip snapshot tests. It was not
actually testing the decoded schema.
---------
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
* Add eslint-plugin-depend to eslint-config-fluid (#25976)
## Description
Adds `eslint-plugin-depend` to the shared ESLint configuration to detect
dependency bloat, redundant polyfills, and packages with
better-maintained alternatives.
**Changes:**
- Added `eslint-plugin-depend@~1.4.0` dependency to `package.json`
- Configured `plugin:depend/recommended` in `base.js` (includes
`native`, `microutilities`, and `preferred` presets)
- Regenerated printed configs to reflect the new plugin
The `depend/ban-dependencies` rule is enabled at error level with known
exceptions configured.
## Reviewer Guidance
The plugin will flag:
- Packages with native JS/Node.js equivalents (e.g., `is-nan` →
`Number.isNaN()`)
- Micro-utilities that could be written inline
- Packages with better-maintained alternatives
Review whether any repository-wide exceptions should be added upfront,
or if we should address violations case-by-case as they appear.
* feat(directory): Add oracle for event testing (#25477)
This change introduces a new oracle SharedDirectoryOracle for validating
ISharedDirectory
event correctness and API contracts. The oracle maintains two separate
models tracking
directory state through different event streams to ensure both event
types report changes
consistently.
Key features:
- Maintains two nested tree models: one tracking valueChanged events
(global), one tracking
containedValueChanged events (per-directory)
- Validates previousValue correctness in events, accounting for
optimistic operations and
post-clear events
- Post-clear events: previousValue has pre-clear value, oracle already
cleared → expected mismatch
- Remote ops with pending local ops: previousValue is sequenced, oracle
is optimistic → expected mismatch
- Validates actual directory state matches oracle models using
validate() method
- Subscribed events:
- valueChanged, containedValueChanged: Track key changes
- clearInternal: Track directory clears
- subDirectoryCreated, subDirectoryDeleted: Track subdirectory lifecycle
- disposed, undisposed: Handle rollback scenarios
Bugs:
[ADO#54515](https://dev.azure.com/fluidframework/internal/_workitems/edit/54515)
* ci: remove routerlicious stage from e2e tests (#25968)
* Add a retry when performing on-demand summary (#25977)
There is currently a race condition around when snapshots become
available for a summarizer. During catching up, a Container may see that
it has a new snapshot it should load from. If so, it will attempt to
load this new snapshot and close the container. See
[ContainerRuntime.fetchLatestSnapshotAndMaybeClose](https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/src/containerRuntime.ts#L5094).
For normal summarizer cases, this is fine as the summarizer will simply
be recreated based on the latest snapshot. But for the on-demand flow,
this may be unexpected behavior from the consumer's perspective. So, we
should attempt a retry in the event that this is the reason the first
on-demand attempt failed.
This was caught via e2e tests against ODSP and FRS consistently failing.
[AB#50569](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/50569)
[AB#50568](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/50568)
* feat(eslint-config-fluid): Add ESLint 9 flat config support (#25934)
This PR adds support for ESLint 9's flat config format to
eslint-config-fluid without requiring any downstream changes.
## Key Changes
- **New flat.mjs module** exports `recommended`, `strict`, and
`minimalDeprecated` configs for ESLint 9
- **FlatCompat wrapper** uses `@eslint/eslintrc` to wrap legacy configs
for backward compatibility
- **Automatic type-aware parsing handling** for JavaScript files and
test files
- **Updated print-configs script** to generate snapshots for flat
configs
- **Wrapper configs** for print-configs in `.eslint-print-configs/`
- **Updated documentation** in README and CHANGELOG
- **Generation script** (`scripts/generate-flat-eslint-configs.ts`) for
creating flat configs
## Benefits
- ✅ **Backward compatible** - consumers can continue using legacy
`.eslintrc.cjs` format
- ✅ **No downstream changes required** - this commit only touches
eslint-config-fluid package
- ✅ **Future-proof** - ready for ESLint 9 when packages choose to
migrate
## Usage
Packages can opt-in to flat config by importing from the new module:
```javascript
// eslint.config.mjs
import { strict } from "@fluidframework/eslint-config-fluid/flat.mjs";
export default [...strict];
```
Or continue using the legacy format - both work!
* Enable undo/redo delete Shared Array ops in fuzz tests and fix rollback bug (#25980)
This PR enables toggling a Shared Array delete op during our fuzz tests.
It achieves it by adding the delete ids list to the possible ops to be
toggled while generating fuzzed ops.
It also fixes an issue when toggling an op that was previously
rollbacked. An op that was previously rollbacked should not be toggled
after that, since rollback ops are meant to behave as if they never
existed. Applications could be trying to toggle such ops given that
every shared array op emits a "revertible" event which applications can
listen to and generate a list of ops that could potentially be reverted.
The solution was adding an optional attribute to the shared array entry
to be able to recognize if such array entry was rollbacked and skip
toggling if that was the case.
After solving that bug, another seed started failing with a different
problem related to rollback while in attaching state that will be
tracked and solved separately.
* fix(azure-e2e-tests): Update ephemeral summary trees to format v3 (#25947)
## Description
This change updates the ephemeral summary trees used in Azure client E2E
tests to use EditManager format version 3 instead of version 2.
The SharedTree ephemeral container tests are consistently failing in our
Service Clients E2E pipeline with the error: `Cannot decode data to
format 2. The codec was discontinued in FF version 2.73.0.`.
The problem here is the ephemeral summary trees in
`ephemeralSummaryTrees.ts` were originally created with Fluid Framework
version 2.0.0-rc.4.0.0 and used EditManager format version 2, which has
been discontinued as of version 2.73.0. The fix here is updating the
EditManager format version from 2 to 3 in the `tree7` and `tree8`
summary trees, which are used by:
- `createContainerWithSharedTree`
- `createLoadContainerWithSharedTree`
I verfied this change by running "test:realsvc:azure" locally to run
these tests against AFR.
## Reviewer Guidance
I see that the removal was done in this
https://github.com/microsoft/FluidFramework/pull/25893. My knowledge of
EditManager codec format versions is limited, but it seems v3 and v2
share the same structure. I verfied this change by manually running the
real service tests but unsure if additional changes would need to made
here as well.
* chore(container-loader): Remove ReportIfTooLong (#25991)
* (tree) Add versioning to shared tree's summary (#25876)
## Description
The summaries written by Shared Tree and its summarizables are not
versioned. Any changes to the summary format can lead to failures in
clients that do not understand this new format. For example, the
incremental summarization feature changes the forest's summary format by
adding more nodes to its summary tree which older clients won't be able
to read. Making this change behind a new version makes it safer as we
can fail fast on seeing unrecognizable versions.
This change adds versioning by adding a metadata blob to the summary
tree of the shared tree and its summarizables. This metadata blob will
contain the format version of the summary. Every time the format of the
summary changes, a new version should be added so that clients that
don't understand this format will fail.
Here's how versioning will be added:
1. The current summaries generation (before this PR) are considered
format version 1.
2. WIth this PR, a metadata blob is written into the summary and thus,
changing the summary format. This summary's format version is 2. This is
fully backwards compatible with version 1 and will not break older
clients.
3. In a future change, the summariables will write format version 3
based on the minVersionForCollab. This version will change the format
such that older clients that read / write version 1 and 2 will fail on
reading version 3. This will be done to ensure that summary format
changes in the future don't silently fail at random places.
4. Any changes to the summary format by a summarizable after this point
should do so with a new format version.
[AB#53723](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/53723)
* Make field kind upgrades monotonic (#25985)
## Description
At the flex-tree abstraction level, the handling of field kind changes
has issues. This change clarifies the two kinds of upgrades we could
allow (the current monotonic approach, and a possible future more
flexible one). This also fixes a bug with never field handling which
allowed some possible upgrade cycles which are supposed to be disallowed
(but in practice are not useful schema and won't be used by the public
API, so should not happen)
* feat(tree): Update table schema identifier pattern (#25956)
Updates the `TableSchema` APIs to generate more expressive / more
explicit schema identifiers.
Previously, table schema would be generated with the following
identifier patterns:
- Column: `user-scope.Column`
- Row: `user-scope.Row`
- Table: `user-scope.Table`
This pattern makes it difficult to distinguish table schema generated by
Fluid Framework APIs from any user-crafted schema. To help
differentiate, and to make it possible for code to pattern match on
Fluid Framework table nodes in the future, the identifier patterns have
been updated as follows:
- Column: `com.fluidframework.table<user-scope>.Column`
- Row: `com.fluidframework.table<user-scope>.Row`
- Table: `com.fluidframework.table<user-scope>.Table`
[AB#53661](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/53661)
* Simple-Schema and to stored refactor (#25962)
## Description
Since simple schema can now contain view schema specific data, but might
also be derived from stored schema, and might also be storing only a
subset of its view specific data that it can hold (like when
snapshotting for compatibility tests) using it is rather error prone.
This refactoring attempts to better clarify what the semantics of a
given simple schema are by allowing them to be typed as either view or
stored, and providing more specific names and docs to the compatibility
snapshotting APIs.
This also refactors how we generate stored schema: now we transform a
simple schema for a view to a simple schema for stored schema, then
convert that to the persisted format. This redesign separates the
concerns for persisted format conversion and the semantics of things
like staged schema which get processes when converting from view to
stored.
This results in some deduplication of logic, and allows all schema
transformation logic to be applied directly to simple-schema.
This change could be followed up with some further changes to better
remove stored schema from the alpha APIs, and replace those APIs with
use of stored-simple-schema and thus shrinking the package API surface
area and making its types more interoperable.
`getUnhydratedContext` has been improved to give better asserts when
uses re-entrantly.
## Breaking Changes
Several stored and simple schema alpha APIs have been impacted, but all
stable APIs should behave as is.
* fix(tree): commit enrichment after transaction abort (#25978)
## Description
Aborting a transaction used to put the tree in a state that would
trigger an assert when sending some undo/redo edits to peers.
This would prevent some undo/redo edits from being sent and would put
the tree in a broken state that prevented any further edits.
This issue could not have caused document corruption, so reopening the
document was a possible remedy.
After this PR, aborting a transaction no longer puts the tree in such a
state, so it is safe to perform undo/redo edits after that.
This bug was due to the fact that `TreeCheckout` overwrote its
`DetachedFieldIndex` member with a new instance when performing a
transaction rollback but had no way of informing the
`SharedTreeReadonlyChangeEnricher` that it should now be reading from
the new instance during change enrichment.
This PR fixes the bug by ensuring that a given `TreeCheckout` instance
always uses the same `DetachedFieldIndex` instance. This requires
introducing a way of snapshotting and (on transaction rollback)
restoring the `DetachedFieldIndex` state that does not require replacing
the instance.
This PR also reduces the `DetachedFieldIndex` API surface made available
to `SharedTreeReadonlyChangeEnricher` by introducing the
`ReadOnlyDetachedFieldIndex` interface. This is not required as part of
this change and could be done in a separate PR.
## Breaking Changes
None
## Reviewer Guidance
Let me know if you think it's worth spinning up a separate PR for the
introduction of `ReadOnlyDetachedFieldIndex`.
* feat(odsp-client): Add OdspContainerServices readonly and sensitivity label event emitters (#25800)
## Description
Portion of #25597 to add read-only state and sensitivity labels events
to OdspContainerServices.
## Reviewer Guidance
I think this PR could be better if it separated read-only events and
sensitivity label events, but it will introduce either merge conflicts
or blocking on either. I think it would be weird to extend
`IEventProvider` without any events, which would allow for async feature
introduction.
* refactor(task-selection): Promote eslint config and fix linter violations (#25994)
Promotes the eslint config from `minimal-deprecated` to `recommended`
and fixes resulting linter violations
* improvement(tree): Update table schema APIs to make underlying data representation safer / more opaque (#25979)
## Data format change
Adds an extra layer to the table tree. The previous structure:
```typescript
{
columns: ListOfColumns;
rows: ListOfRows;
}
```
The new structure:
```typescript
{
table: {
columns: ListOfColumns;
rows: ListOfRows;
}
}
```
This extra root field/node will make future migrations to a new
underlying format easier (we can migrate the node under the `table`
field, rather than requiring the end-user to migrate the entire table
node under its parent field in the application schema).
## API Safety Improvements
Some editing operations on the `columns` and `rows` lists would allow
users to make edits that would violate table invariants. The canonical
example of this is deleting an entry from the `columns` list without
removing corresponding cells from the `rows` list (cells live under
`Row` nodes).
Instead, the `Table` schema offers a series of safe editing APIs for the
table as a whole (e.g., `deleteColumn`, which includes the deletion of
corresponding cells).
But we still wish to surface a subset of list-like editing options for
the two lists. For example, since the ordering of these lists is
intended to be significant, we would like to support rearrangement of
elements within these lists. We would also like for users to be able to
subscribe to shallow change notifications on the lists to learn when
items have been inserted/removed/moved.
`columns` and `rows` have had their typing updated to be more
restrictive (forbidding direct insertion, deletion, and moving items
_between_ lists), while still affording the subset of list functionality
that is safe in terms of table invariants.
* docs(container-definitions): Reserve some keys in IFluidCodeDetailsConfig for framework use (#25641)
## Description
Updates the documentation on `IFluidCodeDetails` and
`IFluidCodeDetailsConfig` to make some string keys in the latter
reserved for Fluid Framework use.
## Breaking Changes
While it could theoretically cause breaking changes, I could not find
evidence of our partners using keys like the ones this PR now makes
reserved; the chances seem pretty low IMO. Furthermore, the scenario for
which we intend to use reserved keys does not apply to existing Fluid
documents, so even if some partner was using keys like these, their
Fluid files would not go through the code that will care about the new
reserved keys (at least not the code we already know of today).
## Reviewer Guidance
The review process is outlined on [this wiki
page](https://github.com/microsoft/FluidFramework/wiki/PR-Guidelines#guidelines).
* test(tree): Update table snapshot test to use stored keys (#25995)
Adds missing test coverage for the API's stored keys representation
(property keys are covered by concise format tests).
* build(eslint-config-fluid): update minor dependencies (#25665)
Update eslint plugins and related dependencies to latest compatible
minor/patch versions.
## Updated Dependencies
- eslint-plugin-jsdoc: ~55.0.2 → ~61.4.1
- eslint-plugin-unicorn: ~48.0.1 → ~54.0.0
- eslint-plugin-tsdoc: ~0.4.0 → ~0.5.0
- @rushstack/eslint-plugin: ~0.19.0 → ~0.22.1
- eslint-plugin-unused-imports: ~4.2.0 → ~4.3.0
- eslint-plugin-react-hooks: ~4.6.0 → ~5.2.0
- @fluid-internal/eslint-plugin-fluid: ^0.4.0 → ^0.4.1
- tsx: ^4.20.6 → ^4.21.0
---------
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
* fix(fluid-build): shared eslint-config-fluid files to EsLintTask cache invalidation (#25997)
## Description
ESLint config changes in the shared
`@fluidframework/eslint-config-fluid` package were not properly
invalidating the eslint task because only the local config file was
tracked.
Extended `configFileFullPaths` in `EsLintTask` to include files from the
shared config:
- **Shared config tracking**: Tracks key files from
`@fluidframework/eslint-config-fluid` (index.js, base.js, strict.js,
recommended.js, minimal-deprecated.js, strict-biome.js, package.json) as
additional config files
- **Graceful handling**: Uses a path relative to the repo root
(`common/build/eslint-config-fluid`); if the directory doesn't exist,
gracefully skips this tracking
This keeps `EsLintTask` as a `TscDependentTask` while adding the
additional config file tracking needed to properly invalidate when
shared configs change.
## Reviewer Guidance
The change preserves existing behavior and simply extends
`configFileFullPaths` to include additional files. `TsLintTask` remains
unchanged.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tylerbutler <19589+tylerbutler@users.noreply.github.com>
* refactor(examples): Add missing function return types (#26003)
In preparation for globally enabling an eslint rule that requires them.
* build: Update build-tools dependencies & pnpm dedupe (#25990)
## Description
This PR updates build-tools dependencies to the latest release (0.61.0).
This PR also ran `pnpm dedupe` for each affected package group. Last
time the build tools dependencies were updated, we needed to run this as
well due to the large number of dependency changes.
* readonlyInStagingMode default to false (#26004)
This pull request makes a small change to the default data store
policies in the `dataStoreRuntime.ts` file. The change updates the
default setting for `readonlyInStagingMode` to be `false` instead of
`true`, allowing data stores to be writable in staging mode by default.
This is to aid prototyping. StagingMode is still alpha, so this breaking
change is acceptable.
* build(client): generate eslint 9 configs for all packages (#25989)
This change updates the shared eslint 9 config to be TypeScript and
updates the script in scripts/generate-flat-eslint-configs.ts to support
a `--typescript` flag to output typescript per-package configs instead
of ESM. Also adds a `--finalize` flag that will do some additional
cleanup once packages are fully migrated to eslint 9.
Finally, there are lots of fixes to the script to handle ignore entries,
inheritance from other configs, etc. The script now produces configs
that work in my testing without any modifications. Even if that doesn't
hold true once we are truly migrating (see #25932), merging this
beforehand will simplify the review of those changes.
All the configs were generated by the script using this command:
```
tsx scripts/generate-flat-eslint-configs.ts --typescript
```
* feat(build-tools): add flag and environment variable to preserve version info in generated type tests (#25988)
## Description
Adds `skipVersionOutput` flag and `FLUB_TYPETEST_SKIP_VERSION_OUTPUT`
environment variable to `generate:typetests` command. When set,
preserves existing version information in generated type test file
headers instead of updating to current package versions.
**Implementation:**
- **`readExistingVersions()` function**: Parses existing type test files
to extract baseline and current version comments
- **`skipVersionOutput` flag**: Boolean flag with `env` property set to
`FLUB_TYPETEST_SKIP_VERSION_OUTPUT`, allowing the value to be set via
environment variable or command line. The flag is visible in help output
for discoverability.
- **Version preservation logic**: Uses the flag value to determine
whether to preserve existing versions; falls back to current versions if
file doesn't exist
- **Tests**: Added comprehensive test coverage including environment
variable behavior tests
- **Pipeline integration**: Automatically sets the environment variable
in the Build - client pipeline for `test/*` branches using the existing
`testBuild` variable
**Usage:**
```bash
# Regenerate type tests, preserving existing version comments (via environment variable)
FLUB_TYPETEST_SKIP_VERSION_OUTPUT=true flub generate:typetests --dir ./packages/my-package
# Or use the flag directly
flub generate:typetests --dir ./packages/my-package --skipVersionOutput
# Without flag/env var, versions update normally (default behavior)
flub generate:typetests --dir ./packages/my-package
```
**Pipeline behavior**: The environment variable is automatically set to
`true` when building from `test/*` branches in CI. The oclif flag system
automatically handles the type conversion from environment variable to
boolean. This preserves existing version information during test branch
builds without manual configuration.
Use case: in CI pipelines building from test branches, setting the
version may not be the preferred behavior. This flag/env variable allows
override.
## Breaking Changes
None. Feature only activates when environment variable is set or flag is
used.
## Reviewer Guidance
- Main logic in `processPackage()` around line 178-194
- `readExistingVersions()` uses `RegExp.exec()` and `"utf8"` encoding
per linting requirements
- Tests use `os.tmpdir()` for cross-platform compatibility and include
coverage for environment variable behavior
- Pipeline changes in `tools/pipelines/templates/include-build-lint.yml`
use existing `testBuild` variable to automatically set the environment
variable for `test/*` branches
- Flag definition at line 83-87 uses `env` property for environment
variable integration, following oclif best practices
- Flag is visible in help output for better discoverability
- ESLint errors fixed using object destructuring in test file
* build(client): clean up fluid-build config (#26005)
Removes a lot of outdated settings in the fluid-build config.
* feat(build-tools): Add Biome 2.x config reader with version auto-detection (#25969)
Adds Biome 2.x configuration reader for fluid-build with automatic
version detection. Biome 2.x changed from separate `include`/`ignore`
fields to a unified `includes` field with negation patterns.
## Key Changes
**New modules:**
- `biome2Config.ts` - Biome 2.x config reader with unified `includes`
field and re-inclusion pattern support
- `biome2ConfigTypes.d.ts` - Auto-generated types from Biome 2.x JSON
schema
- `biomeVersion.ts` - Version detection from package.json or CLI
- `biomeConfigUtils.ts` - Shared utilities (config loading, extends
resolution, factory, interface)
**Refactored:**
- `biomeConfig.ts` - Renamed to `BiomeConfigReaderV1` for v1-specific
implementation
- `biomeTasks.ts` - Uses `createBiomeConfigReader()` factory for
auto-detection
## Features
- Auto-detects Biome version and returns appropriate reader (v1 or v2)
- Supports `root` field for automatic parent config discovery
- Handles both explicit `extends` and implicit parent config merging
- Supports `//` microsyntax for extending root config
- Comprehensive test coverage for v2 config scenarios
* Remove presence functionality from external-views example (#26000)
* build(client): add jiti dev dependency for eslint9 (#26009)
The jiti dep is needed for TypeScript config loading in eslint 9. This
PR adds the dev dep to all packages in the client release group so that
there are fewer changes in the eslint 9 upgrade PR. I did this using the
command `pnpm -r add -D jiti`
* refactor(experimental): Add missing function return types (#26006)
In preparation for globally enabling an eslint rule that will require
them.
* build(client): upgrade react eslint plugins (#26007)
Updates the ESLint React and React Hooks plugin dependencies to their
latest versions and enables several new React Hooks linting rules that
are available in these newer versions.
**ESLint plugin upgrades:**
- Upgraded `eslint-plugin-react` from `~7.33.2` to `~7.35.0` and
`eslint-plugin-react-hooks` from `~5.2.0` to `~7.0.1` in both
`package.json` and `pnpm-lock.yaml`. This enables compatibility with
ESLint 9 and unlocks new linting rules.
Several of the rules were downgraded to warning while we get through the
eslint 9 upgrade. They can be revisited once the upgrade is done.
* refactor(client): Add explicit function return types (#26013)
In preparation for globally enabling an eslint rule that requires them.
* (tree) Added new forest data and summary formats for incremental summaries (#26002)
Added new formats for the forest summarizer's data and summaries -
`ForestFormatVersion.v2` and `ForestSummaryFormatVersion.v3`
respectively. They both require `minVersionForCollab` to be 2.74.0.
- `ForestFormatVersion.v2` - Incremental encoding of the forest's data
is supported from this version onwards.
- `ForestSummaryFormatVersion.v3` - Incremental summary in forest is
supported from this version onwards. Also, the top-level forest content
is stored under a summary blob with key "contents". This is the same key
where incremental chunk contents are stored making the summary tree
consistent.
Incremental summaries will require these two versions to be enabled,
i.e., it is supported from `minVersionForCollab` 2.74.0 onwards.
Enabling incremental summaries is a cross-client breaking change, so
this will ensure that clients can read these new formats when it is
enabled.
Added validation during forest summarizer load that the top-level
content is present in the correct blob key as per the summary format
version.
[AB#41865](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/41865)
* build(eslint-config-fluid): remove unused rushstack plugins (#25666)
These plugins were not really used in the previous config, so removal is
the best option.
* refactor(client): Add explicit function return types (#26019)
Part of a multi-PR effort in preparation to add global eslint
enforcement
* Add serializable SharedTree change (#25992)
This introduces an alpha API that allows a user to capture a serialized
version of tree changes whenever the view is changed. That (opaque)
object can then be applied to a different tree branch later, as long as
that branch has the same head commit as the originating branch. This API
is necessary to support AI sandboxing scenarios using the tree-agent
package.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: jenn le <jennle@microsoft.com>
* Add API to erase schema details, and use it on table (#25999)
## Description
Adds experimental alpha API for doing component style implementation
detail erasure of schema.
These are then used on the table component.
Interestingly the new APIs do not show up in the types of code which
uses them, so exporting the new APIs was not required to use them on
table, but they are exported anyway since we want to make them available
as alpha. Them being alpha should not block table from going to beta.
## Breaking Changes
Some implementation details of table have been hidden.
* refactor(client): Add explicit function return types (#26020)
Part of a multi-PR effort in preparation for enabling a global eslint
rule to enforce them.
* Use new strictEnum instead of branding for SchemaFormatVersion (#26012)
## Description
The current code does a poor job of type safety (the members of the
constant are not branded, so the branding forces lots of unsafe type
conversions and is likely less type safe than not branding would have
been).
Four solutions to this were considered:
1. Remove the branding: this would remove all the calls to brand, which
are inferring what they are branding to and thus remove the risk of them
silently doing an unintended type conversion since they simply convert
to whatever is needed at that location. This would improve the type
safety of all other branded types by reducing the risky use of branding.
2. Brand the constant values: this would centralize the branding to
where its clearly correct and easy to review, improving type safety.
This could be done with brandConst, but there is an annoyance that the
current branded type is a union of the two values, so we can't brand to
that easily, and would want to introduce a second type, one for the
branded values, and one for the union of the branded constants.
3. Implement a custom utility to help do option 2 above.
4. An enum: this gets some of the type safety benefits of branding, but
it allows number to be assigned to it, and if there are string values
allows them to be assigned without branding.
5. const enums: same as above, but instead of a regression in code size,
this is an improvement. Const enums can cause issues if you both package
export them, and change the values used. As we don't intend to ever
package export this and can't change the values (as they are used in
persisted data), this seems safe for two redundant reasons.
I think the best options are either const enums or option 3, a custom
enum utility.
I have gone with option 3 due to the surprising lack of safety with the
build in e…
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also extracts static method
assertValidRangeand leaves a TODO for future deduplication.