Skip to content

build: Add vale configuration and demonstrate usage #24252

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
merged 16 commits into from
Apr 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .changeset/blue-eels-invite.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
"fluid-framework": minor
"@fluidframework/tree": minor
---
---
"section": tree
"__section": tree
---

Better type errors for invalid recursive schema
Expand Down
26 changes: 2 additions & 24 deletions .changeset/cuddly-donuts-guess.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,8 @@
---
"@fluidframework/core-utils": minor
---
---
"section": feature
"__section": feature
---

New alpha `onAssertionFailure` API

A new `@alpha` API is added called `onAssertionFailure` which can be used to get a callback when an assertion fails indicating a bug in the Fluid Framework.
This callback is invoked before the exception is thrown, reducing the chances of the exception being lost or replaced with a different exception before making it to a catch block which reports it.
It can also be used to break into the debugger when the assertion occurs to aid in debugging the cause.

```ts
import { onAssertionFailure } from "fluid-framework/alpha";

let firstAssertion: Error | undefined;

onAssertionFailure((error: Error) => {
const priorErrorNote =
firstAssertion === undefined
? "Please report this bug."
: `Might be caused due to prior error ${JSON.stringify(firstAssertion.message)} which should be investigated first.`;
const message = `Encountered Bug in Fluid Framework: ${error.message}\n${priorErrorNote}\n${error.stack}`;
console.error(message);

debugger;
firstAssertion ??= error;
});
```
A new `@alpha`
6 changes: 2 additions & 4 deletions .changeset/empty-wasps-smile.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
"fluid-framework": minor
"@fluidframework/tree": minor
---
---
"section": tree
"__section": tree
---

Improved type checking for recursive object schema Fields
Expand Down Expand Up @@ -52,4 +50,4 @@ This change will also result in much nicer IntelliSense and type errors while fi

There are still several cases which compile but violate this policy regarding recursive schema and can cause issues when exporting schema;
these should be migrated to the above pattern as well.
It is still valid to use non-recursive structurally named array and map schema inline; this change does not impact them.
It is still valid to use non-recursive structurally named array and map schema inline. This change does not impact them.
6 changes: 2 additions & 4 deletions .changeset/fancy-gifts-jam.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
"@fluidframework/tree": minor
"fluid-framework": minor
---
---
"section": tree
"__section": tree
---

Performance enhancements in SharedTree branch-related ops processing
Performance enhancements in Shared Tree branch-related ops processing

SharedTree leverages the "op bunching" feature where contiguous ops in a grouped batch are bunched and processed together
to asymptotically improve the performance of processing ops.
Expand Down
6 changes: 2 additions & 4 deletions .changeset/petite-bags-cheer.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
"@fluidframework/tree": minor
---
---
"section": tree
"__section": tree
---

Improve tree shaking for code which imports `SharedTreeAttributes`
Improve Tree Shaking For Code Which Imports `SharedTreeAttributes`

Bundling code that imports `SharedTreeAttributes` from `@fluidframework/tree/legacy` should now better prune out the rest of the tree package's code.
This change reduced the dependency on webpack's
Expand Down
4 changes: 1 addition & 3 deletions .changeset/plenty-olives-speak.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
"fluid-framework": minor
"@fluidframework/tree": minor
---
---
"section": tree
"__section": tree
---

`TreeAlpha.exportConcise` now supports `undefined`
Expand Down
4 changes: 1 addition & 3 deletions .changeset/strong-dragons-build.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
"fluid-framework": minor
"@fluidframework/tree": minor
---
---
"section": tree
"__section": tree
---

Improvements to typing of object node schema
Expand Down
4 changes: 1 addition & 3 deletions .changeset/stuffed-bears-relax.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
"@fluid-experimental/tree-react-api": minor
---
---
"section": other
"__section": other
---

Simplify experimental tree data object implementation
Expand Down
8 changes: 3 additions & 5 deletions .changeset/vast-paths-begin.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
"@fluidframework/datastore": minor
"@fluidframework/test-runtime-utils": minor
---
---
"section": legacy
includeInReleaseNotes: false
"__section": legacy
"__includeInReleaseNotes": false
---

New ILayerCompatDetails property on FluidDataStoreRuntime, MockFluidDataStoreContext and MockFluidDataStoreRuntime
Expand All @@ -15,4 +13,4 @@ A new optional property, `ILayerCompatDetails`, has been added to `FluidDataStor
`ILayerCompatDetails` has also been added to `MockFluidDataStoreRuntime` and `MockFluidDataStoreContext` which are used for
testing.

Important: this property is intended for use by Fluid Framework code only. No code outside the Fluid Framework should use or depend on this property in any way.
Important: this property is intended for use by fluid Framework code only. No code outside the FluidFramework should use or depend on this property in any way.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ nyc
*.log
.DS_Store

.vale/*
!.vale/config/

.vale/config/*
!.vale/config/vocabularies/

.vale/config/vocabularies/*
!.vale/config/vocabularies/fluid/
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it enough to have .vale/** and this last line?

Copy link
Member Author

Choose a reason for hiding this comment

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

For reasons I don't understand, no. If you do that, and add a new file under .vale/config/vocabularies/fluid/, it will
still be ignored. My hunch is that it has something to do with precedence of negation and how it works with folder
paths, but I didn't dig into it. FWIW the vale docs follow this pattern and I thought it was unnecssary too.


# Generated Node10 module resolution compatibility files
alpha.d.ts
beta.d.ts
Expand Down
21 changes: 21 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
StylesPath = .vale

MinAlertLevel = suggestion

Packages = Microsoft, MDX, proselint

Vocab = fluid

[*README.md]
Microsoft.We = NO

[*.{md}]
BasedOnStyles = Vale, Microsoft, proselint

Vale.Spelling = NO

Microsoft.Contractions = NO
Microsoft.Passive = NO
Microsoft.Semicolon = warning
Microsoft.Terms = suggestion
Microsoft.Vocab = NO
5 changes: 5 additions & 0 deletions .vale/config/vocabularies/fluid/accept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fluid Framework
FluidFramework
JavaScript
SharedTree
TypeScript
1 change: 1 addition & 0 deletions .vale/config/vocabularies/fluid/reject.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shared tree
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
"@fluidframework/test-tools": "^1.0.195075",
"@microsoft/api-documenter": "^7.21.6",
"@microsoft/api-extractor": "7.50.1",
"@vvago/vale": "^3.10.0",
"auto-changelog": "^2.4.0",
"c8": "^8.0.1",
"changesets-format-with-issue-links": "^0.3.0",
Expand Down
Loading