@lwrjs/lwc-ssr 0.19.0-alpha.8 → 0.19.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.
- package/build/cjs/renderer.cjs +19 -0
- package/build/es/renderer.js +22 -0
- package/package.json +9 -9
package/build/cjs/renderer.cjs
CHANGED
|
@@ -275,6 +275,19 @@ function getServerData(component, context, serverData) {
|
|
|
275
275
|
const warnings = data.warnings.map((w) => (0, import_diagnostics.stringifyError)(w)).join(", ");
|
|
276
276
|
span.setAttributes({warnings});
|
|
277
277
|
}
|
|
278
|
+
const dataProviderMetrics = data.props?.metrics?.dataProvider;
|
|
279
|
+
if (dataProviderMetrics) {
|
|
280
|
+
const {success: dataProviderSuccess, warnings: dataProviderWarnings} = dataProviderMetrics;
|
|
281
|
+
if (dataProviderSuccess && dataProviderSuccess.length > 0) {
|
|
282
|
+
span.setAttributes({dataProviderSuccess});
|
|
283
|
+
}
|
|
284
|
+
if (dataProviderWarnings && dataProviderWarnings.length > 0) {
|
|
285
|
+
span.setAttributes({dataProviderWarnings});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (data.props?.metrics) {
|
|
289
|
+
delete data.props.metrics;
|
|
290
|
+
}
|
|
278
291
|
return data;
|
|
279
292
|
} catch (e) {
|
|
280
293
|
if (e instanceof import_diagnostics.LwrError)
|
|
@@ -283,6 +296,12 @@ function getServerData(component, context, serverData) {
|
|
|
283
296
|
if (typeof statusError.status === "number") {
|
|
284
297
|
throw new import_diagnostics.LwrStatusError(statusError.message, statusError.status, statusError.headers);
|
|
285
298
|
}
|
|
299
|
+
if (e.dataProviderFailed) {
|
|
300
|
+
const dataProviderFailed = e.dataProviderFailed;
|
|
301
|
+
if (dataProviderFailed.length > 0) {
|
|
302
|
+
span.setAttributes({dataProviderFailed});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
286
305
|
throw new import_diagnostics.LwrApplicationError(`Error in "getServerData" for "${component.specifier}": ${(0, import_diagnostics.stringifyError)(e)}`);
|
|
287
306
|
}
|
|
288
307
|
});
|
package/build/es/renderer.js
CHANGED
|
@@ -375,6 +375,21 @@ function getServerData(component, context, serverData) {
|
|
|
375
375
|
const warnings = data.warnings.map((w) => stringifyError(w)).join(', ');
|
|
376
376
|
span.setAttributes({ warnings });
|
|
377
377
|
}
|
|
378
|
+
// Add data provider lists as span attributes (extracted from response)
|
|
379
|
+
const dataProviderMetrics = data.props?.metrics?.dataProvider;
|
|
380
|
+
if (dataProviderMetrics) {
|
|
381
|
+
const { success: dataProviderSuccess, warnings: dataProviderWarnings } = dataProviderMetrics;
|
|
382
|
+
if (dataProviderSuccess && dataProviderSuccess.length > 0) {
|
|
383
|
+
span.setAttributes({ dataProviderSuccess });
|
|
384
|
+
}
|
|
385
|
+
if (dataProviderWarnings && dataProviderWarnings.length > 0) {
|
|
386
|
+
span.setAttributes({ dataProviderWarnings });
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
// Remove metrics from the response after processing
|
|
390
|
+
if (data.props?.metrics) {
|
|
391
|
+
delete data.props.metrics;
|
|
392
|
+
}
|
|
378
393
|
return data;
|
|
379
394
|
}
|
|
380
395
|
catch (e) {
|
|
@@ -386,6 +401,13 @@ function getServerData(component, context, serverData) {
|
|
|
386
401
|
if (typeof statusError.status === 'number') {
|
|
387
402
|
throw new LwrStatusError(statusError.message, statusError.status, statusError.headers);
|
|
388
403
|
}
|
|
404
|
+
// Check if this error has dataProviderFailed attached
|
|
405
|
+
if (e.dataProviderFailed) {
|
|
406
|
+
const dataProviderFailed = e.dataProviderFailed;
|
|
407
|
+
if (dataProviderFailed.length > 0) {
|
|
408
|
+
span.setAttributes({ dataProviderFailed });
|
|
409
|
+
}
|
|
410
|
+
}
|
|
389
411
|
throw new LwrApplicationError(`Error in "getServerData" for "${component.specifier}": ${stringifyError(e)}`);
|
|
390
412
|
}
|
|
391
413
|
});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.19.0
|
|
7
|
+
"version": "0.19.0",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -48,20 +48,20 @@
|
|
|
48
48
|
"package.cjs"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@lwrjs/config": "0.19.0
|
|
52
|
-
"@lwrjs/diagnostics": "0.19.0
|
|
53
|
-
"@lwrjs/instrumentation": "0.19.0
|
|
54
|
-
"@lwrjs/loader": "0.19.0
|
|
55
|
-
"@lwrjs/shared-utils": "0.19.0
|
|
51
|
+
"@lwrjs/config": "0.19.0",
|
|
52
|
+
"@lwrjs/diagnostics": "0.19.0",
|
|
53
|
+
"@lwrjs/instrumentation": "0.19.0",
|
|
54
|
+
"@lwrjs/loader": "0.19.0",
|
|
55
|
+
"@lwrjs/shared-utils": "0.19.0",
|
|
56
56
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
57
57
|
"@rollup/plugin-terser": "^0.4.4",
|
|
58
58
|
"fs-extra": "^11.2.0",
|
|
59
59
|
"lru-cache": "^10.4.3",
|
|
60
60
|
"rollup": "^2.79.2",
|
|
61
|
-
"undici": "^6.21.
|
|
61
|
+
"undici": "^6.21.2"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@lwrjs/types": "0.19.0
|
|
64
|
+
"@lwrjs/types": "0.19.0",
|
|
65
65
|
"jest": "29.7.0",
|
|
66
66
|
"memfs": "^4.13.0",
|
|
67
67
|
"ts-jest": "^29.2.6"
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"volta": {
|
|
76
76
|
"extends": "../../../package.json"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "78578bcbf94d64439a250ea19048e492c8f45061"
|
|
79
79
|
}
|