@bymaksym/loadline 0.1.0 → 1.1.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.
Files changed (115) hide show
  1. package/README.md +272 -45
  2. package/dist/cli/cli/args.js +97 -116
  3. package/dist/cli/cli/gates.js +80 -14
  4. package/dist/cli/cli/main.js +275 -31
  5. package/dist/cli/cli/memory.js +114 -0
  6. package/dist/cli/cli/read/declared.js +52 -0
  7. package/dist/cli/cli/read/locate.js +214 -0
  8. package/dist/cli/cli/{read-build.js → read/read-build.js} +156 -87
  9. package/dist/cli/cli/read/read-config.js +120 -0
  10. package/dist/cli/cli/render/html-report.js +111 -0
  11. package/dist/cli/cli/render/render-agent.js +114 -0
  12. package/dist/cli/cli/render/render-asked.js +104 -0
  13. package/dist/cli/cli/render/render-badge.js +140 -0
  14. package/dist/cli/cli/{render-json.js → render/render-json.js} +26 -10
  15. package/dist/cli/cli/{render-markdown.js → render/render-markdown.js} +6 -6
  16. package/dist/cli/cli/{render-pr.js → render/render-pr.js} +37 -15
  17. package/dist/cli/cli/{render-sarif.js → render/render-sarif.js} +11 -6
  18. package/dist/cli/cli/{render-text.js → render/render-text.js} +169 -127
  19. package/dist/cli/cli/render/terminal.js +55 -0
  20. package/dist/cli/cli/report.js +76 -29
  21. package/dist/cli/cli/self-check.js +19 -23
  22. package/dist/cli/cli/since-last.js +45 -0
  23. package/dist/cli/cli/text/text-errors.js +124 -0
  24. package/dist/cli/cli/text/text.js +343 -0
  25. package/dist/cli/cli/text/usage.js +240 -0
  26. package/dist/cli/src/app/core/analysis/analysis.js +68 -24
  27. package/dist/cli/src/app/core/analysis/{barrels.js → graph/barrels.js} +10 -3
  28. package/dist/cli/src/app/core/analysis/{blast.js → graph/blast.js} +56 -17
  29. package/dist/cli/src/app/core/analysis/{cycles.js → graph/cycles.js} +1 -1
  30. package/dist/cli/src/app/core/analysis/{importers.js → graph/importers.js} +1 -1
  31. package/dist/cli/src/app/core/analysis/{insights.js → graph/insights.js} +10 -4
  32. package/dist/cli/src/app/core/analysis/invariant.js +1 -1
  33. package/dist/cli/src/app/core/analysis/metafile.types.js +21 -7
  34. package/dist/cli/src/app/core/analysis/{delivery.js → screens/delivery.js} +1 -1
  35. package/dist/cli/src/app/core/analysis/{entries.js → screens/entries.js} +87 -11
  36. package/dist/cli/src/app/core/analysis/screens/marks.js +32 -0
  37. package/dist/cli/src/app/core/analysis/screens/route-files.js +116 -0
  38. package/dist/cli/src/app/core/analysis/{sourcemap.js → sourcemap/sourcemap.js} +106 -7
  39. package/dist/cli/src/app/core/analysis/{split-drift.js → sourcemap/split-drift.js} +13 -7
  40. package/dist/cli/src/app/core/analysis/tool.js +83 -0
  41. package/dist/cli/src/app/core/assets/assets.js +137 -16
  42. package/dist/cli/src/app/core/baseline/baseline.js +0 -0
  43. package/dist/cli/src/app/core/{intake → build-text}/index-html.js +234 -29
  44. package/dist/cli/src/app/core/build-text/route-table.js +178 -0
  45. package/dist/cli/src/app/core/build-text/tool-marks.js +54 -0
  46. package/dist/cli/src/app/core/caching/caching.js +123 -45
  47. package/dist/cli/src/app/core/caching/from-analysis.js +20 -4
  48. package/dist/cli/src/app/core/config/config-text.js +90 -0
  49. package/dist/cli/src/app/core/config/config-values.js +358 -0
  50. package/dist/cli/src/app/core/config/loadline-config.js +81 -16
  51. package/dist/cli/src/app/core/config/merge-config.js +98 -0
  52. package/dist/cli/src/app/core/deps/deps.js +141 -23
  53. package/dist/cli/src/app/core/deps/pins.js +63 -0
  54. package/dist/cli/src/app/core/export/summary.js +54 -12
  55. package/dist/cli/src/app/core/findings/actions.js +65 -6
  56. package/dist/cli/src/app/core/findings/bundle/boot-single.js +76 -0
  57. package/dist/cli/src/app/core/findings/bundle/dupes.js +68 -0
  58. package/dist/cli/src/app/core/findings/{graph.js → bundle/graph.js} +32 -20
  59. package/dist/cli/src/app/core/findings/{own-in-boot.js → bundle/own-in-boot.js} +9 -5
  60. package/dist/cli/src/app/core/findings/{requests.js → bundle/requests.js} +3 -3
  61. package/dist/cli/src/app/core/findings/{shipped.js → bundle/shipped.js} +30 -18
  62. package/dist/cli/src/app/core/findings/compose.js +6 -1
  63. package/dist/cli/src/app/core/findings/effort.js +4 -0
  64. package/dist/cli/src/app/core/findings/finding.types.js +2 -0
  65. package/dist/cli/src/app/core/findings/findings.js +68 -55
  66. package/dist/cli/src/app/core/findings/{assets.js → folder/assets.js} +65 -16
  67. package/dist/cli/src/app/core/findings/{caching.js → folder/caching.js} +17 -10
  68. package/dist/cli/src/app/core/findings/{page.js → folder/page.js} +6 -2
  69. package/dist/cli/src/app/core/findings/{scan.js → folder/scan.js} +37 -13
  70. package/dist/cli/src/app/core/findings/kind-names.js +163 -0
  71. package/dist/cli/src/app/core/findings/{deps.js → supplied/deps.js} +13 -8
  72. package/dist/cli/src/app/core/findings/supplied/forbidden.js +71 -0
  73. package/dist/cli/src/app/core/findings/{situation.js → supplied/situation.js} +2 -2
  74. package/dist/cli/src/app/core/findings/text/causes.js +39 -0
  75. package/dist/cli/src/app/core/findings/text/finding-html.js +33 -0
  76. package/dist/cli/src/app/core/findings/{finding-text.js → text/finding-text.js} +307 -103
  77. package/dist/cli/src/app/core/findings/text/tool-advice.js +97 -0
  78. package/dist/cli/src/app/core/format/format.utils.js +172 -18
  79. package/dist/cli/src/app/core/format/ownership.js +93 -0
  80. package/dist/cli/src/app/core/i18n/en.js +180 -61
  81. package/dist/cli/src/app/core/i18n/es.js +192 -68
  82. package/dist/cli/src/app/core/intake/bundle-graph.js +285 -46
  83. package/dist/cli/src/app/core/intake/dist-files.js +87 -16
  84. package/dist/cli/src/app/core/intake/embedded.js +56 -0
  85. package/dist/cli/src/app/core/intake/unreached.js +139 -0
  86. package/dist/cli/src/app/core/intake/webpack-modules.js +185 -0
  87. package/dist/cli/src/app/core/intake/webpack-stats.js +298 -0
  88. package/dist/cli/src/app/core/project/budget-advice.js +14 -10
  89. package/dist/cli/src/app/core/project/project-context.js +89 -19
  90. package/dist/cli/src/app/core/project/project-name.js +36 -0
  91. package/dist/cli/src/app/core/scan/scan.js +116 -39
  92. package/dist/cli/src/app/core/scan/secrets.js +0 -0
  93. package/dist/cli/src/app/core/situation/situation-text.js +23 -0
  94. package/dist/cli/src/app/core/situation/situation.js +9 -8
  95. package/dist/cli/src/app/core/timing/timing.js +5 -2
  96. package/dist/cli/src/app/core/whatif/defer.js +29 -4
  97. package/dist/cli/src/app/core/whatif/source-importers.js +58 -0
  98. package/dist/cli/src/app/core/whatif/why.js +102 -0
  99. package/dist/cli/src/app/state/report-messages.utils.js +1 -4
  100. package/docs/CONFIG-REFERENCE.md +230 -0
  101. package/docs/CONFIG.md +511 -0
  102. package/docs/HOW-IT-WORKS.md +286 -25
  103. package/loadline.html +26 -24
  104. package/loadline.schema.json +1209 -0
  105. package/package.json +71 -35
  106. package/dist/cli/cli/text.js +0 -180
  107. package/dist/cli/src/app/core/findings/finding-html.js +0 -13
  108. /package/dist/cli/cli/{read-build.types.js → read/read-build.types.js} +0 -0
  109. /package/dist/cli/cli/{render-json.types.js → render/render-json.types.js} +0 -0
  110. /package/dist/cli/cli/{text.types.js → text/text.types.js} +0 -0
  111. /package/dist/cli/src/app/core/analysis/{exclusive.js → graph/exclusive.js} +0 -0
  112. /package/dist/cli/src/app/core/analysis/{insights.types.js → graph/insights.types.js} +0 -0
  113. /package/dist/cli/src/app/core/analysis/{module-graph.js → graph/module-graph.js} +0 -0
  114. /package/dist/cli/src/app/core/analysis/{sourcemap.types.js → sourcemap/sourcemap.types.js} +0 -0
  115. /package/dist/cli/src/app/core/findings/{finding-plain.js → text/finding-plain.js} +0 -0
@@ -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',
@@ -47,7 +49,7 @@ exports.EN = {
47
49
  compareVersionsHelp: 'Read from the installed path, which only pnpm writes the version into. With npm or yarn the column is empty because nothing could be read — which is not the same as the versions agreeing.',
48
50
  compareVersionUnknown: 'not readable',
49
51
  compareVersionsNote: 'No installed path carried a version, so the versions could not be read at all. That is a gap in what these files say, not a finding that everything agrees: pnpm writes the version into the path, npm and yarn do not.',
50
- compareRejected: files => `Not a build: ${files.join(', ')}. Each file has to be a stats.json (an esbuild metafile).`,
52
+ compareRejected: files => `Not a build: ${files.join(', ')}. Each file has to be a stats.json (an esbuild metafile or webpack's stats).`,
51
53
  secCriteria: 'Rating criteria',
52
54
  secCriteriaSub: 'The thresholds behind “good”, “fair” and “bad”, and the ones that fire each signal. You can change them.',
53
55
  howToCriteria: '<p>Every rated figure in the report is compared against two thresholds: up to the first it is <strong>good</strong>, up to the second <strong>fair</strong>, above that <strong>bad</strong>. The criteria in the second and third sections are the ones that fire the signals.</p><p><strong>Where the recommended values come from.</strong> With compressed figures, 170 kB of initial JavaScript is the usual budget for a page to become responsive within a few seconds on a mid-range phone; 350 kB is twice that. With raw figures, 500 kB and 1 MB are the values Angular CLI writes by default into <code>angular.json</code>. Per-screen and own-code values are multiples of those. Signal thresholds that are proportions — coverage, number of importers — do not depend on the unit. The ones that are sizes do: a 50 kB minimum applied to compressed figures is three times stricter than the same minimum in raw, so they scale down with everything else.</p><p>Whatever you change is stored in this browser, separately for raw and compressed, and applies immediately to ratings and signals. A value equal to the recommended one stops counting as custom.</p>',
@@ -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
- if (mode === 'gzip') {
59
- return 'You are editing the criteria for gzip-compressed figures (a build folder is loaded).';
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: 'Nothing kept yet. “Keep this one” adds the measurement on screen.',
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 => `Acting on all ${count} would take`,
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 · one of the two',
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: 'package.json + angular.json → name, 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` : `${total}`,
234
- paletteKeysHint: '? for the shortcuts',
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,16 +270,17 @@ 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: '1 · Drop your stats.json here',
243
- 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.',
273
+ drop1Title: 'Drop your build folder or its stats.json here',
274
+ drop1Body: 'The build folder is enough for anything that emits ES modules — Vite, Rollup, SvelteKit, Nuxt, Astro, esbuild — because its chunks carry the import graph. Angular writes a <code>stats.json</code> with <code>ng build --stats-json</code>, esbuild a <code>metafile</code> and webpack its stats with <code>--json</code> — Angular 16 or earlier, Create React App, Vue CLI — and any of them is more exact than the folder alone. It is processed in your browser: nothing leaves your machine.',
244
275
  drop1Btn: 'Choose stats.json',
276
+ drop1FolderBtn: 'Choose build folder',
245
277
  sampleBtn: 'See an example',
246
278
  sampleLoaded: outputs => `Example build · ${outputs} outputs · not your project`,
247
279
  sampleRemove: 'Close the example',
248
280
  diagnosticsBtn: 'Copy diagnostics',
249
281
  diagnosticsCopied: 'Copied',
250
282
  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: '2 · Optional: the build folder',
283
+ drop2Title: 'The build folder',
252
284
  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
285
  drop2Btn: 'Choose folder',
254
286
  statsRemove: 'Remove stats.json',
@@ -257,7 +289,7 @@ exports.EN = {
257
289
  statsIdle: 'Nothing loaded',
258
290
  distIdle: 'Nothing loaded · raw figures',
259
291
  statsLoaded: (name, outputs) => `${name} · ${outputs} outputs`,
260
- statsFromFolder: (name, outputs) => `${name} · ${outputs} chunks · graph read from the folder`,
292
+ statsFromFolder: (name, outputs, opaque) => `${name} · ${outputs} chunks · graph read from the folder${opaque ? ' · no source maps: what is inside each chunk, and so any saving, cannot be measured' : ''}`,
261
293
  statsError: message => `Could not read it: ${message}`,
262
294
  distNoFiles: 'That folder has no build output in it',
263
295
  distNoApi: 'Your browser cannot compress here; keeping raw figures',
@@ -267,16 +299,37 @@ exports.EN = {
267
299
  distLoadedMaps: (files, maps) => `${files} files · compressed figures · ${maps} source maps read`,
268
300
  distLoadedBrotli: 'real brotli from the .br files',
269
301
  distLoadedIndex: 'index.html read',
302
+ distTextUnread: 'restored without the text of the chunks: drop the folder again to search it for secrets and leftovers',
270
303
  splitExact: 'split from the source maps',
271
304
  splitApprox: 'split from the metafile',
272
305
  serverIgnored: n => `${n === 1 ? '1 server output' : `${n} server outputs`} left out`,
273
- 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
- blocksNote: n => `${n === 1 ? '1 lazy block' : `${n} lazy blocks`} inside screens, which do not count as screens:`,
306
+ serverIgnoredHelp: 'Outputs of the build that are not in the browser folder: almost always the server bundle (server-side rendering), which nobody downloads and is usually the larger of the two, so only the browser side is analysed. It can also be a file renamed after it was built, like the es5 polyfills of Angular 8, which nobody downloads under that name.',
307
+ offPageIgnored: ({ legacy, serviceWorker, server, ignored }) => `${[
308
+ legacy > 0 && `${legacy === 1 ? '1 file' : `${legacy} files`} for browsers without ES modules`,
309
+ serviceWorker > 0 && (serviceWorker === 1 ? 'the service worker' : `${serviceWorker} service worker files`),
310
+ server > 0 && `${server === 1 ? '1 file' : `${server} files`} only the server runs`,
311
+ ignored > 0 && `${ignored === 1 ? '1 file' : `${ignored} files`} loadline.json ignores`,
312
+ ]
313
+ .filter(Boolean)
314
+ .join(' and ')} left out`,
315
+ offPageIgnoredHelp: 'Only a browser that cannot run ES modules downloads the nomodule copy, a service worker runs beside the page rather than as part of a screen, the files of FastBoot run on the server, and build.ignore in loadline.json names what the team says no screen downloads. None of them is in any figure here, so every figure is what a current browser downloads.',
316
+ notScreensLabel: 'Not counted as screens:',
317
+ notScreenKind: {
318
+ block: 'lazy block inside a screen',
319
+ grouper: 'route group',
320
+ data: 'data',
321
+ package: 'package on demand',
322
+ worker: 'web worker',
323
+ onDemand: 'no route opens it',
324
+ },
275
325
  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
326
  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
327
  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.',
328
+ packagesHelp: "A package with an import() of its own: a diagram renderer, a formula typesetter. Nobody navigates to it, and when it is asked for is what the graph cannot say, so it is in no screen's total.",
329
+ workersHelp: 'Code started with new Worker(): it runs off the page, in a chunk of its own, when the page starts it. Not a screen and not in any total.',
330
+ onDemandHelp: 'The code carries a route table, and no route of it imports this chunk: it is a component, a tab or a language file loaded inside a page, not a place somebody navigates to. If it is a route all the same, count it as a screen.',
331
+ noRouteTable: 'No route table was found in the code, so every chunk loaded lazily counts as a screen: some of these may be tabs or components inside a page rather than places somebody navigates to.',
332
+ routeCss: (count, list) => `Screens also load ${count === 1 ? 'a stylesheet' : `${count} stylesheets`} of their own (${list}), not in their totals: the figures here are JavaScript.`,
280
333
  markScreen: 'Count as a screen',
281
334
  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.',
282
335
  markBlock: 'Not a screen',
@@ -286,22 +339,15 @@ exports.EN = {
286
339
  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
340
  intakeCompressed: unit => `${unit} figures`,
288
341
  intakeRaw: 'raw figures (bytes on disk)',
289
- intakeAddDist: 'Add the browser/ folder for compressed figures',
290
342
  rereadBtn: 'Read the folder again',
291
343
  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
- intakeChangeStats: 'Change stats.json',
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',
298
- 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.',
344
+ drop3Title: 'The previous measurement',
345
+ 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> or without one, the way the build on screen is read — to compare compressed figures. Every screen shows how much it changed, and a signal fires if something grew or entered the bootstrap.',
299
346
  drop3Btn: 'Choose baseline',
300
347
  drop3BtnDist: 'Choose previous folder',
301
- baselineNoStats: 'The folder has no stats.json in it.',
302
348
  baselineWorking: 'Compressing the previous folder…',
303
- drop4Title: '4 · Optional: the project context',
304
- 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.',
349
+ drop4Title: 'The project context',
350
+ drop4Body: '<code>package.json</code> names the project and says what it asks for directly, which tells a package you chose from one that came along. On an Angular project, <code>angular.json</code> and the pipeline file (<code>.gitlab-ci.yml</code> or the GitHub workflow) also say where the size budget is and whether the configuration the pipeline builds applies it.',
305
351
  drop4Btn: 'Choose files',
306
352
  baselineIdle: 'Nothing loaded · no comparison',
307
353
  baselineLoaded: (name, mode, screens) => `${name} · ${mode} · ${screens} screens`,
@@ -313,6 +359,8 @@ exports.EN = {
313
359
  contextLoaded: files => files.join(' · '),
314
360
  contextIgnored: files => `Not recognised: ${files.join(', ')}`,
315
361
  contextShort: n => (n === 1 ? 'context: 1 file' : `context: ${n} files`),
362
+ configExtends: names => `loadline.json extends ${names}, which the page cannot read`,
363
+ configExtendsHelp: 'The page has no disk to follow "extends" on, so it applies only what this file says itself. Run npx @bymaksym/loadline --print-config and drop what it prints here instead: that is the file with everything it extends joined in.',
316
364
  contextRemove: 'Remove context',
317
365
  restorePrompt: (name, date) => `This browser kept the last measurement: ${name} · ${date}`,
318
366
  restoreBtn: 'Restore',
@@ -333,7 +381,9 @@ exports.EN = {
333
381
  secProject: 'Project context',
334
382
  secProjectSub: 'Where the size budgets are, what the pipeline builds and whether the budget applies.',
335
383
  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
- projectEmpty: 'Drop angular.json, package.json and the pipeline file in the drop zone to see where the budgets are and whether they apply.',
384
+ projectState: 'unknown · no project files loaded',
385
+ projectEmptyTitle: 'Where your size budgets are, and whether they apply',
386
+ projectEmpty: 'Add angular.json, package.json and the pipeline file. Loadline checks which configuration the pipeline builds and whether its budget covers it.',
337
387
  projectEmptyBtn: 'Choose project files',
338
388
  projectBudgets: project => `Bootstrap budgets by configuration · project ${project}`,
339
389
  projectPick: 'Application',
@@ -368,8 +418,6 @@ exports.EN = {
368
418
  projectBootRaw: size => `Current raw bootstrap (JavaScript only): ${size}`,
369
419
  headLeadGzip: 'Before anything appears, people download (gzip)',
370
420
  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
421
  unitGzip: 'gzip-compressed',
374
422
  unitRaw: 'raw',
375
423
  unitBrotli: 'brotli-compressed',
@@ -394,15 +442,13 @@ exports.EN = {
394
442
  '<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
443
  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
444
  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
445
  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
446
  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
447
  tileBoot: 'Declared bootstrap',
401
448
  tileBootCss: (size, files, total) => `+ ${size} of CSS the page asks for${files > 1 ? ` in ${files} sheets` : ''} · ${total} before the first paint`,
402
- tileBootSub: files => `what the bundler marks as initial · ${files} files`,
403
- tileEffective: 'Effective bootstrap',
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',
449
+ 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.`,
450
+ bootSplitUnknown: 'How much of it is packages and how much is your code is not known: the folder carries no source maps, so a chunk is a weight with nothing named inside. Build with source maps, or add the stats.json, to see the split.',
451
+ tileBootSub: files => `what the bundler marks as initial · ${files === 1 ? '1 file' : `${files} files`}`,
406
452
  tileScreens: 'Lazy screens',
407
453
  tileScreensTypical: 'the typical one costs',
408
454
  tileScreensTop: (label, size) => `· the most expensive is ${label} · ${size}`,
@@ -411,13 +457,14 @@ exports.EN = {
411
457
  tileSharedSub: (global, partial) => `${global} near-global · ${partial} partial`,
412
458
  tileSharedNone: 'no lazy chunk is shared by two screens',
413
459
  tileFindings: 'Signals',
414
- tileFindingsSub: (high, mid) => `${high} important · ${mid} to review`,
460
+ tileFindingsSub: (high, mid, context) => `${high} important · ${mid} to review · ${context} context`,
415
461
  tileFindingsNone: 'no signal in the split',
416
462
  tabFindings: 'Signals',
417
463
  tabScreens: 'Screens',
418
464
  tabBoot: 'Bootstrap',
419
465
  tabShared: 'Shared',
420
466
  tabTree: 'Tree',
467
+ tabMap: 'Map',
421
468
  howTo: 'How to read this tab',
422
469
  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
470
  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 +477,37 @@ exports.EN = {
430
477
  secScreensSub: 'Click a row to see what makes it up. The bars share a scale.',
431
478
  secTree: 'Inside the bundle',
432
479
  secTreeSub: 'Chunk, package and file. Filter by zone to see only what everybody pays for.',
480
+ 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>',
481
+ secMap: 'Bundle map',
482
+ secMapSub: 'Open a chunk and see at a glance what fills it.',
483
+ mapRoot: 'The whole build',
484
+ mapSearch: 'Light up a package, folder or file…',
485
+ mapMatches: hits => (hits === 1 ? '1 matches' : `${hits} match`),
486
+ mapUnattributed: 'unattributed (bundler code)',
487
+ mapRest: count => `${count} smaller ones`,
488
+ mapKind: {
489
+ chunk: 'chunk',
490
+ package: 'package',
491
+ folder: 'folder of yours',
492
+ file: 'file',
493
+ rest: 'group of small ones',
494
+ unattributed: 'unattributed',
495
+ build: 'every chunk',
496
+ },
497
+ mapAreaRoot: unit => `Area: what each chunk weighs, figures ${unit}.`,
498
+ mapAreaInside: 'Area: the share of the chunk each part takes, raw.',
499
+ mapShareOfParent: (percent, parent) => `${percent} of ${parent}`,
500
+ mapShareOfAll: percent => `${percent} of all the JavaScript`,
501
+ mapRawInside: raw => `${raw} raw inside the chunk`,
502
+ mapContents: 'What takes the most',
503
+ mapOpen: 'Go in',
504
+ mapUp: 'Up',
505
+ mapFindIt: 'Find where else it is',
506
+ mapHint: 'Enter goes in · Escape goes up',
507
+ mapLegendPackage: 'package',
508
+ mapLegendOwn: 'your code',
509
+ mapEmpty: 'Nothing to draw with this filter.',
510
+ mapPick: 'Hover a rectangle, or Tab through them, to see what it is.',
433
511
  secBoot: 'What is in the bootstrap',
434
512
  secBootSub: 'What downloads before anything appears, grouped by package and by your own folders.',
435
513
  secShared: 'Shared chunks',
@@ -445,17 +523,19 @@ exports.EN = {
445
523
  seeInMeasured: 'See the measurement',
446
524
  seeInSituation: 'See the answers',
447
525
  findingsRest: 'Context',
448
- findingsSee: 'Seen',
526
+ findingsSee: 'Mark as seen',
449
527
  findingsUnsee: 'Seen ✓',
450
528
  findingsSeenHelp: 'Tick it off: it drops to the end of the list and stops asking for attention.',
451
529
  findingsSeenCount: n => (n === 1 ? '1 ticked off' : `${n} ticked off`),
452
530
  findingsSeenReset: 'None ticked off',
453
531
  findingsNoneHere: 'No signals of this kind.',
532
+ findingsColSignal: 'Signal · in the order worth fixing',
533
+ findingsColOff: 'Off load',
534
+ findingsColFix: 'Fix',
454
535
  fixLabel: 'What to do',
455
536
  legBoot: 'Bootstrap · always downloaded',
456
- legShared: 'Shared · several screens pay for it',
457
537
  legOwn: 'This screen only',
458
- screensCaveat: 'These figures are <strong>computed</strong> by walking the import graph, not measured.',
538
+ screensCaveat: 'Computed by walking the import graph, not measured.',
459
539
  filterBoot: 'Filter packages',
460
540
  filterShared: 'Filter chunks',
461
541
  filterScreens: 'Filter screens by name…',
@@ -505,10 +585,17 @@ exports.EN = {
505
585
  secMeasured: 'What the browser downloads',
506
586
  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
587
  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>",
588
+ measureState: 'not measured yet · every figure in the report is derived',
589
+ measureTitle: 'Measure what the browser actually downloads',
508
590
  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, paste this into the browser console:',
510
- measureStep3: 'Paste what it gives you back here.',
511
- measureCopy: 'Copy',
591
+ measureStep2: 'With the screen loaded, run the snippet in the browser console.',
592
+ measureStep3: 'Paste what it gives you back below.',
593
+ measureCopy: 'Copy console snippet',
594
+ measureShowCode: 'Show the code',
595
+ measureHideCode: 'Hide the code',
596
+ measureGain: 'What you get',
597
+ measureGainCompare: 'The only measured figure in the report, set beside the computed one, with every chunk where the two disagree.',
598
+ measureGainServed: 'What is served rather than what was built: protocol, round trip, compression and what the cache did — from one machine, once.',
512
599
  measureCopied: 'Copied',
513
600
  measurePlaceholder: 'Paste the result here. A list of file names copied from the network tab works too.',
514
601
  measureRun: 'Contrast',
@@ -640,6 +727,7 @@ exports.EN = {
640
727
  },
641
728
  sitRawUnit: { screensPerSession: 'screens', deploysPerWeek: 'per week', returningPct: '%' },
642
729
  sitRawEmpty: '—',
730
+ sitRawOr: 'or exactly',
643
731
  sitOpen: 'unanswered',
644
732
  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
733
  sitLatencyGo: 'Edit the latency',
@@ -650,9 +738,11 @@ exports.EN = {
650
738
  sitWho: 'Answered by',
651
739
  sitWhoPlaceholder: 'a name or a handle',
652
740
  sitWhen: 'Date',
741
+ sitWhenPlaceholder: 'yyyy-mm-dd',
742
+ sitWhenInvalid: 'That is not a day of the calendar: write it as yyyy-mm-dd. The date kept is the previous one.',
653
743
  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
744
  sitNoDate: 'Without a date there is no way to know when they stopped being true.',
655
- sitAnswered: (answered, total) => (answered === 0 ? 'Unanswered' : `${answered} of ${total} questions answered`),
745
+ sitAnswered: (answered, total) => `${answered} of ${total} answered`,
656
746
  sitReset: 'Clear the answers',
657
747
  sitExport: 'Download loadline.json',
658
748
  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 +802,8 @@ exports.EN = {
712
802
  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
803
  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
804
  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. Minimum coverage to count: ${(0, ui_strings_1.pct)(ratio)}.`,
716
- sharedSumNone: ratio => `No shared chunk reaches ${(0, ui_strings_1.pct)(ratio)} coverage: what is lazy only downloads when it is needed.`,
805
+ 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>.`,
806
+ 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
807
  bootPackages: 'npm packages',
718
808
  bootOwnCode: 'Your code',
719
809
  entriesCount: n => `${n} entries`,
@@ -730,6 +820,7 @@ exports.EN = {
730
820
  helpBootPercent: 'The share of the bootstrap this entry takes.',
731
821
  helpBootOfBoot: 'of the bootstrap',
732
822
  helpBootLazyOnly: max => `At most ${max} files of yours import it and at least one is in a lazy screen, so they can be checked one by one. If they all turn out to be lazy, this package downloads on the first load for people who may never reach that screen.`,
823
+ helpImportsUnknown: 'Not known: a build folder says what each chunk carries, not which file imports which. The stats.json says it.',
733
824
  helpImportersNone: 'No file of yours imports it directly: another package imports it. It is not removed from your code but from the package that brings it.',
734
825
  bootChain: 'How it enters the bootstrap',
735
826
  bootChainNone: 'Could not be followed from the entry point over static imports.',
@@ -753,9 +844,7 @@ exports.EN = {
753
844
  : `${share} % of what one screen loads`,
754
845
  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
846
  shapeSplit: eager => `${eager} % of it downloads on every load; the rest only when something asks for it.`,
756
- shapeBoot: 'Everybody pays for it',
757
- shapeShared: 'Several screens pay for it',
758
- shapeOwn: 'One screen pays for it',
847
+ shapeZone: { boot: 'Eager · everybody pays', shared: 'Lazy, several screens', own: 'Lazy, one screen' },
759
848
  shapeNote: n => {
760
849
  const of = { boot: 'of the bootstrap', shared: 'of what is shared', own: 'of what one screen loads' }[n.zone];
761
850
  // The second half does not repeat the zone when the first one has already named it.
@@ -780,7 +869,7 @@ exports.EN = {
780
869
  searchFound: (shown, total) => (shown === total ? `${total} matches` : `${shown} of ${total} matches`),
781
870
  searchKindPackage: 'package',
782
871
  searchKindFile: 'project file',
783
- searchInBoot: 'in the bootstrap · every load of the app pays for it',
872
+ searchInBoot: 'every load of the app pays for it',
784
873
  searchPartlyBoot: size => `${size} of it is in the bootstrap, and that every load pays for`,
785
874
  searchScreensCount: n => (n === 1 ? 'loaded by 1 screen' : `loaded by ${n} screens`),
786
875
  searchMatchedIn: n => (n === 1 ? 'matches in 1 file' : `matches in ${n} files`),
@@ -802,18 +891,48 @@ exports.EN = {
802
891
  dupNobody: 'nothing of yours directly',
803
892
  noScreens: 'No lazy screens found. The whole app is in the bootstrap.',
804
893
  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
894
  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.',
895
+ // --- three views drawn from figures the report already has ---
896
+ diffTitle: 'What changed in the bootstrap',
897
+ diffSub: (before, after, diff, baseline) => `${before} → ${after} (${diff}) against ${baseline}. Each area is what the part weighs now; its colour, how it moved.`,
898
+ diffChange: { new: 'new', grew: 'grew', shrank: 'shrank', same: 'unchanged', gone: 'gone' },
899
+ diffOwn: 'your code',
900
+ diffGone: 'No longer in the bootstrap',
901
+ diffEstimated: 'The changes are raw weights at the ratio the bootstrap compresses by: the right size, not the exact one, hence the ≈.',
902
+ diffPackagesOnly: 'Packages only: the baseline was exported before the folders of your own code were recorded, so they are drawn without a change.',
903
+ diffTile: (name, size, change) => `${name}, ${size}, ${change}`,
904
+ gridTitle: 'Screens × packages',
905
+ gridSub: 'What each screen downloads from each package. A column full from top to bottom is something every screen pays for, whether or not it uses it.',
906
+ gridBoot: 'In the bootstrap',
907
+ gridLazy: 'Loaded with the screen',
908
+ gridOwn: 'your code',
909
+ gridRest: 'the rest',
910
+ gridTotal: 'Screen total',
911
+ gridCell: (screen, size, what) => `${screen} carries ${size} of ${what}, raw, inside its chunks`,
912
+ gridScale: { less: 'less', more: 'more' },
913
+ gridRaw: 'Raw minified bytes inside the chunks; the total is in the report’s unit.',
914
+ tripsTitle: 'How it loads, trip by trip',
915
+ tripsNote: 'An estimate, not a measurement: the report’s round trips laid out on a time axis, with a standard connection profile. Each gap is a round trip spent waiting before the first byte.',
916
+ tripsProfile: { slow4g: 'slow 4G', fast4g: '4G', cable: 'cable' },
917
+ tripsBoot: 'first load',
918
+ tripsScreen: 'this screen',
919
+ tripLabel: index => `trip ${index}`,
920
+ tripsWait: 'waiting',
921
+ tripsParse: 'parse',
922
+ tripsTotal: (time, trips) => `≈ ${time} to have everything, in ${trips} ${trips === 1 ? 'trip' : 'trips'}`,
923
+ tripsAssumed: 'Without index.html the first load is drawn as one trip: the graph alone cannot tell which of its chunks the page names.',
924
+ tripBar: (index, wait, transfer, size, files) => `Trip ${index}: ${wait} waiting, ${transfer} transferring ${size} in ${files} ${files === 1 ? 'file' : 'files'}`,
809
925
  errNoEntries: 'This does not look like an esbuild metafile: no entry points found.',
810
926
  errNoMain: 'Could not identify the main entry point.',
811
927
  errNoOutputs: 'The JSON is shaped like a metafile but has no "outputs" key.',
812
928
  errNotMetafile: 'The JSON is not a metafile in any format this reads.',
813
- errExpected: 'What is expected is the stats.json `ng build --stats-json` writes (an object with "outputs" and "inputs"), or the whole browser/ folder, which Loadline reads on its own.',
814
- errNotEsmGraph: 'the chunks of this folder are webpack or Turbopack output, not ES modules: their imports are numbers resolved at run time by the loader, so there is no graph in the files to read. That is Next.js, Create React App and Angular 16 or earlier. Statoscope reads that format and does it better.',
815
- errNoPage: 'The folder has no index.html naming the script the application starts at, and without it there is no way to tell the entry chunk from a shared one: a bundler writes the shared code into the entry chunk, so the entry ends up imported by its own children. Add the page to the folder, or load the stats.json of the build.',
816
- errWebpackStats: 'this is not an esbuild metafile but a webpack stats.json. From Angular 17 on, the application builder writes one (`ng build --stats-json`); if the project is still on the browser builder, that is why. Loadline does not read the webpack format on purpose: Statoscope does that job better.',
817
- errViteManifest: 'this is not an esbuild metafile but a Vite manifest.json. It is not needed: drop the build folder itself and Loadline reads the graph out of the chunks, which is where Vite actually writes it.',
818
- errVisualizer: 'this is not an esbuild metafile but rollup-plugin-visualizer output. Loadline reads the esbuild metafile, which is a different thing.',
929
+ errExpected: 'What is expected is the build folder, the one holding the index.html — enough for anything that emits ES modules: Vite, Rollup, SvelteKit, Nuxt, Astro — or a stats file: the metafile Angular 17 or later writes with `ng build --stats-json` (an object with "outputs" and "inputs"), or the stats.json of webpack (`webpack --json`).',
930
+ errNotEsmGraph: "The chunks of this folder are webpack or Turbopack output, not ES modules: their imports are numbers resolved at run time by the loader, so there is no graph in the files to read. The build's stats file has it, and Loadline reads it: `ng build --stats-json` on Angular 16 or earlier, `webpack --json > stats.json`, `react-scripts build --stats` on Create React App, `vue-cli-service build --report-json` on Vue CLI. Put it in the folder, or drop it with the folder, and the figures stay compressed. Next.js with Turbopack writes no such file.",
931
+ entryLabel: 'The script the application starts at, with * for the hash:',
932
+ entryBtn: 'Read the folder with it',
933
+ errNoPage: 'No index.html in the folder names a script of the folder the application starts at — no <script src>, no import() and no file name in an inline script — and without it there is no way to tell the entry chunk from a shared one: a bundler writes the shared code into the entry chunk, so the entry ends up imported by its own children. Add the page to the folder, load the stats.json of the build, or name the script it starts at: --entry "main.*.js" in the command, the field under this message in the page, or { "build": { "entries": ["main.*.js"] } } in loadline.json.',
934
+ errFolderUnreadable: 'The browser would not let this page read the folder dropped on it. Chrome does that to a page opened from the disk (file://): the folder arrives, and listing what is inside it fails. Choose the same folder with "Choose build folder", which it does allow, or write the page with the build already in it: npx @bymaksym/loadline <folder> --html loadline.html --open.',
935
+ errWebpackStats: 'This is a webpack stats.json with no chunk in it that writes a script, so there is nothing to analyse: it was written with `chunks` or `assets` turned off. Write it again with the defaults — `webpack --json > stats.json`, `ng build --stats-json` — which carry chunks, modules and the reasons each module is in.',
936
+ errViteManifest: 'This is not an esbuild metafile but a Vite manifest.json. It is not needed: drop the build folder itself and Loadline reads the graph out of the chunks, which is where Vite actually writes it.',
937
+ errVisualizer: 'This is not an esbuild metafile but rollup-plugin-visualizer output. Loadline reads the esbuild metafile, which is a different thing.',
819
938
  };