@lwrjs/view-registry 0.17.2-alpha.15 → 0.17.2-alpha.16
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/index.cjs +7 -1
- package/build/es/index.js +10 -2
- package/package.json +7 -7
package/build/cjs/index.cjs
CHANGED
|
@@ -322,13 +322,15 @@ var LwrViewRegistry = class {
|
|
|
322
322
|
metadata: renderedViewMetadata,
|
|
323
323
|
compiledView: {immutable = true}
|
|
324
324
|
} = renderedView;
|
|
325
|
+
let traceId;
|
|
325
326
|
const {linkedMetadata, stringBuilder} = (0, import_instrumentation.getTracer)().trace({
|
|
326
327
|
name: import_instrumentation.ViewSpan.ParseView,
|
|
327
328
|
attributes: {
|
|
328
329
|
view: view.id,
|
|
329
330
|
ssr: view.bootstrap?.ssr === true
|
|
330
331
|
}
|
|
331
|
-
}, () => {
|
|
332
|
+
}, (span) => {
|
|
333
|
+
traceId = span.traceId;
|
|
332
334
|
let linkedMetadata2 = renderedViewMetadata;
|
|
333
335
|
if (!skipMetadataCollection) {
|
|
334
336
|
const contentHash = (0, import_crypto.createHash)("md5").update(renderedViewContent).digest("hex");
|
|
@@ -343,6 +345,10 @@ var LwrViewRegistry = class {
|
|
|
343
345
|
const stringBuilder2 = (0, import_shared_utils.createStringBuilder)(renderedViewContent);
|
|
344
346
|
return {linkedMetadata: linkedMetadata2, stringBuilder: stringBuilder2};
|
|
345
347
|
});
|
|
348
|
+
if (!(0, import_shared_utils.getFeatureFlags)().DISABLE_B3_TRACING && traceId && runtimeParams.viewSpanID) {
|
|
349
|
+
const content = `00-${traceId}-${runtimeParams.viewSpanID}-01`;
|
|
350
|
+
(0, import_shared_utils.addHeadMarkup)([{meta: [{name: "traceparent", content}]}], stringBuilder);
|
|
351
|
+
}
|
|
346
352
|
const mergedViewContext = {
|
|
347
353
|
...viewContext,
|
|
348
354
|
config: this.globalConfig,
|
package/build/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InflightTasks, createStringBuilder, extractMetadataFromHtml, getCacheKeyFromJson, getFeatureFlags, getSpecifier, isLocalDev, normalizeResourcePath, shortestTtl,
|
|
1
|
+
import { InflightTasks, addHeadMarkup, createStringBuilder, extractMetadataFromHtml, getCacheKeyFromJson, getFeatureFlags, getSpecifier, isLocalDev, isRelative, normalizeResourcePath, shortestTtl, } from '@lwrjs/shared-utils';
|
|
2
2
|
import { getTracer, ViewSpan } from '@lwrjs/instrumentation';
|
|
3
3
|
import { generateViewNonce, getViewNonce, normalizeRenderOptions, normalizeRenderedResult, reduceSourceAssetReferences, getViewDefCacheKey, } from './utils.js';
|
|
4
4
|
import { linkLwrResources } from './linkers/link-lwr-resources.js';
|
|
@@ -350,13 +350,15 @@ export class LwrViewRegistry {
|
|
|
350
350
|
const runtimeEnvironment = { ...runtimeEnv, immutableAssets: freezeAssets };
|
|
351
351
|
// normalize/extract metadata
|
|
352
352
|
const { renderedView: renderedViewContent, metadata: renderedViewMetadata, compiledView: { immutable = true }, } = renderedView;
|
|
353
|
+
let traceId;
|
|
353
354
|
const { linkedMetadata, stringBuilder } = getTracer().trace({
|
|
354
355
|
name: ViewSpan.ParseView,
|
|
355
356
|
attributes: {
|
|
356
357
|
view: view.id,
|
|
357
358
|
ssr: view.bootstrap?.ssr === true,
|
|
358
359
|
},
|
|
359
|
-
}, () => {
|
|
360
|
+
}, (span) => {
|
|
361
|
+
traceId = span.traceId;
|
|
360
362
|
let linkedMetadata = renderedViewMetadata;
|
|
361
363
|
if (!skipMetadataCollection) {
|
|
362
364
|
// Create a unique key based on view ID and content hash
|
|
@@ -373,6 +375,12 @@ export class LwrViewRegistry {
|
|
|
373
375
|
const stringBuilder = createStringBuilder(renderedViewContent);
|
|
374
376
|
return { linkedMetadata, stringBuilder };
|
|
375
377
|
});
|
|
378
|
+
// Add distributed tracing meta tag to pass tracing info to the client
|
|
379
|
+
// {version}-{traceId}-{spanId}-{sampleDecision} and version is always 00
|
|
380
|
+
if (!getFeatureFlags().DISABLE_B3_TRACING && traceId && runtimeParams.viewSpanID) {
|
|
381
|
+
const content = `00-${traceId}-${runtimeParams.viewSpanID}-01`;
|
|
382
|
+
addHeadMarkup([{ meta: [{ name: 'traceparent', content }] }], stringBuilder);
|
|
383
|
+
}
|
|
376
384
|
const mergedViewContext = {
|
|
377
385
|
...viewContext,
|
|
378
386
|
config: this.globalConfig,
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.17.2-alpha.
|
|
7
|
+
"version": "0.17.2-alpha.16",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"build": "tsc -b"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@lwrjs/app-service": "0.17.2-alpha.
|
|
37
|
-
"@lwrjs/diagnostics": "0.17.2-alpha.
|
|
38
|
-
"@lwrjs/instrumentation": "0.17.2-alpha.
|
|
39
|
-
"@lwrjs/shared-utils": "0.17.2-alpha.
|
|
36
|
+
"@lwrjs/app-service": "0.17.2-alpha.16",
|
|
37
|
+
"@lwrjs/diagnostics": "0.17.2-alpha.16",
|
|
38
|
+
"@lwrjs/instrumentation": "0.17.2-alpha.16",
|
|
39
|
+
"@lwrjs/shared-utils": "0.17.2-alpha.16",
|
|
40
40
|
"lru-cache": "^10.4.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@lwrjs/types": "0.17.2-alpha.
|
|
43
|
+
"@lwrjs/types": "0.17.2-alpha.16"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=20.0.0"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"volta": {
|
|
49
49
|
"extends": "../../../package.json"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "5a6b24c265145652f9dda60d1d2cb405148c71f3"
|
|
52
52
|
}
|