fluid-framework 2.50.0-345060 → 2.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/package.json +12 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,105 @@
1
1
  # fluid-framework
2
2
 
3
+ ## 2.50.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Record node kind was added (alpha) ([#24908](https://github.com/microsoft/FluidFramework/pull/24908)) [b25667bcdc](https://github.com/microsoft/FluidFramework/commit/b25667bcdcad5584f35783f6a32270803b6dfb1c)
8
+
9
+ Adds a new kind of node to SharedTree that models a TypeScript record.
10
+ As is the case with map nodes, record nodes only support string keys.
11
+
12
+ ```typescript
13
+ class MyRecord extends schemaFactory.record("my-record", [
14
+ schemaFactory.number,
15
+ schemaFactory.string,
16
+ ]) {}
17
+ const myRecord = new MyRecord({
18
+ foo: 42,
19
+ bar: "Hello world!",
20
+ });
21
+
22
+ const foo = myRecord.foo; // 42
23
+
24
+ delete myRecord.foo;
25
+
26
+ myRecord.baz = 37;
27
+
28
+ const keys = Object.keys(myRecord); // ["bar", "baz"]
29
+ const values = Object.values(myRecord); // ["Hello world!", 37]
30
+ const entries = Object.entries(myRecord); // [["bar", "Hello world!"], ["baz", 37]]
31
+ ```
32
+
33
+ #### `NodeKind` enum update
34
+
35
+ This change includes the addition of a new flag to the [NodeKind](https://fluidframework.com/docs/api/fluid-framework/nodekind-enum) enum.
36
+ This API notes in its documentation that users should not treat its flags as an exhaustive set.
37
+
38
+ This change may break code that treats it that way.
39
+ We recommend updating your code to be more tolerant of unknown node kinds going forward.
40
+
41
+ Also see alternative options for schema-agnostic tree traversal if needed:
42
+
43
+ - [Tree.parent](https://fluidframework.com/docs/api/fluid-framework/treenodeapi-interface#parent-methodsignature)
44
+ - [TreeAlpha.child](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#child-methodsignature)
45
+ - [TreeAlpha.children](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#children-methodsignature)
46
+
47
+ #### Additional features
48
+
49
+ In addition to the operations afforded by TypeScript records, SharedTree record nodes can be iterated (equivalent to Object.entries).
50
+
51
+ ```typescript
52
+ class MyRecord extends schemaFactory.record("my-record", [schemaFactory.number, schemaFactory.string]) {}
53
+ const myRecord = new MyRecord({
54
+ foo: 42,
55
+ bar: "Hello world!"
56
+ });
57
+
58
+ for (const [key, value] of myRecord) {
59
+ ...
60
+ }
61
+
62
+ const a = { ...myRecord }; // { foo: 42, bar: "Hello world!" }
63
+ const b = [...myRecord]; // [["foo", 42], ["bar, "Hello world!"]]
64
+ ```
65
+
66
+ #### Recursive records
67
+
68
+ Recursive record schema can be defined using `recordRecursive` on [SchemaFactoryAlpha](https://fluidframework.com/docs/api/fluid-framework/schemafactoryalpha-class).
69
+
70
+ ```typescript
71
+ class MyRecord extends schemaFactory.recordRecursive("my-record", [
72
+ schemaFactory.string,
73
+ () => MyRecord,
74
+ ]) {}
75
+ const myRecord = new MyRecord({
76
+ foo: "Hello world!",
77
+ bar: new MyRecord({
78
+ x: "foo",
79
+ y: new MyRecord({}),
80
+ }),
81
+ });
82
+ ```
83
+
84
+ #### TableSchema update (alpha)
85
+
86
+ The [TableSchema](https://fluidframework.com/docs/api/fluid-framework/tableschema-namespace/) APIs have been updated to use record nodes in the schema they generate.
87
+ Specifically, the `Row` representation now uses a record to store its column-cell pairs, rather than a map.
88
+
89
+ The node types derived from these APIs model their data in a row-major format.
90
+ That is, each row in the table contains the set of cells that belong to that row, where each cell is indexed by its corresponding column.
91
+
92
+ Previously, this was modeled using a [MapNode](https://fluidframework.com/docs/api/fluid-framework/treemapnode-interface).
93
+ This format proved cumbersome to interop with popular table rendering libraries like [tanstack](https://tanstack.com/table), which expect a record-like format.
94
+
95
+ The persisted format of documents containing trees derived from these APIs is the same, so this change is forward and backward compatible.
96
+
97
+ #### JsonDomainSchema update (alpha)
98
+
99
+ [JsonObject](https://fluidframework.com/docs/api/fluid-framework/jsonastree-namespace/jsonobject-class) has been updated to a record rather than a map.
100
+
101
+ The persisted format of documents containing trees derived from these APIs is the same, so this change is forward and backward compatible.
102
+
3
103
  ## 2.43.0
4
104
 
5
105
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluid-framework",
3
- "version": "2.50.0-345060",
3
+ "version": "2.50.0",
4
4
  "description": "The main entry point into Fluid Framework public packages",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -57,17 +57,17 @@
57
57
  "main": "lib/index.js",
58
58
  "types": "lib/public.d.ts",
59
59
  "dependencies": {
60
- "@fluidframework/container-definitions": "2.50.0-345060",
61
- "@fluidframework/container-loader": "2.50.0-345060",
62
- "@fluidframework/core-interfaces": "2.50.0-345060",
63
- "@fluidframework/core-utils": "2.50.0-345060",
64
- "@fluidframework/driver-definitions": "2.50.0-345060",
65
- "@fluidframework/fluid-static": "2.50.0-345060",
66
- "@fluidframework/map": "2.50.0-345060",
67
- "@fluidframework/runtime-utils": "2.50.0-345060",
68
- "@fluidframework/sequence": "2.50.0-345060",
69
- "@fluidframework/shared-object-base": "2.50.0-345060",
70
- "@fluidframework/tree": "2.50.0-345060"
60
+ "@fluidframework/container-definitions": "~2.50.0",
61
+ "@fluidframework/container-loader": "~2.50.0",
62
+ "@fluidframework/core-interfaces": "~2.50.0",
63
+ "@fluidframework/core-utils": "~2.50.0",
64
+ "@fluidframework/driver-definitions": "~2.50.0",
65
+ "@fluidframework/fluid-static": "~2.50.0",
66
+ "@fluidframework/map": "~2.50.0",
67
+ "@fluidframework/runtime-utils": "~2.50.0",
68
+ "@fluidframework/sequence": "~2.50.0",
69
+ "@fluidframework/shared-object-base": "~2.50.0",
70
+ "@fluidframework/tree": "~2.50.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@arethetypeswrong/cli": "^0.17.1",