@atlaskit/node-data-provider 4.4.0 → 4.5.1
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.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/utils/prefetch-node-data-providers-data.js +47 -18
- package/dist/es2019/utils/prefetch-node-data-providers-data.js +38 -9
- package/dist/esm/utils/prefetch-node-data-providers-data.js +47 -18
- package/dist/types/utils/prefetch-node-data-providers-data.d.ts +25 -7
- package/dist/types-ts4.5/utils/prefetch-node-data-providers-data.d.ts +25 -7
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/node-data-provider
|
|
2
2
|
|
|
3
|
+
## 4.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#195649](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195649)
|
|
8
|
+
[`231bb33e06dfe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/231bb33e06dfe) -
|
|
9
|
+
EDITOR-1131 Bump adf-schema version to 50.2.0
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 4.5.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#193382](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/193382)
|
|
17
|
+
[`5c827a7e9ac42`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5c827a7e9ac42) -
|
|
18
|
+
[https://product-fabric.atlassian.net/browse/ED-28627](ED-28627) - add `duration` and `success` to
|
|
19
|
+
`prefetchNodeDataProvidersData` result
|
|
20
|
+
|
|
3
21
|
## 4.4.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -20,14 +20,28 @@ var _findNodesToPrefetch = require("./find-nodes-to-prefetch");
|
|
|
20
20
|
*/
|
|
21
21
|
/**
|
|
22
22
|
* Represents the aggregated SSR data for all node data providers.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* Each key is a provider's name, and the value contains the fetch status, duration,
|
|
24
|
+
* and a map of node data keys to their prefetched data.
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
|
+
* ```
|
|
27
28
|
* {
|
|
28
|
-
*
|
|
29
|
-
*
|
|
29
|
+
* mentionProvider: {
|
|
30
|
+
* success: true,
|
|
31
|
+
* duration: 220,
|
|
32
|
+
* data: {
|
|
33
|
+
* 'mention-1': { id: '1', name: 'John Doe' }
|
|
34
|
+
* }
|
|
35
|
+
* },
|
|
36
|
+
* emojiProvider: {
|
|
37
|
+
* success: true,
|
|
38
|
+
* duration: 110,
|
|
39
|
+
* data: {
|
|
40
|
+
* 'emoji-123': { shortName: ':smile:', representation: '😊' }
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
30
43
|
* }
|
|
44
|
+
* ```
|
|
31
45
|
*/
|
|
32
46
|
/**
|
|
33
47
|
* Fetches data for nodes in the document that are supported by the given providers.
|
|
@@ -49,7 +63,7 @@ var _findNodesToPrefetch = require("./find-nodes-to-prefetch");
|
|
|
49
63
|
* },
|
|
50
64
|
* ];
|
|
51
65
|
*
|
|
52
|
-
*
|
|
66
|
+
* const data = await prefetchNodeDataProvidersData({
|
|
53
67
|
* providers,
|
|
54
68
|
* doc,
|
|
55
69
|
* timeout: 1_000,
|
|
@@ -59,7 +73,7 @@ var _findNodesToPrefetch = require("./find-nodes-to-prefetch");
|
|
|
59
73
|
*
|
|
60
74
|
* @param props The properties for prefetching node data.
|
|
61
75
|
* @returns Record of provider names to their respective SSR data,
|
|
62
|
-
*
|
|
76
|
+
* success status, and duration of the fetch operation.
|
|
63
77
|
*/
|
|
64
78
|
function prefetchNodeDataProvidersData(_x) {
|
|
65
79
|
return _prefetchNodeDataProvidersData.apply(this, arguments);
|
|
@@ -101,39 +115,47 @@ function _prefetchNodeDataProvidersData() {
|
|
|
101
115
|
});
|
|
102
116
|
promises = nodesWithProviders.map( /*#__PURE__*/function () {
|
|
103
117
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref5) {
|
|
104
|
-
var nodes, provider, timeout, timeoutPromise, data;
|
|
118
|
+
var nodes, provider, timeout, start, getDurationFromStart, timeoutPromise, data;
|
|
105
119
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
106
120
|
while (1) switch (_context.prev = _context.next) {
|
|
107
121
|
case 0:
|
|
122
|
+
getDurationFromStart = function _getDurationFromStart() {
|
|
123
|
+
return Math.min(performance.now() - start, timeout);
|
|
124
|
+
};
|
|
108
125
|
nodes = _ref5.nodes, provider = _ref5.provider, timeout = _ref5.timeout;
|
|
109
|
-
|
|
110
|
-
|
|
126
|
+
start = performance.now();
|
|
127
|
+
_context.prev = 3;
|
|
128
|
+
timeoutPromise = new Promise(function (_, reject) {
|
|
111
129
|
setTimeout(function () {
|
|
112
|
-
|
|
130
|
+
reject();
|
|
113
131
|
}, timeout);
|
|
114
132
|
});
|
|
115
|
-
_context.next =
|
|
133
|
+
_context.next = 7;
|
|
116
134
|
return Promise.race([provider.fetchNodesData(nodes), timeoutPromise]);
|
|
117
|
-
case
|
|
135
|
+
case 7:
|
|
118
136
|
data = _context.sent;
|
|
119
137
|
return _context.abrupt("return", {
|
|
120
138
|
provider: provider,
|
|
139
|
+
success: true,
|
|
140
|
+
duration: getDurationFromStart(),
|
|
121
141
|
nodes: nodes,
|
|
122
142
|
data: data
|
|
123
143
|
});
|
|
124
|
-
case
|
|
125
|
-
_context.prev =
|
|
126
|
-
_context.t0 = _context["catch"](
|
|
144
|
+
case 11:
|
|
145
|
+
_context.prev = 11;
|
|
146
|
+
_context.t0 = _context["catch"](3);
|
|
127
147
|
return _context.abrupt("return", {
|
|
128
148
|
provider: provider,
|
|
149
|
+
success: false,
|
|
150
|
+
duration: getDurationFromStart(),
|
|
129
151
|
nodes: nodes,
|
|
130
152
|
data: []
|
|
131
153
|
});
|
|
132
|
-
case
|
|
154
|
+
case 14:
|
|
133
155
|
case "end":
|
|
134
156
|
return _context.stop();
|
|
135
157
|
}
|
|
136
|
-
}, _callee, null, [[
|
|
158
|
+
}, _callee, null, [[3, 11]]);
|
|
137
159
|
}));
|
|
138
160
|
return function (_x2) {
|
|
139
161
|
return _ref6.apply(this, arguments);
|
|
@@ -145,14 +167,21 @@ function _prefetchNodeDataProvidersData() {
|
|
|
145
167
|
results = _context2.sent;
|
|
146
168
|
return _context2.abrupt("return", results.reduce(function (acc, _ref7) {
|
|
147
169
|
var provider = _ref7.provider,
|
|
170
|
+
success = _ref7.success,
|
|
171
|
+
duration = _ref7.duration,
|
|
148
172
|
nodes = _ref7.nodes,
|
|
149
173
|
data = _ref7.data;
|
|
150
|
-
|
|
174
|
+
var ssrData = data.reduce(function (providerSsrData, nodeData, nodeIndex) {
|
|
151
175
|
var node = nodes[nodeIndex];
|
|
152
176
|
var nodeDataKey = provider.nodeDataKey(node);
|
|
153
177
|
providerSsrData[nodeDataKey] = nodeData;
|
|
154
178
|
return providerSsrData;
|
|
155
179
|
}, {});
|
|
180
|
+
acc[provider.name] = {
|
|
181
|
+
data: ssrData,
|
|
182
|
+
success: success,
|
|
183
|
+
duration: duration
|
|
184
|
+
};
|
|
156
185
|
return acc;
|
|
157
186
|
}, {}));
|
|
158
187
|
case 9:
|
|
@@ -13,14 +13,28 @@ import { findNodesToPrefetch } from './find-nodes-to-prefetch';
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Represents the aggregated SSR data for all node data providers.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Each key is a provider's name, and the value contains the fetch status, duration,
|
|
17
|
+
* and a map of node data keys to their prefetched data.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
|
+
* ```
|
|
20
21
|
* {
|
|
21
|
-
*
|
|
22
|
-
*
|
|
22
|
+
* mentionProvider: {
|
|
23
|
+
* success: true,
|
|
24
|
+
* duration: 220,
|
|
25
|
+
* data: {
|
|
26
|
+
* 'mention-1': { id: '1', name: 'John Doe' }
|
|
27
|
+
* }
|
|
28
|
+
* },
|
|
29
|
+
* emojiProvider: {
|
|
30
|
+
* success: true,
|
|
31
|
+
* duration: 110,
|
|
32
|
+
* data: {
|
|
33
|
+
* 'emoji-123': { shortName: ':smile:', representation: '😊' }
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
23
36
|
* }
|
|
37
|
+
* ```
|
|
24
38
|
*/
|
|
25
39
|
|
|
26
40
|
/**
|
|
@@ -43,7 +57,7 @@ import { findNodesToPrefetch } from './find-nodes-to-prefetch';
|
|
|
43
57
|
* },
|
|
44
58
|
* ];
|
|
45
59
|
*
|
|
46
|
-
*
|
|
60
|
+
* const data = await prefetchNodeDataProvidersData({
|
|
47
61
|
* providers,
|
|
48
62
|
* doc,
|
|
49
63
|
* timeout: 1_000,
|
|
@@ -53,7 +67,7 @@ import { findNodesToPrefetch } from './find-nodes-to-prefetch';
|
|
|
53
67
|
*
|
|
54
68
|
* @param props The properties for prefetching node data.
|
|
55
69
|
* @returns Record of provider names to their respective SSR data,
|
|
56
|
-
*
|
|
70
|
+
* success status, and duration of the fetch operation.
|
|
57
71
|
*/
|
|
58
72
|
export async function prefetchNodeDataProvidersData({
|
|
59
73
|
providers,
|
|
@@ -91,21 +105,29 @@ export async function prefetchNodeDataProvidersData({
|
|
|
91
105
|
provider,
|
|
92
106
|
timeout
|
|
93
107
|
}) => {
|
|
108
|
+
const start = performance.now();
|
|
109
|
+
function getDurationFromStart() {
|
|
110
|
+
return Math.min(performance.now() - start, timeout);
|
|
111
|
+
}
|
|
94
112
|
try {
|
|
95
|
-
const timeoutPromise = new Promise(
|
|
113
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
96
114
|
setTimeout(() => {
|
|
97
|
-
|
|
115
|
+
reject();
|
|
98
116
|
}, timeout);
|
|
99
117
|
});
|
|
100
118
|
const data = await Promise.race([provider.fetchNodesData(nodes), timeoutPromise]);
|
|
101
119
|
return {
|
|
102
120
|
provider,
|
|
121
|
+
success: true,
|
|
122
|
+
duration: getDurationFromStart(),
|
|
103
123
|
nodes,
|
|
104
124
|
data
|
|
105
125
|
};
|
|
106
126
|
} catch {
|
|
107
127
|
return {
|
|
108
128
|
provider,
|
|
129
|
+
success: false,
|
|
130
|
+
duration: getDurationFromStart(),
|
|
109
131
|
nodes,
|
|
110
132
|
data: []
|
|
111
133
|
};
|
|
@@ -114,15 +136,22 @@ export async function prefetchNodeDataProvidersData({
|
|
|
114
136
|
const results = await Promise.all(promises);
|
|
115
137
|
return results.reduce((acc, {
|
|
116
138
|
provider,
|
|
139
|
+
success,
|
|
140
|
+
duration,
|
|
117
141
|
nodes,
|
|
118
142
|
data
|
|
119
143
|
}) => {
|
|
120
|
-
|
|
144
|
+
const ssrData = data.reduce((providerSsrData, nodeData, nodeIndex) => {
|
|
121
145
|
const node = nodes[nodeIndex];
|
|
122
146
|
const nodeDataKey = provider.nodeDataKey(node);
|
|
123
147
|
providerSsrData[nodeDataKey] = nodeData;
|
|
124
148
|
return providerSsrData;
|
|
125
149
|
}, {});
|
|
150
|
+
acc[provider.name] = {
|
|
151
|
+
data: ssrData,
|
|
152
|
+
success,
|
|
153
|
+
duration
|
|
154
|
+
};
|
|
126
155
|
return acc;
|
|
127
156
|
}, {});
|
|
128
157
|
}
|
|
@@ -15,14 +15,28 @@ import { findNodesToPrefetch } from './find-nodes-to-prefetch';
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Represents the aggregated SSR data for all node data providers.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Each key is a provider's name, and the value contains the fetch status, duration,
|
|
19
|
+
* and a map of node data keys to their prefetched data.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
|
+
* ```
|
|
22
23
|
* {
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* mentionProvider: {
|
|
25
|
+
* success: true,
|
|
26
|
+
* duration: 220,
|
|
27
|
+
* data: {
|
|
28
|
+
* 'mention-1': { id: '1', name: 'John Doe' }
|
|
29
|
+
* }
|
|
30
|
+
* },
|
|
31
|
+
* emojiProvider: {
|
|
32
|
+
* success: true,
|
|
33
|
+
* duration: 110,
|
|
34
|
+
* data: {
|
|
35
|
+
* 'emoji-123': { shortName: ':smile:', representation: '😊' }
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
25
38
|
* }
|
|
39
|
+
* ```
|
|
26
40
|
*/
|
|
27
41
|
|
|
28
42
|
/**
|
|
@@ -45,7 +59,7 @@ import { findNodesToPrefetch } from './find-nodes-to-prefetch';
|
|
|
45
59
|
* },
|
|
46
60
|
* ];
|
|
47
61
|
*
|
|
48
|
-
*
|
|
62
|
+
* const data = await prefetchNodeDataProvidersData({
|
|
49
63
|
* providers,
|
|
50
64
|
* doc,
|
|
51
65
|
* timeout: 1_000,
|
|
@@ -55,7 +69,7 @@ import { findNodesToPrefetch } from './find-nodes-to-prefetch';
|
|
|
55
69
|
*
|
|
56
70
|
* @param props The properties for prefetching node data.
|
|
57
71
|
* @returns Record of provider names to their respective SSR data,
|
|
58
|
-
*
|
|
72
|
+
* success status, and duration of the fetch operation.
|
|
59
73
|
*/
|
|
60
74
|
export function prefetchNodeDataProvidersData(_x) {
|
|
61
75
|
return _prefetchNodeDataProvidersData.apply(this, arguments);
|
|
@@ -97,39 +111,47 @@ function _prefetchNodeDataProvidersData() {
|
|
|
97
111
|
});
|
|
98
112
|
promises = nodesWithProviders.map( /*#__PURE__*/function () {
|
|
99
113
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref5) {
|
|
100
|
-
var nodes, provider, timeout, timeoutPromise, data;
|
|
114
|
+
var nodes, provider, timeout, start, getDurationFromStart, timeoutPromise, data;
|
|
101
115
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
102
116
|
while (1) switch (_context.prev = _context.next) {
|
|
103
117
|
case 0:
|
|
118
|
+
getDurationFromStart = function _getDurationFromStart() {
|
|
119
|
+
return Math.min(performance.now() - start, timeout);
|
|
120
|
+
};
|
|
104
121
|
nodes = _ref5.nodes, provider = _ref5.provider, timeout = _ref5.timeout;
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
start = performance.now();
|
|
123
|
+
_context.prev = 3;
|
|
124
|
+
timeoutPromise = new Promise(function (_, reject) {
|
|
107
125
|
setTimeout(function () {
|
|
108
|
-
|
|
126
|
+
reject();
|
|
109
127
|
}, timeout);
|
|
110
128
|
});
|
|
111
|
-
_context.next =
|
|
129
|
+
_context.next = 7;
|
|
112
130
|
return Promise.race([provider.fetchNodesData(nodes), timeoutPromise]);
|
|
113
|
-
case
|
|
131
|
+
case 7:
|
|
114
132
|
data = _context.sent;
|
|
115
133
|
return _context.abrupt("return", {
|
|
116
134
|
provider: provider,
|
|
135
|
+
success: true,
|
|
136
|
+
duration: getDurationFromStart(),
|
|
117
137
|
nodes: nodes,
|
|
118
138
|
data: data
|
|
119
139
|
});
|
|
120
|
-
case
|
|
121
|
-
_context.prev =
|
|
122
|
-
_context.t0 = _context["catch"](
|
|
140
|
+
case 11:
|
|
141
|
+
_context.prev = 11;
|
|
142
|
+
_context.t0 = _context["catch"](3);
|
|
123
143
|
return _context.abrupt("return", {
|
|
124
144
|
provider: provider,
|
|
145
|
+
success: false,
|
|
146
|
+
duration: getDurationFromStart(),
|
|
125
147
|
nodes: nodes,
|
|
126
148
|
data: []
|
|
127
149
|
});
|
|
128
|
-
case
|
|
150
|
+
case 14:
|
|
129
151
|
case "end":
|
|
130
152
|
return _context.stop();
|
|
131
153
|
}
|
|
132
|
-
}, _callee, null, [[
|
|
154
|
+
}, _callee, null, [[3, 11]]);
|
|
133
155
|
}));
|
|
134
156
|
return function (_x2) {
|
|
135
157
|
return _ref6.apply(this, arguments);
|
|
@@ -141,14 +163,21 @@ function _prefetchNodeDataProvidersData() {
|
|
|
141
163
|
results = _context2.sent;
|
|
142
164
|
return _context2.abrupt("return", results.reduce(function (acc, _ref7) {
|
|
143
165
|
var provider = _ref7.provider,
|
|
166
|
+
success = _ref7.success,
|
|
167
|
+
duration = _ref7.duration,
|
|
144
168
|
nodes = _ref7.nodes,
|
|
145
169
|
data = _ref7.data;
|
|
146
|
-
|
|
170
|
+
var ssrData = data.reduce(function (providerSsrData, nodeData, nodeIndex) {
|
|
147
171
|
var node = nodes[nodeIndex];
|
|
148
172
|
var nodeDataKey = provider.nodeDataKey(node);
|
|
149
173
|
providerSsrData[nodeDataKey] = nodeData;
|
|
150
174
|
return providerSsrData;
|
|
151
175
|
}, {});
|
|
176
|
+
acc[provider.name] = {
|
|
177
|
+
data: ssrData,
|
|
178
|
+
success: success,
|
|
179
|
+
duration: duration
|
|
180
|
+
};
|
|
152
181
|
return acc;
|
|
153
182
|
}, {}));
|
|
154
183
|
case 9:
|
|
@@ -15,17 +15,35 @@ type SsrData = {
|
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Represents the aggregated SSR data for all node data providers.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Each key is a provider's name, and the value contains the fetch status, duration,
|
|
19
|
+
* and a map of node data keys to their prefetched data.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
|
+
* ```
|
|
22
23
|
* {
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* mentionProvider: {
|
|
25
|
+
* success: true,
|
|
26
|
+
* duration: 220,
|
|
27
|
+
* data: {
|
|
28
|
+
* 'mention-1': { id: '1', name: 'John Doe' }
|
|
29
|
+
* }
|
|
30
|
+
* },
|
|
31
|
+
* emojiProvider: {
|
|
32
|
+
* success: true,
|
|
33
|
+
* duration: 110,
|
|
34
|
+
* data: {
|
|
35
|
+
* 'emoji-123': { shortName: ':smile:', representation: '😊' }
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
25
38
|
* }
|
|
39
|
+
* ```
|
|
26
40
|
*/
|
|
27
41
|
type NodeDataProvidersSsrData = {
|
|
28
|
-
[providerName: string]:
|
|
42
|
+
[providerName: string]: {
|
|
43
|
+
success: boolean;
|
|
44
|
+
duration: number;
|
|
45
|
+
data: SsrData;
|
|
46
|
+
};
|
|
29
47
|
};
|
|
30
48
|
interface Props {
|
|
31
49
|
/**
|
|
@@ -91,7 +109,7 @@ interface Props {
|
|
|
91
109
|
* },
|
|
92
110
|
* ];
|
|
93
111
|
*
|
|
94
|
-
*
|
|
112
|
+
* const data = await prefetchNodeDataProvidersData({
|
|
95
113
|
* providers,
|
|
96
114
|
* doc,
|
|
97
115
|
* timeout: 1_000,
|
|
@@ -101,7 +119,7 @@ interface Props {
|
|
|
101
119
|
*
|
|
102
120
|
* @param props The properties for prefetching node data.
|
|
103
121
|
* @returns Record of provider names to their respective SSR data,
|
|
104
|
-
*
|
|
122
|
+
* success status, and duration of the fetch operation.
|
|
105
123
|
*/
|
|
106
124
|
export declare function prefetchNodeDataProvidersData({ providers, doc, timeout, maxNodesToVisit, }: Props): Promise<NodeDataProvidersSsrData>;
|
|
107
125
|
export {};
|
|
@@ -15,17 +15,35 @@ type SsrData = {
|
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Represents the aggregated SSR data for all node data providers.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Each key is a provider's name, and the value contains the fetch status, duration,
|
|
19
|
+
* and a map of node data keys to their prefetched data.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
|
+
* ```
|
|
22
23
|
* {
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* mentionProvider: {
|
|
25
|
+
* success: true,
|
|
26
|
+
* duration: 220,
|
|
27
|
+
* data: {
|
|
28
|
+
* 'mention-1': { id: '1', name: 'John Doe' }
|
|
29
|
+
* }
|
|
30
|
+
* },
|
|
31
|
+
* emojiProvider: {
|
|
32
|
+
* success: true,
|
|
33
|
+
* duration: 110,
|
|
34
|
+
* data: {
|
|
35
|
+
* 'emoji-123': { shortName: ':smile:', representation: '😊' }
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
25
38
|
* }
|
|
39
|
+
* ```
|
|
26
40
|
*/
|
|
27
41
|
type NodeDataProvidersSsrData = {
|
|
28
|
-
[providerName: string]:
|
|
42
|
+
[providerName: string]: {
|
|
43
|
+
success: boolean;
|
|
44
|
+
duration: number;
|
|
45
|
+
data: SsrData;
|
|
46
|
+
};
|
|
29
47
|
};
|
|
30
48
|
interface Props {
|
|
31
49
|
/**
|
|
@@ -91,7 +109,7 @@ interface Props {
|
|
|
91
109
|
* },
|
|
92
110
|
* ];
|
|
93
111
|
*
|
|
94
|
-
*
|
|
112
|
+
* const data = await prefetchNodeDataProvidersData({
|
|
95
113
|
* providers,
|
|
96
114
|
* doc,
|
|
97
115
|
* timeout: 1_000,
|
|
@@ -101,7 +119,7 @@ interface Props {
|
|
|
101
119
|
*
|
|
102
120
|
* @param props The properties for prefetching node data.
|
|
103
121
|
* @returns Record of provider names to their respective SSR data,
|
|
104
|
-
*
|
|
122
|
+
* success status, and duration of the fetch operation.
|
|
105
123
|
*/
|
|
106
124
|
export declare function prefetchNodeDataProvidersData({ providers, doc, timeout, maxNodesToVisit, }: Props): Promise<NodeDataProvidersSsrData>;
|
|
107
125
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/node-data-provider",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"description": "Node data provider for @atlaskit/editor-core plugins and @atlaskit/renderer",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
".": "./src/index.ts"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@atlaskit/adf-schema": "^50.0
|
|
25
|
+
"@atlaskit/adf-schema": "^50.2.0",
|
|
26
26
|
"@atlaskit/adf-utils": "^19.20.0",
|
|
27
|
-
"@atlaskit/editor-json-transformer": "^8.
|
|
27
|
+
"@atlaskit/editor-json-transformer": "^8.25.0",
|
|
28
28
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
29
29
|
"@babel/runtime": "^7.0.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@atlaskit/editor-common": "^107.
|
|
32
|
+
"@atlaskit/editor-common": "^107.16.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "~5.4.2"
|