Skip to content

feat(tree): Update experimental Table Schema APIs to support adding additional properties to Column/Row Schema #24463

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 105 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
315c66c
WIP
Josmithr Mar 20, 2025
52e321b
WIP: Interfaces
Josmithr Mar 21, 2025
16d7a12
Merge branch 'main' into tree/table-api-prototype
Josmithr Mar 21, 2025
0cb2b3c
WIP: More API
Josmithr Mar 24, 2025
7f23fa4
Merge branch 'main' into tree/table-api-prototype
Josmithr Mar 24, 2025
c1a0e53
WIP: Finish interfaces
Josmithr Mar 24, 2025
3c0c7fb
WIP: Read/write typing for TCell
Josmithr Mar 24, 2025
87340d5
fix: Bugs
Josmithr Mar 24, 2025
3e9170b
refactor: Props interface
Josmithr Mar 24, 2025
f44f83f
refactor: Cleanup
Josmithr Mar 24, 2025
0b52abb
refactor: Simplify API surface
Josmithr Mar 24, 2025
3ac7b14
refactor: Remove explicit props
Josmithr Mar 25, 2025
3751d36
docs: Tags
Josmithr Mar 25, 2025
d1c535b
Merge branch 'main' into tree/table-api-prototype
Josmithr Mar 26, 2025
596d154
WIP: controlled return typing
Josmithr Mar 27, 2025
5fa8822
refactor: More type "simplification"
Josmithr Mar 27, 2025
2e53c9c
docs: Regions
Josmithr Mar 27, 2025
fe1a45f
refactor: Extract rowFields
Josmithr Mar 27, 2025
5e1e940
refactor: Rename returned schema type
Josmithr Mar 27, 2025
e125030
refactor: Finish type "simplification"
Josmithr Mar 27, 2025
ebe3f8f
fix: Typing issues
Josmithr Mar 27, 2025
5c3b3a3
feat: Export API
Josmithr Mar 27, 2025
88c1774
test: WIP unit test
Josmithr Mar 27, 2025
2eb7eaa
refactor: Misc. cleanup
Josmithr Mar 27, 2025
7d4361f
fix: Insertable types
Josmithr Mar 27, 2025
59b5a89
refactor: Consistent type naming
Josmithr Mar 27, 2025
09424a8
refactor: Type cleanup
Josmithr Mar 27, 2025
bcac913
refactor: Renames
Josmithr Mar 27, 2025
02c8046
refactor: Move module
Josmithr Mar 27, 2025
65e09be
refactor: Use `SchemaFactoryAlpha` and sub-scoping
Josmithr Mar 28, 2025
a7f144c
refactor: Named schemas
Josmithr Mar 28, 2025
16bb691
refactor: Sub-scoping
Josmithr Mar 28, 2025
bdf3d1b
Merge branch 'main' into tree/table-api-prototype
Josmithr Mar 31, 2025
ff5563e
refactor: Fix typing
Josmithr Apr 1, 2025
3e485c5
Merge branch 'main' into tree/table-api-prototype
Josmithr Apr 1, 2025
16e6710
revert: Unwanted report changes
Josmithr Apr 1, 2025
6f5b209
docs: Remove obsolete TODO
Josmithr Apr 1, 2025
30c8445
refactor: Remove "props" and fix package exports
Josmithr Apr 1, 2025
8cc7581
WIP
Josmithr Apr 2, 2025
d7243b6
Merge branch 'main' into tree/table-api-prototype
Josmithr Apr 2, 2025
1807f86
fix: Work around TS4058
Josmithr Apr 2, 2025
3c55829
Merge branch 'main' into tree/table-api-prototype
Josmithr Apr 3, 2025
ad37694
fix: Type issues
Josmithr Apr 3, 2025
e8ff028
refactor: Group table schema factory APIs into a namespace
Josmithr Apr 3, 2025
aad4691
refactor: Make APIs `@internal`
Josmithr Apr 3, 2025
44f2ecc
docs: Fix tag ordering
Josmithr Apr 3, 2025
4d9ddd7
refactor: Remove unusable static constructor
Josmithr Apr 3, 2025
59585a7
test: Update tests
Josmithr Apr 3, 2025
01900bc
docs: Update TODOs
Josmithr Apr 3, 2025
99c70d5
remove: Unused import
Josmithr Apr 3, 2025
5896722
refactor: Move column docs and implement interface
Josmithr Apr 3, 2025
1737443
docs: More docs
Josmithr Apr 3, 2025
d5c3031
refactor: Update row docs and implement interface
Josmithr Apr 3, 2025
6fd1d65
refactor: Move Table docs and implement interface
Josmithr Apr 3, 2025
fe7f24b
docs: Regions
Josmithr Apr 3, 2025
4d81ad7
refactor: Misc. updates
Josmithr Apr 3, 2025
7c5da85
docs: Test TODOs
Josmithr Apr 3, 2025
85bf3b3
style: Prettier
Josmithr Apr 3, 2025
e0f60f5
test: `insertColumn`
Josmithr Apr 3, 2025
1a1ed49
docs: Docs updates
Josmithr Apr 3, 2025
d54b976
refactor: Remove hacky workarounds
Josmithr Apr 3, 2025
f605950
docs: Remove commented-out return statements
Josmithr Apr 3, 2025
65ad9f7
test: `insertColumn` tests
Josmithr Apr 3, 2025
5dd6bde
test: `insertRows` tests
Josmithr Apr 3, 2025
51de1df
refactor: Remove "moveTo" methods and add TODOs
Josmithr Apr 3, 2025
6ba6e3e
refactor: Renames
Josmithr Apr 3, 2025
3bf07be
refactor: Method signature syntax
Josmithr Apr 3, 2025
2965c82
refactor: Remove index properties (simplify API)
Josmithr Apr 3, 2025
8d473f5
WIP: Column Props
Josmithr Apr 4, 2025
557bb44
refactor: More consistent typing
Josmithr Apr 4, 2025
d8aa0ae
Merge branch 'main' into tree/table-api-prototype
Josmithr Apr 4, 2025
8dc3238
revert: API report changes
Josmithr Apr 4, 2025
bc66936
test: Remove `.only`
Josmithr Apr 4, 2025
e4fe49b
docs: Update TODOs
Josmithr Apr 4, 2025
bf17617
test: Update unit tests to leverage `independentView`
Josmithr Apr 4, 2025
42f0032
docs: Update bounds policy
Josmithr Apr 4, 2025
3f59d98
test: Remove old test
Josmithr Apr 4, 2025
58d3fe0
remove: Unused import
Josmithr Apr 4, 2025
45910b8
Merge branch 'tree/table-api-prototype' into tree/table-api-props
Josmithr Apr 4, 2025
94e392a
Merge branch 'main' into tree/table-api-props
Josmithr Apr 4, 2025
abe96fe
Merge branch 'main' into tree/table-api-props
Josmithr Apr 24, 2025
1866543
style: Prettier
Josmithr Apr 24, 2025
2f2bdbc
refactor: Overloads
Josmithr Apr 24, 2025
909af99
refactor: Simplify Row/Column type relationship
Josmithr Apr 24, 2025
6f689f2
refactor: Simplify typing
Josmithr Apr 24, 2025
25d10ab
fix: Typing
Josmithr Apr 24, 2025
ba03b03
refactor: Remove unneeded workaround
Josmithr Apr 24, 2025
7a8013d
fix: Typing
Josmithr Apr 25, 2025
3008fad
test: Add importer tests
Josmithr Apr 25, 2025
c159e09
docs: TODOs
Josmithr Apr 25, 2025
0fdd8d8
refactor: Rename "fields" to "props" and update docs
Josmithr Apr 25, 2025
b575251
feat: Add props schema option for rows
Josmithr Apr 25, 2025
f2fb9d1
docs: Add comment
Josmithr Apr 25, 2025
cd697a9
test: Update import test
Josmithr Apr 25, 2025
210e467
revert: Unwanted change
Josmithr Apr 25, 2025
b2679e5
docs: Add TODOs
Josmithr Apr 25, 2025
248ec01
revert: Unintentional change
Josmithr Apr 25, 2025
265c68b
refactor: Clean up satisfies checks
Josmithr Apr 25, 2025
a04d808
revert: Type param renames
Josmithr Apr 25, 2025
63a2046
revert: Explicit variable typing
Josmithr Apr 25, 2025
4cbc84d
style: Formatting
Josmithr Apr 25, 2025
24ec57b
docs: Add TODO
Josmithr Apr 25, 2025
a53a036
docs: Add note about TS bug
Josmithr Apr 25, 2025
7b99a96
Merge branch 'tree/table-api-props' of https://github.com/Josmithr/Fl…
Josmithr Apr 25, 2025
528d989
refactor: Restore column-object-based row operations
Josmithr Apr 25, 2025
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
54 changes: 53 additions & 1 deletion examples/utils/import-testing/src/test/importer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import { strict as assert } from "node:assert";

import { JsonAsTree } from "@fluidframework/tree/alpha";
// eslint-disable-next-line import/no-internal-modules
import { JsonAsTree, SchemaFactoryAlpha, TableSchema } from "@fluidframework/tree/internal";
import type {
areSafelyAssignable,
requireTrue,
Expand All @@ -26,6 +27,57 @@ describe("import tests", () => {
assert.equal(r[0], 1);
});

// The TableSchema code is complex and previously had issues where invalid `.d.ts` files were generated by TypeScript.
// These tests exist to ensure we don't inadvertently check in changes that regress users' ability to consume that code.
it("TableSchema", () => {
const schemaFactory = new SchemaFactoryAlpha("com.example");

class Cell extends schemaFactory.object("table-cell", {
value: schemaFactory.string,
}) {}

class ColumnProps extends schemaFactory.object("table-column-props", {
label: schemaFactory.optional(schemaFactory.string),
}) {}
class Column extends TableSchema.createColumn(schemaFactory, ColumnProps) {}

class RowProps extends schemaFactory.object("table-row-props", {
label: schemaFactory.optional(schemaFactory.string),
}) {}
class Row extends TableSchema.createRow(schemaFactory, Cell, RowProps) {}

class Table extends TableSchema.createTable(schemaFactory, Cell, Column, Row) {}

const _table = new Table({
columns: [
new Column({
props: {
label: "Column 0",
},
}),
new Column({
props: {
label: "Column 1",
},
}),
],
rows: [
new Row({
cells: {},
props: {
label: "Row 0",
},
}),
new Row({
cells: {},
props: {
label: "Row 1",
},
}),
],
});
});

// See also the unit tests for JsonAsTree in tree's jsonDomainSchema.spec.ts
it("Iterator types", () => {
type ImportedArrayNodeIterator = ReturnType<JsonAsTree.Array[typeof Symbol.iterator]>;
Expand Down
Loading
Loading