lighthouse 9.5.0-dev.20230122 → 9.5.0-dev.20230124
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/.codecov.yml +0 -5
- package/core/audits/audit.js +1 -1
- package/core/audits/bf-cache.js +1 -1
- package/core/audits/byte-efficiency/legacy-javascript.d.ts +1 -0
- package/core/audits/byte-efficiency/legacy-javascript.js +7 -3
- package/core/audits/dobetterweb/uses-http2.d.ts +5 -2
- package/core/audits/dobetterweb/uses-http2.js +12 -7
- package/core/audits/screenshot-thumbnails.d.ts +2 -1
- package/core/audits/screenshot-thumbnails.js +14 -9
- package/core/audits/third-party-facades.d.ts +3 -2
- package/core/audits/third-party-facades.js +12 -9
- package/core/audits/third-party-summary.d.ts +7 -6
- package/core/audits/third-party-summary.js +16 -14
- package/core/audits/valid-source-maps.d.ts +5 -3
- package/core/audits/valid-source-maps.js +11 -9
- package/core/computed/entity-classification.d.ts +29 -0
- package/core/computed/entity-classification.js +102 -0
- package/core/computed/processed-navigation.d.ts +12 -6
- package/core/computed/processed-navigation.js +19 -6
- package/core/computed/resource-summary.d.ts +4 -2
- package/core/computed/resource-summary.js +8 -5
- package/core/lib/url-utils.js +1 -1
- package/core/runner.d.ts +10 -0
- package/core/runner.js +48 -0
- package/core/util.cjs +43 -10
- package/core/util.d.cts +114 -2
- package/dist/report/bundle.esm.js +858 -883
- package/dist/report/flow.js +33 -23
- package/dist/report/standalone.js +27 -17
- package/flow-report/assets/standalone-flow-template.html +1 -1
- package/flow-report/src/common.tsx +1 -1
- package/flow-report/src/i18n/i18n.d.ts +103 -100
- package/flow-report/src/i18n/i18n.tsx +23 -18
- package/flow-report/src/sidebar/sidebar.tsx +3 -3
- package/flow-report/src/summary/category.tsx +7 -7
- package/flow-report/src/summary/summary.tsx +2 -2
- package/flow-report/src/topbar.tsx +4 -28
- package/package.json +5 -5
- package/readme.md +1 -1
- package/report/assets/standalone-template.html +1 -1
- package/report/assets/styles.css +3 -3
- package/report/assets/templates.html +4 -28
- package/report/renderer/category-renderer.js +19 -17
- package/report/renderer/components.js +119 -202
- package/report/renderer/crc-details-renderer.js +7 -6
- package/report/renderer/details-renderer.js +7 -6
- package/report/renderer/dom.js +1 -1
- package/report/renderer/element-screenshot-renderer.js +3 -3
- package/report/renderer/{i18n.d.ts → i18n-formatter.d.ts} +3 -9
- package/report/renderer/{i18n.js → i18n-formatter.js} +2 -11
- package/report/renderer/performance-category-renderer.js +17 -15
- package/report/renderer/pwa-category-renderer.js +5 -4
- package/report/renderer/report-globals.d.ts +21 -0
- package/report/renderer/report-globals.js +49 -0
- package/report/renderer/report-renderer.js +22 -24
- package/report/renderer/report-ui-features.js +9 -8
- package/report/renderer/report-utils.d.ts +116 -0
- package/report/renderer/{util.js → report-utils.js} +100 -415
- package/report/renderer/snippet-renderer.js +3 -2
- package/report/test/renderer/category-renderer-test.js +10 -5
- package/report/test/renderer/crc-details-renderer-test.js +8 -4
- package/report/test/renderer/details-renderer-test.js +8 -4
- package/report/test/renderer/dom-test.js +8 -4
- package/report/test/renderer/element-screenshot-renderer-test.js +9 -5
- package/report/test/renderer/{i18n-test.js → i18n-formatter-test.js} +15 -21
- package/report/test/renderer/performance-category-renderer-test.js +15 -10
- package/report/test/renderer/pwa-category-renderer-test.js +11 -6
- package/report/test/renderer/report-renderer-test.js +2 -2
- package/report/test/renderer/report-ui-features-test.js +3 -3
- package/report/test/renderer/{util-test.js → report-utils-test.js} +37 -235
- package/report/test/renderer/snippet-renderer-test.js +8 -4
- package/report/test-assets/lhr-3.0.0.json +2332 -0
- package/report/test-assets/lhr-4.3.0.json +4754 -0
- package/report/test-assets/lhr-5.0.0.json +5994 -0
- package/report/test-assets/lhr-6.0.0.json +7222 -0
- package/report/test-assets/lhr-8.5.0.json +8679 -0
- package/shared/localization/format.js +5 -2
- package/shared/localization/locales/ar-XB.json +50 -50
- package/shared/localization/locales/ar.json +50 -50
- package/shared/localization/locales/bg.json +50 -50
- package/shared/localization/locales/ca.json +50 -50
- package/shared/localization/locales/cs.json +50 -50
- package/shared/localization/locales/da.json +50 -50
- package/shared/localization/locales/de.json +50 -50
- package/shared/localization/locales/el.json +50 -50
- package/shared/localization/locales/en-GB.json +50 -50
- package/shared/localization/locales/en-US.json +55 -55
- package/shared/localization/locales/en-XA.json +50 -50
- package/shared/localization/locales/en-XL.json +55 -55
- package/shared/localization/locales/es-419.json +50 -50
- package/shared/localization/locales/es.json +50 -50
- package/shared/localization/locales/fi.json +50 -50
- package/shared/localization/locales/fil.json +50 -50
- package/shared/localization/locales/fr.json +50 -50
- package/shared/localization/locales/he.json +50 -50
- package/shared/localization/locales/hi.json +50 -50
- package/shared/localization/locales/hr.json +50 -50
- package/shared/localization/locales/hu.json +50 -50
- package/shared/localization/locales/id.json +50 -50
- package/shared/localization/locales/it.json +50 -50
- package/shared/localization/locales/ja.json +50 -50
- package/shared/localization/locales/ko.json +50 -50
- package/shared/localization/locales/lt.json +50 -50
- package/shared/localization/locales/lv.json +50 -50
- package/shared/localization/locales/nl.json +50 -50
- package/shared/localization/locales/no.json +50 -50
- package/shared/localization/locales/pl.json +50 -50
- package/shared/localization/locales/pt-PT.json +50 -50
- package/shared/localization/locales/pt.json +50 -50
- package/shared/localization/locales/ro.json +50 -50
- package/shared/localization/locales/ru.json +50 -50
- package/shared/localization/locales/sk.json +50 -50
- package/shared/localization/locales/sl.json +50 -50
- package/shared/localization/locales/sr-Latn.json +50 -50
- package/shared/localization/locales/sr.json +50 -50
- package/shared/localization/locales/sv.json +50 -50
- package/shared/localization/locales/ta.json +50 -50
- package/shared/localization/locales/te.json +50 -50
- package/shared/localization/locales/th.json +50 -50
- package/shared/localization/locales/tr.json +50 -50
- package/shared/localization/locales/uk.json +50 -50
- package/shared/localization/locales/vi.json +50 -50
- package/shared/localization/locales/zh-HK.json +50 -50
- package/shared/localization/locales/zh-TW.json +50 -50
- package/shared/localization/locales/zh.json +50 -50
- package/shared/test/util-test.js +214 -0
- package/shared/util.d.ts +122 -0
- package/shared/util.js +332 -0
- package/types/artifacts.d.ts +14 -0
- package/types/lhr/lhr.d.ts +33 -0
- package/report/renderer/util.d.ts +0 -230
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export class ReportUtils {
|
|
2
|
+
/**
|
|
3
|
+
* Returns a new LHR that's reshaped for slightly better ergonomics within the report rendereer.
|
|
4
|
+
* Also, sets up the localized UI strings used within renderer and makes changes to old LHRs to be
|
|
5
|
+
* compatible with current renderer.
|
|
6
|
+
* The LHR passed in is not mutated.
|
|
7
|
+
* TODO(team): we all agree the LHR shape change is technical debt we should fix
|
|
8
|
+
* @param {LH.Result} result
|
|
9
|
+
* @return {LH.ReportResult}
|
|
10
|
+
*/
|
|
11
|
+
static prepareReportResult(result: LH.Result): LH.ReportResult;
|
|
12
|
+
/**
|
|
13
|
+
* @param {LH.Result['configSettings']} settings
|
|
14
|
+
* @return {!{deviceEmulation: string, screenEmulation?: string, networkThrottling: string, cpuThrottling: string, summary: string}}
|
|
15
|
+
*/
|
|
16
|
+
static getEmulationDescriptions(settings: LH.Result['configSettings']): {
|
|
17
|
+
deviceEmulation: string;
|
|
18
|
+
screenEmulation?: string | undefined;
|
|
19
|
+
networkThrottling: string;
|
|
20
|
+
cpuThrottling: string;
|
|
21
|
+
summary: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Used to determine if the "passed" for the purposes of showing up in the "failed" or "passed"
|
|
25
|
+
* sections of the report.
|
|
26
|
+
*
|
|
27
|
+
* @param {{score: (number|null), scoreDisplayMode: string}} audit
|
|
28
|
+
* @return {boolean}
|
|
29
|
+
*/
|
|
30
|
+
static showAsPassed(audit: {
|
|
31
|
+
score: (number | null);
|
|
32
|
+
scoreDisplayMode: string;
|
|
33
|
+
}): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Convert a score to a rating label.
|
|
36
|
+
* TODO: Return `'error'` for `score === null && !scoreDisplayMode`.
|
|
37
|
+
*
|
|
38
|
+
* @param {number|null} score
|
|
39
|
+
* @param {string=} scoreDisplayMode
|
|
40
|
+
* @return {string}
|
|
41
|
+
*/
|
|
42
|
+
static calculateRating(score: number | null, scoreDisplayMode?: string | undefined): string;
|
|
43
|
+
/**
|
|
44
|
+
* @param {LH.ReportResult.Category} category
|
|
45
|
+
*/
|
|
46
|
+
static calculateCategoryFraction(category: LH.ReportResult.Category): {
|
|
47
|
+
numPassed: number;
|
|
48
|
+
numPassableAudits: number;
|
|
49
|
+
numInformative: number;
|
|
50
|
+
totalWeight: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* @param {string} categoryId
|
|
54
|
+
*/
|
|
55
|
+
static isPluginCategory(categoryId: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* @param {LH.Result.GatherMode} gatherMode
|
|
58
|
+
*/
|
|
59
|
+
static shouldDisplayAsFraction(gatherMode: LH.Result.GatherMode): boolean;
|
|
60
|
+
}
|
|
61
|
+
export namespace UIStrings {
|
|
62
|
+
const varianceDisclaimer: string;
|
|
63
|
+
const calculatorLink: string;
|
|
64
|
+
const showRelevantAudits: string;
|
|
65
|
+
const opportunityResourceColumnLabel: string;
|
|
66
|
+
const opportunitySavingsColumnLabel: string;
|
|
67
|
+
const errorMissingAuditInfo: string;
|
|
68
|
+
const errorLabel: string;
|
|
69
|
+
const warningHeader: string;
|
|
70
|
+
const warningAuditsGroupTitle: string;
|
|
71
|
+
const passedAuditsGroupTitle: string;
|
|
72
|
+
const notApplicableAuditsGroupTitle: string;
|
|
73
|
+
const manualAuditsGroupTitle: string;
|
|
74
|
+
const toplevelWarningsMessage: string;
|
|
75
|
+
const crcInitialNavigation: string;
|
|
76
|
+
const crcLongestDurationLabel: string;
|
|
77
|
+
const snippetExpandButtonLabel: string;
|
|
78
|
+
const snippetCollapseButtonLabel: string;
|
|
79
|
+
const lsPerformanceCategoryDescription: string;
|
|
80
|
+
const labDataTitle: string;
|
|
81
|
+
const thirdPartyResourcesLabel: string;
|
|
82
|
+
const viewTreemapLabel: string;
|
|
83
|
+
const viewTraceLabel: string;
|
|
84
|
+
const viewOriginalTraceLabel: string;
|
|
85
|
+
const dropdownPrintSummary: string;
|
|
86
|
+
const dropdownPrintExpanded: string;
|
|
87
|
+
const dropdownCopyJSON: string;
|
|
88
|
+
const dropdownSaveHTML: string;
|
|
89
|
+
const dropdownSaveJSON: string;
|
|
90
|
+
const dropdownViewer: string;
|
|
91
|
+
const dropdownSaveGist: string;
|
|
92
|
+
const dropdownDarkTheme: string;
|
|
93
|
+
const runtimeSettingsDevice: string;
|
|
94
|
+
const runtimeSettingsNetworkThrottling: string;
|
|
95
|
+
const runtimeSettingsCPUThrottling: string;
|
|
96
|
+
const runtimeSettingsUANetwork: string;
|
|
97
|
+
const runtimeSettingsBenchmark: string;
|
|
98
|
+
const runtimeSettingsAxeVersion: string;
|
|
99
|
+
const runtimeSettingsScreenEmulation: string;
|
|
100
|
+
const footerIssue: string;
|
|
101
|
+
const runtimeNoEmulation: string;
|
|
102
|
+
const runtimeMobileEmulation: string;
|
|
103
|
+
const runtimeDesktopEmulation: string;
|
|
104
|
+
const runtimeUnknown: string;
|
|
105
|
+
const runtimeSingleLoad: string;
|
|
106
|
+
const runtimeAnalysisWindow: string;
|
|
107
|
+
const runtimeSingleLoadTooltip: string;
|
|
108
|
+
const throttlingProvided: string;
|
|
109
|
+
const show: string;
|
|
110
|
+
const hide: string;
|
|
111
|
+
const expandView: string;
|
|
112
|
+
const collapseView: string;
|
|
113
|
+
const runtimeSlow4g: string;
|
|
114
|
+
const runtimeCustom: string;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=report-utils.d.ts.map
|