Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/computed/trace-engine-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ class TraceEngineResult {
if (value && typeof value === 'object' && '__i18nBytes' in value) {
values[key] = value.__i18nBytes;
// TODO: use an actual byte formatter. Right now, this shows the exact number of bytes.
} else if (value && typeof value === 'object' && '__i18nMillis' in value) {
values[key] = `${value.__i18nMillis} ms`;
// TODO: use an actual time formatter.
} else if (value && typeof value === 'object' && 'i18nId' in value) {
// TODO: add support for str_ values to be IcuMessage. For now, we translate it here.
// This means that locale swapping won't work for this portion of the IcuMessage.
Expand Down Expand Up @@ -172,6 +175,10 @@ class TraceEngineResult {
// @ts-expect-error
values[key] = value.__i18nBytes;
// TODO: use an actual byte formatter. Right now, this shows the exact number of bytes.
} else if (value && typeof value === 'object' && '__i18nMillis' in value) {
// @ts-expect-error
values[key] = `${value.__i18nMillis} ms`;
// TODO: use an actual time formatter.
} else if (value && typeof value === 'object' && 'i18nId' in value) {
// TODO: add support for str_ values to be IcuMessage.
// @ts-expect-error
Expand Down
1 change: 1 addition & 0 deletions core/lib/network-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const RESOURCE_TYPES = {
Preflight: 'Preflight',
CSPViolationReport: 'CSPViolationReport',
Prefetch: 'Prefetch',
FedCM: 'FedCM',
};

class NetworkRequest {
Expand Down
2 changes: 1 addition & 1 deletion core/lib/trace-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {polyfillDOMRect} from './polyfill-dom-rect.js';

/** @typedef {import('@paulirish/trace_engine').Types.Events.SyntheticLayoutShift} SyntheticLayoutShift */
/** @typedef {SyntheticLayoutShift & {args: {data: NonNullable<SyntheticLayoutShift['args']['data']>}}} SaneSyntheticLayoutShift */
/** @typedef {{i18nId: string, values: Record<string, string|number|{__i18nBytes: number}>}} DevToolsIcuMessage */
/** @typedef {{i18nId: string, values: Record<string, string|number|{__i18nBytes: number}|{__i18nMillis: number}>}} DevToolsIcuMessage */

polyfillDOMRect();

Expand Down
61 changes: 39 additions & 22 deletions core/test/fixtures/user-flows/reports/sample-flow-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -3979,7 +3979,7 @@
"value": true
},
"serverResponseIsFast": {
"label": "Server responds quickly",
"label": "Server responds quickly (observed 40 ms) ",
"value": true
},
"usesCompression": {
Expand Down Expand Up @@ -4229,7 +4229,7 @@
"legacy-javascript-insight": {
"id": "legacy-javascript-insight",
"title": "Legacy JavaScript",
"description": "Polyfills and transforms enable legacy browsers to use new JavaScript features. However, many aren't necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support legacy browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://philipwalton.com/articles/the-state-of-es5-on-the-web/)",
"description": "Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren't necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support older browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://philipwalton.com/articles/the-state-of-es5-on-the-web/)",
"score": null,
"scoreDisplayMode": "notApplicable",
"guidanceLevel": 2
Expand Down Expand Up @@ -4274,7 +4274,7 @@
"render-blocking-insight": {
"id": "render-blocking-insight",
"title": "Render blocking requests",
"description": "Requests are blocking the page's initial render, which may delay LCP. [Deferring or inlining](https://web.dev/learn/performance/understanding-the-critical-path#render-blocking_resources/) can move these network requests out of the critical path.",
"description": "Requests are blocking the page's initial render, which may delay LCP. [Deferring or inlining](https://web.dev/learn/performance/understanding-the-critical-path#render-blocking_resources) can move these network requests out of the critical path.",
"score": null,
"scoreDisplayMode": "notApplicable",
"guidanceLevel": 3,
Expand All @@ -4285,7 +4285,7 @@
"third-parties-insight": {
"id": "third-parties-insight",
"title": "3rd parties",
"description": "3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/) to prioritize your page's content.",
"description": "3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://web.dev/articles/optimizing-content-efficiency-loading-third-party-javascript/) to prioritize your page's content.",
"score": 1,
"scoreDisplayMode": "informative",
"details": {
Expand Down Expand Up @@ -6991,13 +6991,13 @@
},
{
"startTime": 161,
"name": "lh:computed:TraceEngineResult:parse:Warnings:finalize",
"name": "lh:computed:TraceEngineResult:parse:Workers:finalize",
"duration": 1,
"entryType": "measure"
},
{
"startTime": 162,
"name": "lh:computed:TraceEngineResult:parse:Workers:finalize",
"name": "lh:computed:TraceEngineResult:parse:Warnings:finalize",
"duration": 1,
"entryType": "measure"
},
Expand Down Expand Up @@ -9347,7 +9347,12 @@
"audits[document-latency-insight].details.items.noRedirects.label"
],
"node_modules/@paulirish/trace_engine/models/trace/insights/DocumentLatency.js | passingServerResponseTime": [
"audits[document-latency-insight].details.items.serverResponseIsFast.label"
{
"values": {
"PH1": "40 ms"
},
"path": "audits[document-latency-insight].details.items.serverResponseIsFast.label"
}
],
"node_modules/@paulirish/trace_engine/models/trace/insights/DocumentLatency.js | passingTextCompression": [
"audits[document-latency-insight].details.items.usesCompression.label"
Expand Down Expand Up @@ -12214,7 +12219,7 @@
"legacy-javascript-insight": {
"id": "legacy-javascript-insight",
"title": "Legacy JavaScript",
"description": "Polyfills and transforms enable legacy browsers to use new JavaScript features. However, many aren't necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support legacy browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://philipwalton.com/articles/the-state-of-es5-on-the-web/)",
"description": "Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren't necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support older browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://philipwalton.com/articles/the-state-of-es5-on-the-web/)",
"score": null,
"scoreDisplayMode": "notApplicable",
"guidanceLevel": 2
Expand Down Expand Up @@ -12251,7 +12256,7 @@
"render-blocking-insight": {
"id": "render-blocking-insight",
"title": "Render blocking requests",
"description": "Requests are blocking the page's initial render, which may delay LCP. [Deferring or inlining](https://web.dev/learn/performance/understanding-the-critical-path#render-blocking_resources/) can move these network requests out of the critical path.",
"description": "Requests are blocking the page's initial render, which may delay LCP. [Deferring or inlining](https://web.dev/learn/performance/understanding-the-critical-path#render-blocking_resources) can move these network requests out of the critical path.",
"score": null,
"scoreDisplayMode": "notApplicable",
"guidanceLevel": 3,
Expand All @@ -12262,7 +12267,7 @@
"third-parties-insight": {
"id": "third-parties-insight",
"title": "3rd parties",
"description": "3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/) to prioritize your page's content.",
"description": "3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://web.dev/articles/optimizing-content-efficiency-loading-third-party-javascript/) to prioritize your page's content.",
"score": 1,
"scoreDisplayMode": "informative",
"details": {
Expand Down Expand Up @@ -13634,13 +13639,13 @@
},
{
"startTime": 105,
"name": "lh:computed:TraceEngineResult:parse:Warnings:finalize",
"name": "lh:computed:TraceEngineResult:parse:Workers:finalize",
"duration": 1,
"entryType": "measure"
},
{
"startTime": 106,
"name": "lh:computed:TraceEngineResult:parse:Workers:finalize",
"name": "lh:computed:TraceEngineResult:parse:Warnings:finalize",
"duration": 1,
"entryType": "measure"
},
Expand Down Expand Up @@ -24317,7 +24322,7 @@
"value": true
},
"serverResponseIsFast": {
"label": "Server responds quickly",
"label": "Server responds quickly (observed 27 ms) ",
"value": true
},
"usesCompression": {
Expand Down Expand Up @@ -24455,7 +24460,7 @@
"displayValue": "Est savings of 90 KiB",
"metricSavings": {
"FCP": 0,
"LCP": 500
"LCP": 600
},
"details": {
"type": "table",
Expand Down Expand Up @@ -24624,7 +24629,7 @@
"legacy-javascript-insight": {
"id": "legacy-javascript-insight",
"title": "Legacy JavaScript",
"description": "Polyfills and transforms enable legacy browsers to use new JavaScript features. However, many aren't necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support legacy browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://philipwalton.com/articles/the-state-of-es5-on-the-web/)",
"description": "Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren't necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support older browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://philipwalton.com/articles/the-state-of-es5-on-the-web/)",
"score": null,
"scoreDisplayMode": "notApplicable",
"guidanceLevel": 2
Expand All @@ -24641,7 +24646,7 @@
"id": "network-dependency-tree-insight",
"title": "Network dependency tree",
"description": "[Avoid chaining critical requests](https://developer.chrome.com/docs/lighthouse/performance/critical-request-chains) by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load.",
"score": 1,
"score": 0,
"scoreDisplayMode": "numeric",
"metricSavings": {
"LCP": 0
Expand All @@ -24654,7 +24659,14 @@
"navStartToEndTime": 185,
"transferSize": 3612,
"isLongest": true,
"children": {}
"children": {
"27446.102": {
"url": "https://www.google-analytics.com/g/collect?v=2&tid=G-RTW9M3W5HC&gtm=45je5230v9102781914za200&_p=1738719102855&gcd=13l3l3l3l1l1&npa=0&dma=0&tag_exp=102067808~102081485~102123608~102482432~102539968~102558064&cid=974257356.1738719103&ul=en-us&sr=412x823&uaa=&uab=64&uafvl=Chromium%3B134.0.6998.0%7CNot%253AA-Brand%3B24.0.0.0%7CGoogle%2520Chrome%3B134.0.6998.0&uamb=1&uam=moto%20g%20power%20(2022)&uap=Android&uapv=11.0&uaw=0&are=1&frm=0&pscdl=noapi&_s=5&sid=1738719103&sct=1&seg=1&dl=https%3A%2F%2Fwww.mikescerealshack.co%2Fsearch%3Fq%3Dcall%2Bof%2Bduty&dr=https%3A%2F%2Fwww.mikescerealshack.co%2F&dt=%22call%20of%20duty%22%20Results%20-%20Mike%27s%20Cereal%20Shack%3A%20The%20Office%20Search%20Engine&en=user_engagement&_et=9757&tfd=19216",
"navStartToEndTime": 177,
"transferSize": 0,
"children": {}
}
}
}
},
"longestChain": {
Expand All @@ -24669,7 +24681,7 @@
"render-blocking-insight": {
"id": "render-blocking-insight",
"title": "Render blocking requests",
"description": "Requests are blocking the page's initial render, which may delay LCP. [Deferring or inlining](https://web.dev/learn/performance/understanding-the-critical-path#render-blocking_resources/) can move these network requests out of the critical path.",
"description": "Requests are blocking the page's initial render, which may delay LCP. [Deferring or inlining](https://web.dev/learn/performance/understanding-the-critical-path#render-blocking_resources) can move these network requests out of the critical path.",
"score": null,
"scoreDisplayMode": "notApplicable",
"guidanceLevel": 3,
Expand All @@ -24680,7 +24692,7 @@
"third-parties-insight": {
"id": "third-parties-insight",
"title": "3rd parties",
"description": "3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/) to prioritize your page's content.",
"description": "3rd party code can significantly impact load performance. [Reduce and defer loading of 3rd party code](https://web.dev/articles/optimizing-content-efficiency-loading-third-party-javascript/) to prioritize your page's content.",
"score": 1,
"scoreDisplayMode": "informative",
"details": {
Expand Down Expand Up @@ -27432,13 +27444,13 @@
},
{
"startTime": 159,
"name": "lh:computed:TraceEngineResult:parse:Warnings:finalize",
"name": "lh:computed:TraceEngineResult:parse:Workers:finalize",
"duration": 1,
"entryType": "measure"
},
{
"startTime": 160,
"name": "lh:computed:TraceEngineResult:parse:Workers:finalize",
"name": "lh:computed:TraceEngineResult:parse:Warnings:finalize",
"duration": 1,
"entryType": "measure"
},
Expand Down Expand Up @@ -29799,7 +29811,12 @@
"audits[document-latency-insight].details.items.noRedirects.label"
],
"node_modules/@paulirish/trace_engine/models/trace/insights/DocumentLatency.js | passingServerResponseTime": [
"audits[document-latency-insight].details.items.serverResponseIsFast.label"
{
"values": {
"PH1": "27 ms"
},
"path": "audits[document-latency-insight].details.items.serverResponseIsFast.label"
}
],
"node_modules/@paulirish/trace_engine/models/trace/insights/DocumentLatency.js | passingTextCompression": [
"audits[document-latency-insight].details.items.usesCompression.label"
Expand Down
Loading
Loading