@bymaksym/loadline 0.1.0 → 1.0.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/README.md +66 -7
- package/dist/cli/cli/args.js +33 -3
- package/dist/cli/cli/declared.js +52 -0
- package/dist/cli/cli/html-report.js +107 -0
- package/dist/cli/cli/locate.js +60 -0
- package/dist/cli/cli/main.js +118 -5
- package/dist/cli/cli/memory.js +78 -0
- package/dist/cli/cli/read-build.js +8 -4
- package/dist/cli/cli/render-json.js +8 -5
- package/dist/cli/cli/render-markdown.js +1 -1
- package/dist/cli/cli/render-pr.js +5 -3
- package/dist/cli/cli/render-sarif.js +3 -3
- package/dist/cli/cli/render-text.js +63 -28
- package/dist/cli/cli/report.js +9 -3
- package/dist/cli/cli/since-last.js +45 -0
- package/dist/cli/cli/text.js +54 -19
- package/dist/cli/src/app/core/analysis/analysis.js +8 -4
- package/dist/cli/src/app/core/analysis/barrels.js +9 -2
- package/dist/cli/src/app/core/analysis/entries.js +41 -6
- package/dist/cli/src/app/core/analysis/metafile.types.js +14 -6
- package/dist/cli/src/app/core/analysis/split-drift.js +12 -6
- package/dist/cli/src/app/core/assets/assets.js +4 -2
- package/dist/cli/src/app/core/caching/caching.js +3 -3
- package/dist/cli/src/app/core/deps/deps.js +37 -7
- package/dist/cli/src/app/core/deps/pins.js +63 -0
- package/dist/cli/src/app/core/export/summary.js +27 -9
- package/dist/cli/src/app/core/findings/actions.js +63 -6
- package/dist/cli/src/app/core/findings/assets.js +30 -5
- package/dist/cli/src/app/core/findings/boot-single.js +76 -0
- package/dist/cli/src/app/core/findings/caching.js +1 -1
- package/dist/cli/src/app/core/findings/dupes.js +65 -0
- package/dist/cli/src/app/core/findings/effort.js +2 -0
- package/dist/cli/src/app/core/findings/finding-html.js +14 -1
- package/dist/cli/src/app/core/findings/finding-text.js +104 -31
- package/dist/cli/src/app/core/findings/finding.types.js +1 -0
- package/dist/cli/src/app/core/findings/findings.js +22 -38
- package/dist/cli/src/app/core/findings/graph.js +4 -4
- package/dist/cli/src/app/core/findings/scan.js +13 -3
- package/dist/cli/src/app/core/findings/shipped.js +3 -5
- package/dist/cli/src/app/core/format/format.utils.js +16 -9
- package/dist/cli/src/app/core/i18n/en.js +108 -48
- package/dist/cli/src/app/core/i18n/es.js +114 -50
- package/dist/cli/src/app/core/intake/bundle-graph.js +6 -5
- package/dist/cli/src/app/core/intake/dist-files.js +5 -2
- package/dist/cli/src/app/core/intake/embedded.js +46 -0
- package/dist/cli/src/app/core/intake/index-html.js +66 -16
- package/dist/cli/src/app/core/project/budget-advice.js +14 -10
- package/dist/cli/src/app/core/project/project-context.js +74 -16
- package/dist/cli/src/app/core/scan/scan.js +59 -21
- package/dist/cli/src/app/core/scan/secrets.js +0 -0
- package/dist/cli/src/app/core/situation/situation.js +3 -4
- package/dist/cli/src/app/state/report-messages.utils.js +1 -4
- package/loadline.html +22 -24
- package/package.json +60 -30
|
@@ -24,6 +24,8 @@ exports.EN = {
|
|
|
24
24
|
compareAddCurrent: 'Add the build on screen',
|
|
25
25
|
compareClear: 'Clear',
|
|
26
26
|
compareRemove: 'Remove',
|
|
27
|
+
compareState: builds => builds === 0 ? 'no application yet · needs two' : `${builds} of 2 applications · needs one more`,
|
|
28
|
+
compareEmptyTitle: 'See what several applications ship twice',
|
|
27
29
|
compareEmpty: 'Nothing to compare yet. Add the stats.json of two or more applications.',
|
|
28
30
|
compareNeedsTwo: 'One application is not a comparison. Add at least one more.',
|
|
29
31
|
compareBuild: 'Application',
|
|
@@ -55,10 +57,9 @@ exports.EN = {
|
|
|
55
57
|
if (mode === 'brotli') {
|
|
56
58
|
return 'You are editing the criteria for brotli figures, the real ones from the .br files in the folder. They are lower than the gzip ones by the same margin brotli compresses better.';
|
|
57
59
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return 'You are editing the criteria for raw figures. With the build folder loaded a different set applies: the bootstrap, for instance, becomes 170 / 350 kB.';
|
|
60
|
+
return mode === 'gzip'
|
|
61
|
+
? 'You are editing the criteria for gzip-compressed figures (a build folder is loaded).'
|
|
62
|
+
: 'You are editing the criteria for raw figures. With the build folder loaded a different set applies: the bootstrap, for instance, becomes 170 / 350 kB.';
|
|
62
63
|
},
|
|
63
64
|
criteriaFigures: 'Figures',
|
|
64
65
|
criteriaGzipBtn: 'gzip',
|
|
@@ -76,6 +77,7 @@ exports.EN = {
|
|
|
76
77
|
critGroupContext: 'Baseline and project context',
|
|
77
78
|
critOkUpTo: 'good up to',
|
|
78
79
|
critBadAbove: 'bad above',
|
|
80
|
+
critColThreshold: 'Threshold · source',
|
|
79
81
|
blastTitle: 'If you change this file',
|
|
80
82
|
blastBody: (chunks, screens, everyone) => `${chunks === 1 ? '1 chunk is' : `${chunks} chunks are`} invalidated, and ${everyone ? 'every visitor who had the previous build' : `${screens} ${screens === 1 ? 'screen' : 'screens'}`} downloads again:`,
|
|
81
83
|
blastCascade: (chunks, screens, everyone, share) => `${chunks === 1 ? '1 more chunk carries' : `${chunks} more chunks carry`} the name of one of those inside, so ${chunks === 1 ? 'its hash' : 'their hashes'} move too${everyone
|
|
@@ -87,7 +89,7 @@ exports.EN = {
|
|
|
87
89
|
blastHub: (file, names) => `${file} carries the names of ${names} other chunks inside it, so anything that moves one of them moves this file too, and this file moving moves everything that imports it.`,
|
|
88
90
|
historyTitle: 'Measurements kept in this browser',
|
|
89
91
|
historyNote: 'One figure against one baseline compares two points and says nothing about the shape between them. 950 → 1.017 is information; 820, 790, 910, 1.200, 970 is a story, and it shows which week the problem walked in. It is kept in THIS browser only — no account, no server — so the way to share it is to export the file.',
|
|
90
|
-
historyEmpty: '
|
|
92
|
+
historyEmpty: 'nothing kept yet',
|
|
91
93
|
historyKeep: 'Keep this one',
|
|
92
94
|
historyExport: 'Export the history',
|
|
93
95
|
historyForget: 'Forget it all',
|
|
@@ -95,12 +97,16 @@ exports.EN = {
|
|
|
95
97
|
historyScreenPick: 'And one screen:',
|
|
96
98
|
historyScreenNone: 'none — the bootstrap only',
|
|
97
99
|
historyScreenAbsent: 'this screen was not in that build',
|
|
98
|
-
actionsTitle: 'What to fix first',
|
|
99
|
-
actionsNote: 'An order over the signals below, not a selection: every one of them is still there.',
|
|
100
100
|
effortLabel: { config: 'configuration', import: 'one import', refactor: 'refactor', none: '' },
|
|
101
|
-
actionsTotal: count =>
|
|
101
|
+
actionsTotal: count => {
|
|
102
|
+
if (count === 1) {
|
|
103
|
+
return 'Fixing it would take';
|
|
104
|
+
}
|
|
105
|
+
return count === 2 ? 'Fixing both would take' : `Fixing all ${count} would take`;
|
|
106
|
+
},
|
|
102
107
|
actionsTotalAfter: 'off the first load, leaving it at about',
|
|
103
108
|
actionsTotalNote: 'Raw minified bytes inside the chunk, and not added up: the graph is walked once with every file named above taken out together, so bytes reachable two ways are counted once.',
|
|
109
|
+
actionsTotalNoteEstimated: 'An estimate in compressed bytes: the raw bytes taken out, at the ratio the bootstrap compresses by, since a single module has no compressed size of its own. Not added up: the graph is walked once with every file named above taken out together, so bytes reachable two ways are counted once.',
|
|
104
110
|
thExclusive: 'Exclusive',
|
|
105
111
|
helpExclusive: 'What the first load would lose without this row: the part of its weight that has no other way in. It is the figure that says whether removing it is worth an afternoon — chart.js weighing 310 kB means 70 when 240 of those are d3, which three other things also pull in. Raw minified bytes inside the chunk.',
|
|
106
112
|
helpExclusiveOf: percent => percent >= 100
|
|
@@ -218,6 +224,31 @@ exports.EN = {
|
|
|
218
224
|
tagline: 'weight per screen',
|
|
219
225
|
lede: 'What someone opening each screen of your app downloads, how much of it everyone else pays too, and what is worth moving.',
|
|
220
226
|
themeBtn: 'Switch theme',
|
|
227
|
+
themeToDark: 'Dark',
|
|
228
|
+
themeToLight: 'Light',
|
|
229
|
+
searchBtn: 'Search',
|
|
230
|
+
searchKeys: 'Ctrl K',
|
|
231
|
+
homeAria: 'Loadline: change what is loaded',
|
|
232
|
+
buildChipHelp: 'Change what is loaded',
|
|
233
|
+
intakeRequired: 'required',
|
|
234
|
+
intakeOptional: 'Optional · each one adds detail, now or later',
|
|
235
|
+
intakeBack: 'Back to the report',
|
|
236
|
+
contextRawNote: 'Raw figures: bytes on disk, not what travels',
|
|
237
|
+
contextAddDetail: 'Add detail:',
|
|
238
|
+
contextAddDist: 'browser/ folder → compressed figures',
|
|
239
|
+
contextAddBaseline: 'baseline → compare',
|
|
240
|
+
contextAddContext: 'angular.json + pipeline → budgets',
|
|
241
|
+
heroCaptionBoot: boot => `${boot} the bundler marks as initial`,
|
|
242
|
+
heroCaptionExtra: (extra, chunks, ratio) => `${extra} in ${chunks === 1 ? 'one chunk' : `${chunks} chunks`} marked lazy that at least ${(0, ui_strings_1.pct)(ratio)} of the screens load anyway.`,
|
|
243
|
+
heroCaptionSame: 'No lazy chunk is loaded by enough screens to add to it.',
|
|
244
|
+
kpiWorst: 'worst',
|
|
245
|
+
provenanceTitle: 'Where these figures come from',
|
|
246
|
+
dataSourceShort: {
|
|
247
|
+
measured: 'a browser reported it',
|
|
248
|
+
derived: 'walked from the import graph',
|
|
249
|
+
declared: 'an answer you gave',
|
|
250
|
+
unknown: 'grey on purpose',
|
|
251
|
+
},
|
|
221
252
|
densityCompact: 'Compact',
|
|
222
253
|
densityComfortable: 'Comfortable',
|
|
223
254
|
densityHelp: 'Tighter rows, for reading long tables on a wide screen. It changes the spacing and nothing else: no column, no figure and no colour goes away.',
|
|
@@ -230,8 +261,8 @@ exports.EN = {
|
|
|
230
261
|
paletteNone: 'Nothing by that name.',
|
|
231
262
|
paletteTab: 'tab',
|
|
232
263
|
paletteAction: 'action',
|
|
233
|
-
paletteCount: (shown, total) => total > shown ? `${shown} of ${total} — the Search tab names every one of them` :
|
|
234
|
-
paletteKeysHint: '
|
|
264
|
+
paletteCount: (shown, total) => total > shown ? `${shown} of ${total} — the Search tab names every one of them` : String(total),
|
|
265
|
+
paletteKeysHint: '↵ open · esc close · ? shortcuts',
|
|
235
266
|
keysTitle: 'Keyboard',
|
|
236
267
|
keyJump: 'Jump to a tab, a screen or a package',
|
|
237
268
|
keySearch: 'The same thing, from anywhere that is not a field',
|
|
@@ -239,7 +270,7 @@ exports.EN = {
|
|
|
239
270
|
keyClose: 'Close this, and close an open explanation',
|
|
240
271
|
keyHelp: 'This list',
|
|
241
272
|
keyTabs: 'Between tabs, with a tab focused',
|
|
242
|
-
drop1Title: '
|
|
273
|
+
drop1Title: 'Drop your stats.json here',
|
|
243
274
|
drop1Body: 'Your bundler writes it with <code>ng build --stats-json</code> (Angular) or as an esbuild <code>metafile</code>. It is processed in your browser: nothing leaves your machine.',
|
|
244
275
|
drop1Btn: 'Choose stats.json',
|
|
245
276
|
sampleBtn: 'See an example',
|
|
@@ -248,7 +279,7 @@ exports.EN = {
|
|
|
248
279
|
diagnosticsBtn: 'Copy diagnostics',
|
|
249
280
|
diagnosticsCopied: 'Copied',
|
|
250
281
|
diagnosticsHint: 'About thirty lines describing the shape of this build and what Loadline decided about it. Package names are real; every path of your own code is replaced by a stable hash. Paste it into an issue.',
|
|
251
|
-
drop2Title: '
|
|
282
|
+
drop2Title: 'The build folder',
|
|
252
283
|
drop2Body: 'Add the <code>browser/</code> folder and every figure becomes <strong>compressed</strong>, which is what gets downloaded. Without it you get raw bytes. If the folder carries the <code>.js.map</code> files, they are also read to get what each file weighs inside each chunk, as a <strong>second measurement</strong> of what the metafile already says.',
|
|
253
284
|
drop2Btn: 'Choose folder',
|
|
254
285
|
statsRemove: 'Remove stats.json',
|
|
@@ -271,11 +302,10 @@ exports.EN = {
|
|
|
271
302
|
splitApprox: 'split from the metafile',
|
|
272
303
|
serverIgnored: n => `${n === 1 ? '1 server output' : `${n} server outputs`} left out`,
|
|
273
304
|
serverIgnoredHelp: 'The build also carries the server bundle (server-side rendering). Nobody downloads it and it is usually the larger of the two, so only the browser side is analysed.',
|
|
274
|
-
|
|
305
|
+
notScreensLabel: 'Not counted as screens:',
|
|
306
|
+
notScreenKind: { block: 'lazy block inside a screen', grouper: 'route group', data: 'data' },
|
|
275
307
|
blocksHelp: 'An Angular @defer, or a lazy() inside a component, produces a lazy chunk exactly like a route does. It is not a screen: nobody enters it, it loads when its trigger fires inside the screen holding it. Counting it as a screen would raise the screen count and lower the median with something nobody opens. What the graph cannot say is WHEN that trigger fires: a block behind a button really is bytes nobody pays for until they press it, while one imported as the screen mounts comes down with the first paint, and then the screen weighs more than its row says. Both look identical here. The Measured tab is what settles it.',
|
|
276
|
-
groupersNote: n => `${n === 1 ? '1 lazy entry that only groups routes' : `${n} lazy entries that only group routes`}, which do not count as screens either:`,
|
|
277
308
|
groupersHelp: 'A file that adds practically nothing of its own to its chunk and holds nothing but dynamic imports is grouping routes, whatever it is called. What it loads are the screens; it is not one of them. That is measured rather than read off the file name, so it also holds in a project that does not name its files the Angular way.',
|
|
278
|
-
dataNote: n => `${n === 1 ? '1 lazy entry that is data' : `${n} lazy entries that are data`}, not code anybody navigates to:`,
|
|
279
309
|
dataHelp: 'A language file, a table of countries, a dictionary: an import() of a .json produces a lazy chunk exactly like a route does. Nobody navigates to one, and an application that lazy-loads fifty languages would otherwise report fifty screens. What to do about these is not "is this a screen" but whether the data has to travel inside the bundle at all.',
|
|
280
310
|
markScreen: 'Count as a screen',
|
|
281
311
|
markScreenHelp: 'Puts this entry in the table as a screen of its own. Telling a screen from a piece of one is partly read off file names, and no set of names fits every project: this is the way out that does not need Loadline to learn yours.',
|
|
@@ -286,21 +316,15 @@ exports.EN = {
|
|
|
286
316
|
splitHelp: 'How much each file weighs inside a chunk. It normally comes from the metafile, and with esbuild that figure is already minified: checked against the source maps of a real build, the two agree within 1 %. If the folder brings the .js.map files, the figure from the maps is used instead — the same thing, measured on the generated file itself.',
|
|
287
317
|
intakeCompressed: unit => `${unit} figures`,
|
|
288
318
|
intakeRaw: 'raw figures (bytes on disk)',
|
|
289
|
-
intakeAddDist: 'Add the browser/ folder for compressed figures',
|
|
290
319
|
rereadBtn: 'Read the folder again',
|
|
291
320
|
rereadHelp: 'Reads the same build folder again, for after a rebuild. It is offered only where the browser can hold on to a folder, which is not from a file:// page and not in every browser; everywhere else, drop the folder again.',
|
|
292
|
-
|
|
293
|
-
intakeShow: 'Show drop zones',
|
|
294
|
-
intakeHide: 'Hide drop zones',
|
|
295
|
-
intakeAddBaseline: 'Add a baseline to compare',
|
|
296
|
-
intakeAddContext: 'Add angular.json and pipeline',
|
|
297
|
-
drop3Title: '3 · Optional: the previous measurement',
|
|
321
|
+
drop3Title: 'The previous measurement',
|
|
298
322
|
drop3Body: 'The <code>stats.json</code> of the previous build, an analysis exported from Loadline, or the whole previous <code>browser/</code> folder (with its <code>stats.json</code>) to compare compressed figures. Every screen shows how much it changed, and a signal fires if something grew or entered the bootstrap.',
|
|
299
323
|
drop3Btn: 'Choose baseline',
|
|
300
324
|
drop3BtnDist: 'Choose previous folder',
|
|
301
325
|
baselineNoStats: 'The folder has no stats.json in it.',
|
|
302
326
|
baselineWorking: 'Compressing the previous folder…',
|
|
303
|
-
drop4Title: '
|
|
327
|
+
drop4Title: 'The project context',
|
|
304
328
|
drop4Body: '<code>angular.json</code>, <code>package.json</code> and the pipeline file (<code>.gitlab-ci.yml</code> or the GitHub workflow). With them Loadline checks where the size budget is and whether the configuration the pipeline builds applies it.',
|
|
305
329
|
drop4Btn: 'Choose files',
|
|
306
330
|
baselineIdle: 'Nothing loaded · no comparison',
|
|
@@ -333,7 +357,9 @@ exports.EN = {
|
|
|
333
357
|
secProject: 'Project context',
|
|
334
358
|
secProjectSub: 'Where the size budgets are, what the pipeline builds and whether the budget applies.',
|
|
335
359
|
howToProject: '<p>Angular only checks the size budgets (<code>budgets</code>) of the configuration it builds with. If the budget is in <code>production</code> and the pipeline builds <code>preproduction</code>, the budget never applies. This tab crosses the two: the budgets of every configuration in <code>angular.json</code> and the build commands of the pipeline, following the scripts of <code>package.json</code> (<code>pnpm run build:pre</code> → <code>ng build --configuration=preproduction</code>).</p><p>The comparison with the bootstrap is raw and JavaScript only, which is what Angular measures. An error budget above twice the current bootstrap never fires.</p>',
|
|
336
|
-
|
|
360
|
+
projectState: 'unknown · no project files loaded',
|
|
361
|
+
projectEmptyTitle: 'Where your size budgets are, and whether they apply',
|
|
362
|
+
projectEmpty: 'Add angular.json, package.json and the pipeline file. Loadline checks which configuration the pipeline builds and whether its budget covers it.',
|
|
337
363
|
projectEmptyBtn: 'Choose project files',
|
|
338
364
|
projectBudgets: project => `Bootstrap budgets by configuration · project ${project}`,
|
|
339
365
|
projectPick: 'Application',
|
|
@@ -368,8 +394,6 @@ exports.EN = {
|
|
|
368
394
|
projectBootRaw: size => `Current raw bootstrap (JavaScript only): ${size}`,
|
|
369
395
|
headLeadGzip: 'Before anything appears, people download (gzip)',
|
|
370
396
|
headLeadRaw: 'Before anything appears, people download (uncompressed)',
|
|
371
|
-
headFigure: (size, files) => `${size} · ${files} files`,
|
|
372
|
-
headNote: (s, unit) => `The most expensive screen is <strong>${s.label}</strong>, at ${s.total} across ${s.files} files — ${s.shared} of that is shared with other screens and only ${s.own} is its own. Figures are ${unit}.`,
|
|
373
397
|
unitGzip: 'gzip-compressed',
|
|
374
398
|
unitRaw: 'raw',
|
|
375
399
|
unitBrotli: 'brotli-compressed',
|
|
@@ -394,15 +418,12 @@ exports.EN = {
|
|
|
394
418
|
'<p><strong>And check it.</strong> Save this build as the baseline, make the change and measure again. If it does not drop where you expected, the cause was another one, and knowing that helps too.</p>',
|
|
395
419
|
adviceBoot: 'It comes down by taking out of the bootstrap what only some screens use. The Bootstrap tab lists it by weight and marks in red the packages whose only consumer is in a lazy screen: start there.',
|
|
396
420
|
adviceEffective: 'The gap against the declared bootstrap is chunks the bundler marks as lazy and almost everybody downloads. It is not corrected in the bootstrap but in those chunks: the Shared tab.',
|
|
397
|
-
adviceScreens: 'It is bootstrap + shared + own. If the typical screen is expensive but its own code is small, what to look at is the bootstrap: bringing it down brings every screen down at once.',
|
|
398
421
|
adviceShared: 'A chunk almost every screen loads does not improve by splitting it alone. Taking out what a single screen uses pays off; what all of them use will download wherever it lives.',
|
|
399
422
|
adviceFindings: 'Each signal carries what to do and what not to do, with the actual files. The important ones are those affecting the bootstrap, that is, what always downloads; the ones to review are about one screen, or a size that may be justified.',
|
|
400
423
|
tileBoot: 'Declared bootstrap',
|
|
401
424
|
tileBootCss: (size, files, total) => `+ ${size} of CSS the page asks for${files > 1 ? ` in ${files} sheets` : ''} · ${total} before the first paint`,
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
tileEffectiveSub: (extra, chunks, ratio) => `+${extra} in ${chunks === 1 ? 'one chunk marked lazy' : `${chunks} chunks marked lazy`} loaded by at least ${(0, ui_strings_1.pct)(ratio)} of screens`,
|
|
405
|
-
tileEffectiveSame: 'same as declared: no lazy chunk is near-global',
|
|
425
|
+
bootSplitRaw: total => `Packages and your code are split in raw bytes, ${total} in all: a compressed file cannot be divided by what is inside it.`,
|
|
426
|
+
tileBootSub: files => `what the bundler marks as initial · ${files === 1 ? '1 file' : `${files} files`}`,
|
|
406
427
|
tileScreens: 'Lazy screens',
|
|
407
428
|
tileScreensTypical: 'the typical one costs',
|
|
408
429
|
tileScreensTop: (label, size) => `· the most expensive is ${label} · ${size}`,
|
|
@@ -411,13 +432,14 @@ exports.EN = {
|
|
|
411
432
|
tileSharedSub: (global, partial) => `${global} near-global · ${partial} partial`,
|
|
412
433
|
tileSharedNone: 'no lazy chunk is shared by two screens',
|
|
413
434
|
tileFindings: 'Signals',
|
|
414
|
-
tileFindingsSub: (high, mid) => `${high} important · ${mid} to review`,
|
|
435
|
+
tileFindingsSub: (high, mid, context) => `${high} important · ${mid} to review · ${context} context`,
|
|
415
436
|
tileFindingsNone: 'no signal in the split',
|
|
416
437
|
tabFindings: 'Signals',
|
|
417
438
|
tabScreens: 'Screens',
|
|
418
439
|
tabBoot: 'Bootstrap',
|
|
419
440
|
tabShared: 'Shared',
|
|
420
441
|
tabTree: 'Tree',
|
|
442
|
+
tabMap: 'Map',
|
|
421
443
|
howTo: 'How to read this tab',
|
|
422
444
|
howToFindings: '<p>Each signal is a concrete pattern found in <strong>your</strong> import graph, with its threshold and its fix. They are not generic performance rules.</p><p><strong>Important</strong> means weight everyone pays without needing to. <strong>To review</strong> flags something worth a look that may have a reason. The button on each signal leads to the report row it comes from.</p>',
|
|
423
445
|
howToScreens: '<p>Each row is a lazy screen, and the bar is what someone landing <strong>directly</strong> on it downloads: <strong>bootstrap</strong> (grey, identical everywhere), <strong>shared</strong> (orange: lazy chunks other screens also load) and <strong>own</strong> (green: this screen only). Bars share one scale, so if the orange segment is the same width on every row, the problem is in that common chunk, not in the screens.</p><p>These figures are <strong>computed</strong> by walking the import graph, not measured. They usually run a little low: entering at the root, the router may load an area’s chunks before a guard rejects it. For the definitive number, serve the build folder and watch the browser’s network tab.</p>',
|
|
@@ -430,6 +452,37 @@ exports.EN = {
|
|
|
430
452
|
secScreensSub: 'Click a row to see what makes it up. The bars share a scale.',
|
|
431
453
|
secTree: 'Inside the bundle',
|
|
432
454
|
secTreeSub: 'Chunk, package and file. Filter by zone to see only what everybody pays for.',
|
|
455
|
+
howToMap: '<p>Each rectangle is a chunk, and its <strong>area is what it weighs in the report’s unit</strong>: compressed when the folder was read. Inside each chunk you see what fills it, by package and by folder of yours. The colour says who pays for it: grey the bootstrap, orange what screens share, green what one screen loads alone. Striped is your own code; plain, packages.</p><p><strong>Inside a chunk the split is raw</strong>, because gzip compresses the file as a whole and the compressed weight of one package inside it does not exist. So the area inside is each part’s share of the chunk, not an invented compressed figure.</p><p>Click a rectangle to go into it and use the crumbs above to come back. With the keyboard: Tab walks the rectangles largest first, Enter goes in and Escape goes up a level. Whatever you type in the search lights up, inside the chunks that carry it too.</p>',
|
|
456
|
+
secMap: 'Bundle map',
|
|
457
|
+
secMapSub: 'Open a chunk and see at a glance what fills it.',
|
|
458
|
+
mapRoot: 'The whole build',
|
|
459
|
+
mapSearch: 'Light up a package, folder or file…',
|
|
460
|
+
mapMatches: hits => (hits === 1 ? '1 matches' : `${hits} match`),
|
|
461
|
+
mapUnattributed: 'unattributed (bundler code)',
|
|
462
|
+
mapRest: count => `${count} smaller ones`,
|
|
463
|
+
mapKind: {
|
|
464
|
+
chunk: 'chunk',
|
|
465
|
+
package: 'package',
|
|
466
|
+
folder: 'folder of yours',
|
|
467
|
+
file: 'file',
|
|
468
|
+
rest: 'group of small ones',
|
|
469
|
+
unattributed: 'unattributed',
|
|
470
|
+
build: 'every chunk',
|
|
471
|
+
},
|
|
472
|
+
mapAreaRoot: unit => `Area: what each chunk weighs, figures ${unit}.`,
|
|
473
|
+
mapAreaInside: 'Area: the share of the chunk each part takes, raw.',
|
|
474
|
+
mapShareOfParent: (percent, parent) => `${percent} of ${parent}`,
|
|
475
|
+
mapShareOfAll: percent => `${percent} of all the JavaScript`,
|
|
476
|
+
mapRawInside: raw => `${raw} raw inside the chunk`,
|
|
477
|
+
mapContents: 'What takes the most',
|
|
478
|
+
mapOpen: 'Go in',
|
|
479
|
+
mapUp: 'Up',
|
|
480
|
+
mapFindIt: 'Find where else it is',
|
|
481
|
+
mapHint: 'Enter goes in · Escape goes up',
|
|
482
|
+
mapLegendPackage: 'package',
|
|
483
|
+
mapLegendOwn: 'your code',
|
|
484
|
+
mapEmpty: 'Nothing to draw with this filter.',
|
|
485
|
+
mapPick: 'Hover a rectangle, or Tab through them, to see what it is.',
|
|
433
486
|
secBoot: 'What is in the bootstrap',
|
|
434
487
|
secBootSub: 'What downloads before anything appears, grouped by package and by your own folders.',
|
|
435
488
|
secShared: 'Shared chunks',
|
|
@@ -445,17 +498,19 @@ exports.EN = {
|
|
|
445
498
|
seeInMeasured: 'See the measurement',
|
|
446
499
|
seeInSituation: 'See the answers',
|
|
447
500
|
findingsRest: 'Context',
|
|
448
|
-
findingsSee: '
|
|
501
|
+
findingsSee: 'Mark as seen',
|
|
449
502
|
findingsUnsee: 'Seen ✓',
|
|
450
503
|
findingsSeenHelp: 'Tick it off: it drops to the end of the list and stops asking for attention.',
|
|
451
504
|
findingsSeenCount: n => (n === 1 ? '1 ticked off' : `${n} ticked off`),
|
|
452
505
|
findingsSeenReset: 'None ticked off',
|
|
453
506
|
findingsNoneHere: 'No signals of this kind.',
|
|
507
|
+
findingsColSignal: 'Signal · in the order worth fixing',
|
|
508
|
+
findingsColOff: 'Off load',
|
|
509
|
+
findingsColFix: 'Fix',
|
|
454
510
|
fixLabel: 'What to do',
|
|
455
511
|
legBoot: 'Bootstrap · always downloaded',
|
|
456
|
-
legShared: 'Shared · several screens pay for it',
|
|
457
512
|
legOwn: 'This screen only',
|
|
458
|
-
screensCaveat: '
|
|
513
|
+
screensCaveat: 'Computed by walking the import graph, not measured.',
|
|
459
514
|
filterBoot: 'Filter packages',
|
|
460
515
|
filterShared: 'Filter chunks',
|
|
461
516
|
filterScreens: 'Filter screens by name…',
|
|
@@ -505,10 +560,17 @@ exports.EN = {
|
|
|
505
560
|
secMeasured: 'What the browser downloads',
|
|
506
561
|
secMeasuredSub: 'The only figure in the tool that is measured rather than computed. Paste what your browser downloaded and Loadline says where the two differ.',
|
|
507
562
|
howToMeasured: "<p>The rest of the report <strong>computes</strong>: it walks the graph of static imports and adds up. This tab <strong>measures</strong>, and the two figures do not match.</p><p>Entering through the root, the router loads an area's chunk in order to match the route, and only afterwards does the guard check the session and redirect. That chunk is already downloaded, and the computation does not count it. That is why the computed figure falls short.</p><p>What gets compared here is <strong>which chunks came down</strong>, not how many bytes either side reported: the set of chunks does not depend on the unit, so a gzip report and a browser reporting transfer bytes still compare cleanly. The difference is then priced with Loadline's own figures.</p>",
|
|
563
|
+
measureState: 'not measured yet · every figure in the report is derived',
|
|
564
|
+
measureTitle: 'Measure what the browser actually downloads',
|
|
508
565
|
measureStep1: 'Serve the build you loaded and open the app the way people do: through the root, not straight into the route. Disable the cache in the network tab.',
|
|
509
|
-
measureStep2: 'With the screen loaded,
|
|
510
|
-
measureStep3: 'Paste what it gives you back
|
|
511
|
-
measureCopy: 'Copy',
|
|
566
|
+
measureStep2: 'With the screen loaded, run the snippet in the browser console.',
|
|
567
|
+
measureStep3: 'Paste what it gives you back below.',
|
|
568
|
+
measureCopy: 'Copy console snippet',
|
|
569
|
+
measureShowCode: 'Show the code',
|
|
570
|
+
measureHideCode: 'Hide the code',
|
|
571
|
+
measureGain: 'What you get',
|
|
572
|
+
measureGainCompare: 'The only measured figure in the report, set beside the computed one, with every chunk where the two disagree.',
|
|
573
|
+
measureGainServed: 'What is served rather than what was built: protocol, round trip, compression and what the cache did — from one machine, once.',
|
|
512
574
|
measureCopied: 'Copied',
|
|
513
575
|
measurePlaceholder: 'Paste the result here. A list of file names copied from the network tab works too.',
|
|
514
576
|
measureRun: 'Contrast',
|
|
@@ -640,6 +702,7 @@ exports.EN = {
|
|
|
640
702
|
},
|
|
641
703
|
sitRawUnit: { screensPerSession: 'screens', deploysPerWeek: 'per week', returningPct: '%' },
|
|
642
704
|
sitRawEmpty: '—',
|
|
705
|
+
sitRawOr: 'or exactly',
|
|
643
706
|
sitOpen: 'unanswered',
|
|
644
707
|
sitLatency: ms => `The report turns bytes into seconds with a ${ms} ms round trip. That is the figure that really answers this question, and it is edited in Criteria.`,
|
|
645
708
|
sitLatencyGo: 'Edit the latency',
|
|
@@ -650,9 +713,11 @@ exports.EN = {
|
|
|
650
713
|
sitWho: 'Answered by',
|
|
651
714
|
sitWhoPlaceholder: 'a name or a handle',
|
|
652
715
|
sitWhen: 'Date',
|
|
716
|
+
sitWhenPlaceholder: 'yyyy-mm-dd',
|
|
717
|
+
sitWhenInvalid: 'That is not a day of the calendar: write it as yyyy-mm-dd. The date kept is the previous one.',
|
|
653
718
|
sitStale: days => `These answers are more than ${days} days old. Deploy cadence is exactly what changes when a team moves to continuous delivery: go through them again before trusting the figure.`,
|
|
654
719
|
sitNoDate: 'Without a date there is no way to know when they stopped being true.',
|
|
655
|
-
sitAnswered: (answered, total) =>
|
|
720
|
+
sitAnswered: (answered, total) => `${answered} of ${total} answered`,
|
|
656
721
|
sitReset: 'Clear the answers',
|
|
657
722
|
sitExport: 'Download loadline.json',
|
|
658
723
|
sitExportHelp: 'The situation block as a file, to commit next to the code. The command reads it, so the terminal stops disagreeing with this page.',
|
|
@@ -712,8 +777,8 @@ exports.EN = {
|
|
|
712
777
|
worthCommon: 'No group reaches half the chunk, or the one that does is imported from a large part of the application: there is no single file to point at. The two ways out left are using less of that library or swapping it for a smaller one.',
|
|
713
778
|
worthNoSplit: 'Splitting it saves nothing: the bundler groups files by which screens reach them, so both halves would be loaded by exactly the same screens. The only things that bring this figure down are fewer screens importing it, or it weighing less.',
|
|
714
779
|
worthTriage: n => `Of the ${n.namedN + n.spreadN + n.smallN} shared chunks: ${n.namedN} with a named source (${n.namedCost} of a typical visit) · ${n.spreadN} with no dominant source (${n.spreadCost}) · ${n.smallN} below ${n.min}.`,
|
|
715
|
-
sharedSum: (size, chunks, ratio) => `${chunks === 1 ? 'The near-global chunk adds up to' : `The ${chunks} near-global chunks add up to`} <strong>${size}</strong>: whoever opens almost any screen downloads it along with the bootstrap.
|
|
716
|
-
sharedSumNone: ratio => `No shared chunk reaches
|
|
780
|
+
sharedSum: (size, chunks, ratio, wide) => `${chunks === 1 ? 'The near-global chunk adds up to' : `The ${chunks} near-global chunks add up to`} <strong>${size}</strong>: whoever opens almost any screen downloads it along with the bootstrap. It counts as bootstrap from <strong>${(0, ui_strings_1.pct)(ratio)}</strong> coverage; widely shared from <strong>${(0, ui_strings_1.pct)(wide)}</strong>.`,
|
|
781
|
+
sharedSumNone: (ratio, wide) => `No shared chunk reaches <strong>${(0, ui_strings_1.pct)(ratio)}</strong> coverage: what is lazy only downloads when it is needed. Widely shared from <strong>${(0, ui_strings_1.pct)(wide)}</strong>.`,
|
|
717
782
|
bootPackages: 'npm packages',
|
|
718
783
|
bootOwnCode: 'Your code',
|
|
719
784
|
entriesCount: n => `${n} entries`,
|
|
@@ -753,9 +818,7 @@ exports.EN = {
|
|
|
753
818
|
: `${share} % of what one screen loads`,
|
|
754
819
|
treeShareHelp: 'How much of its zone this one chunk holds. Marked from 25 %: that is where the weight is, and therefore what to look at before the rows below it.',
|
|
755
820
|
shapeSplit: eager => `${eager} % of it downloads on every load; the rest only when something asks for it.`,
|
|
756
|
-
|
|
757
|
-
shapeShared: 'Several screens pay for it',
|
|
758
|
-
shapeOwn: 'One screen pays for it',
|
|
821
|
+
shapeZone: { boot: 'Eager · everybody pays', shared: 'Lazy, several screens', own: 'Lazy, one screen' },
|
|
759
822
|
shapeNote: n => {
|
|
760
823
|
const of = { boot: 'of the bootstrap', shared: 'of what is shared', own: 'of what one screen loads' }[n.zone];
|
|
761
824
|
// The second half does not repeat the zone when the first one has already named it.
|
|
@@ -780,7 +843,7 @@ exports.EN = {
|
|
|
780
843
|
searchFound: (shown, total) => (shown === total ? `${total} matches` : `${shown} of ${total} matches`),
|
|
781
844
|
searchKindPackage: 'package',
|
|
782
845
|
searchKindFile: 'project file',
|
|
783
|
-
searchInBoot: '
|
|
846
|
+
searchInBoot: 'every load of the app pays for it',
|
|
784
847
|
searchPartlyBoot: size => `${size} of it is in the bootstrap, and that every load pays for`,
|
|
785
848
|
searchScreensCount: n => (n === 1 ? 'loaded by 1 screen' : `loaded by ${n} screens`),
|
|
786
849
|
searchMatchedIn: n => (n === 1 ? 'matches in 1 file' : `matches in ${n} files`),
|
|
@@ -802,9 +865,6 @@ exports.EN = {
|
|
|
802
865
|
dupNobody: 'nothing of yours directly',
|
|
803
866
|
noScreens: 'No lazy screens found. The whole app is in the bootstrap.',
|
|
804
867
|
noShared: 'No lazy chunk is shared by two screens.',
|
|
805
|
-
noExclusive: 'Nothing exclusive.',
|
|
806
|
-
noSharedRow: 'Nothing shared.',
|
|
807
|
-
footerSummary: 'Where do these figures come from?',
|
|
808
868
|
footer: 'Everything is computed in your browser from the metafile: nothing is uploaded anywhere. Raw figures are bytes on disk; compressed ones are gzipped from the real files, which is what your users actually pay. The browser cannot compress in brotli, so that figure only appears when the folder brings the pre-compressed .js.br files; without them, count on brotli being 15 % to 20 % below the gzip you see. Press ? for the keyboard shortcuts.',
|
|
809
869
|
errNoEntries: 'This does not look like an esbuild metafile: no entry points found.',
|
|
810
870
|
errNoMain: 'Could not identify the main entry point.',
|