Skip to content

Commit f259bc3

Browse files
WIP: Introduce BrowserChangeRecord
1 parent df49bc1 commit f259bc3

30 files changed

+482
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "session-replay/browser/change-data-schema.json",
4+
"title": "BrowserChangeData",
5+
"type": "object",
6+
"description": "Browser-specific. Schema of a Session Replay BrowserChangeData type.",
7+
"allOf": [
8+
{
9+
"properties": {
10+
"adoptedStyleSheetsChanges": {
11+
"type": "array",
12+
"items": {
13+
"$ref": "changes/adopted-stylesheets-change-schema.json"
14+
},
15+
"description": "Changes to the `adoptedStyleSheets` list of a Document, DocumentFragment, or ShadowRoot node."
16+
},
17+
"attributeChanges": {
18+
"type": "array",
19+
"items": {
20+
"$ref": "changes/attribute-change-schema.json"
21+
},
22+
"description": "Changes to the attributes of a node."
23+
},
24+
"nodesAdded": {
25+
"type": "array",
26+
"items": {
27+
"$ref": "changes/add-node-change-schema.json"
28+
},
29+
"description": "Newly added nodes."
30+
},
31+
"nodesRemoved": {
32+
"type": "array",
33+
"items": {
34+
"$ref": "changes/node-references/node-id-schema.json"
35+
},
36+
"description": "Newly removed nodes."
37+
},
38+
"scrollChanges": {
39+
"type": "array",
40+
"items": {
41+
"$ref": "changes/scroll-position-change-schema.json"
42+
},
43+
"description": "Changes to the scroll position of a node."
44+
},
45+
"stringsAdded": {
46+
"type": "array",
47+
"items": {
48+
"$ref": "changes/add-string-change-schema.json"
49+
},
50+
"description": "Newly added strings."
51+
},
52+
"textChanges": {
53+
"type": "array",
54+
"items": {
55+
"$ref": "changes/text-change-schema.json"
56+
},
57+
"description": "Changes to the text content of a node."
58+
}
59+
}
60+
}
61+
]
62+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "session-replay/browser/change-record-schema.json",
4+
"title": "BrowserChangeRecord",
5+
"type": "object",
6+
"description": "Browser-specific. Schema of a Record type which represents changes and mutations using a compact encoding. (Experimental.)",
7+
"allOf": [
8+
{
9+
"$ref": "../common/_slot-supported-common-record-schema.json"
10+
},
11+
{
12+
"required": ["type", "data"],
13+
"properties": {
14+
"type": {
15+
"type": "integer",
16+
"description": "The type of this Record.",
17+
"const": 12,
18+
"readOnly": true
19+
},
20+
"data": {
21+
"$ref": "change-data-schema.json"
22+
},
23+
"id": {
24+
"type": "integer"
25+
}
26+
}
27+
}
28+
]
29+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "session-replay/browser/changes/add-cdata-section-node-change-schema.json",
4+
"title": "AddCDataSectionNodeChange",
5+
"type": "array",
6+
"description": "Browser-specific. Schema representing the addition of a new #cdata-section node to the document.",
7+
"minItems": 2,
8+
"items": [
9+
{ "$ref": "node-references/insertion-point-schema.json" },
10+
{ "$ref": "node-names/cdata-section-node-name-schema.json" }
11+
],
12+
"additionalItems": false
13+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "session-replay/browser/changes/add-doctype-node-change-schema.json",
4+
"title": "AddDocTypeNodeChange",
5+
"type": "array",
6+
"description": "Browser-specific. Schema representing the addition of a new #doctype node to the document.",
7+
"minItems": 5,
8+
"items": [
9+
{ "$ref": "node-references/insertion-point-schema.json" },
10+
{ "$ref": "node-names/doctype-node-name-schema.json" },
11+
{
12+
"type": "string",
13+
"description": "The doctype's name."
14+
},
15+
{
16+
"type": "string",
17+
"description": "The doctype's public ID."
18+
},
19+
{
20+
"type": "string",
21+
"description": "The doctype's system ID."
22+
}
23+
],
24+
"additionalItems": false
25+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "session-replay/browser/changes/add-document-fragment-node-change-schema.json",
4+
"title": "AddDocumentFragmentNodeChange",
5+
"type": "array",
6+
"description": "Browser-specific. Schema representing the addition of a new #document-fragment node to the document.",
7+
"minItems": 2,
8+
"items": [
9+
{ "$ref": "node-references/insertion-point-schema.json" },
10+
{ "$ref": "node-names/document-fragment-node-name-schema.json" }
11+
],
12+
"additionalItems": false
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "session-replay/browser/changes/add-document-node-change-schema.json",
4+
"title": "AddDocumentNodeChange",
5+
"type": "array",
6+
"description": "Browser-specific. Schema representing the addition of a new #document node to the document.",
7+
"minItems": 2,
8+
"items": [
9+
{ "$ref": "node-references/insertion-point-schema.json" },
10+
{ "$ref": "node-names/document-node-name-schema.json" }
11+
],
12+
"additionalItems": false
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "session-replay/browser/changes/add-element-node-change-schema.json",
4+
"title": "AddElementNodeChange",
5+
"type": "array",
6+
"description": "Browser-specific. Schema representing the addition of a new element node to the document.",
7+
"minItems": 2,
8+
"items": [{ "$ref": "node-references/insertion-point-schema.json" }, { "$ref": "node-names/node-name-schema.json" }],
9+
"additionalItems": { "$ref": "attribute-assignment-schema.json" }
10+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "session-replay/browser/changes/add-node-change-schema.json",
4+
"title": "AddNodeChange",
5+
"description": "Browser-specific. Schema representing the addition of a new node to the document.",
6+
"oneOf": [
7+
{ "$ref": "add-cdata-section-node-change-schema.json" },
8+
{ "$ref": "add-doctype-node-change-schema.json" },
9+
{ "$ref": "add-document-node-change-schema.json" },
10+
{ "$ref": "add-document-fragment-node-change-schema.json" },
11+
{ "$ref": "add-element-node-change-schema.json" },
12+
{ "$ref": "add-text-node-change-schema.json" },
13+
{ "$ref": "add-shadow-root-node-change-schema.json" }
14+
]
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "session-replay/browser/changes/add-shadow-root-node-change-schema.json",
4+
"title": "AddShadowRootNodeChange",
5+
"type": "array",
6+
"description": "Browser-specific. Schema representing the addition of a new #shadow-root node to the document.",
7+
"minItems": 2,
8+
"items": [
9+
{ "$ref": "node-references/insertion-point-schema.json" },
10+
{ "$ref": "node-names/shadow-root-node-name-schema.json" }
11+
],
12+
"additionalItems": false
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "session-replay/browser/changes/add-string-change-schema.json",
4+
"title": "AddStringChange",
5+
"description": "Browser-specific. Schema representing the addition of a string to the string table.",
6+
"type": "string",
7+
"minimum": 0
8+
}

0 commit comments

Comments
 (0)