sitespeed.io 30.4.0 → 30.5.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/CHANGELOG.md CHANGED
@@ -1,10 +1,20 @@
1
1
  # CHANGELOG - sitespeed.io (we use [semantic versioning](https://semver.org))
2
2
 
3
+ ## 30.5.0 - 2023-11-28
4
+ ### Added
5
+ * The new compare plugin can now run without an id. The id will then be generated from the URL. If you don't give it an id, yoiu can only compare pages with the exact same URL [#4013](https://github.com/sitespeedio/sitespeed.io/pull/4013).
6
+
7
+ ## 30.4.1 - 2023-11-28
8
+ ### Fixed
9
+ * Fix for Firefox when generating the result HTML. It was broken since we where missing CPU data.
10
+
3
11
  ## 30.4.0 - 2023-11-27
4
12
  ### Fixed
5
13
  * Upgrade to Browsretime 19.1.0 with a fix for Geckodriver so that the correct ARM version is installed on Mac Arm machines.
6
14
  ### Added
7
- * The new compare plugin makes it easy to use Mann Whitney U/Wilcox for support to find performance egressions. Read all about the plugin in the [documentation](https://www.sitespeed.io/documentation/sitespeed.io/compare/).
15
+ * The new compare plugin [PR 4009](https://github.com/sitespeedio/sitespeed.io/pull/4009) makes it easy to use Mann Whitney U/Wilcox for support to find performance egressions. Read all about the plugin in the [documentation](https://www.sitespeed.io/documentation/sitespeed.io/compare/).
16
+ * Firefox 120 in the Docker container [#4010](https://github.com/sitespeedio/sitespeed.io/pull/4010).
17
+ * Button to download the console logs, thank you [bairov pavel](https://github.com/Amerousful) for PR [#4007](https://github.com/sitespeedio/sitespeed.io/pull/4007).
8
18
 
9
19
  ## 30.3.0 - 2023-11-09
10
20
 
package/CONTRIBUTORS.md CHANGED
@@ -45,3 +45,4 @@ Many many many thanks to:
45
45
  * [Devrim Tufan](https://github.com/tufandevrim)
46
46
  * [Keith Cirkel](https://github.com/keithamus)
47
47
  * [Jonathan Lee](https://github.com/beenanner)
48
+ * [Pavel Bairov](https://github.com/Amerousful)
package/lib/cli/cli.js CHANGED
@@ -1874,7 +1874,7 @@ export async function parseCommandLine() {
1874
1874
  .option('compare.id', {
1875
1875
  type: 'string',
1876
1876
  describe:
1877
- 'The id of the test. Will be used to find the baseline test, that is using the id as a part of the name.',
1877
+ 'The id of the test. Will be used to find the baseline test, that is using the id as a part of the name. If you do not add an id, an id will be generated using the URL and that will only work if you baseline against the exact same URL.',
1878
1878
  group: 'compare'
1879
1879
  })
1880
1880
  .option('compare.baselinePath', {
@@ -7,7 +7,6 @@ import intel from 'intel';
7
7
  import merge from 'lodash.merge';
8
8
  import dayjs from 'dayjs';
9
9
 
10
- import { throwIfMissing } from '../../support/util.js';
11
10
  import { getStatistics, runStatisticalTests, getMetrics } from './helper.js';
12
11
  import { getBaseline, saveBaseline } from './baseline.js';
13
12
 
@@ -16,6 +15,14 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url));
16
15
  const log = intel.getLogger('sitespeedio.plugin.compare');
17
16
  const defaultConfig = {};
18
17
 
18
+ function urlToId(url) {
19
+ return url
20
+ .replace(/^https?:\/\//, '')
21
+ .replaceAll(/[^\d.A-Za-z]/g, '_')
22
+ .replaceAll(/__+/g, '_')
23
+ .replaceAll(/^_|_$/g, '');
24
+ }
25
+
19
26
  const TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
20
27
 
21
28
  const DEFAULT_METRICS_PAGESUMMARY = [
@@ -40,7 +47,6 @@ export default class ComparePlugin extends SitespeedioPlugin {
40
47
  this.make = context.messageMaker('compare').make;
41
48
  this.compareOptions = merge({}, defaultConfig, options.compare);
42
49
  this.options = options;
43
- throwIfMissing(options.compare, ['id'], 'compare');
44
50
  this.pug = readFileSync(resolve(__dirname, 'pug', 'index.pug'), 'utf8');
45
51
  log.info(
46
52
  'Starting the compare plugin.' +
@@ -73,10 +79,16 @@ export default class ComparePlugin extends SitespeedioPlugin {
73
79
  }
74
80
  case 'browsertime.pageSummary': {
75
81
  this.page++;
82
+ const id = this.options.compare.id || urlToId(message.data.info.url);
76
83
  const baseline = await getBaseline(
77
- this.options.compare.id + '-' + this.page,
84
+ id + '-' + this.page,
78
85
  this.compareOptions
79
86
  );
87
+ if (this.options.compare.id) {
88
+ log.info('Using id %s for page baseline', id);
89
+ } else {
90
+ log.info('Using auto generated id for the baseline: %s ', id);
91
+ }
80
92
 
81
93
  if (baseline) {
82
94
  if (
@@ -88,9 +100,7 @@ export default class ComparePlugin extends SitespeedioPlugin {
88
100
  baseline.timestamps.length,
89
101
  this.options.browsertime.iterations
90
102
  );
91
- log.info(
92
- 'Got a baseline:' + this.options.compare.id + '-' + this.page
93
- );
103
+ log.info('Got a baseline:' + id + '-' + this.page);
94
104
  const newMetrics = getMetrics(message.data);
95
105
  const baselineMetrics = getMetrics(baseline);
96
106
  const metricsInputData = {
@@ -196,7 +206,7 @@ export default class ComparePlugin extends SitespeedioPlugin {
196
206
  message.data,
197
207
  join(
198
208
  this.compareOptions.baselinePath || process.cwd(),
199
- `${this.options.compare.id}-${this.page}.json`
209
+ `${id}-${this.page}.json`
200
210
  )
201
211
  );
202
212
  }
@@ -216,7 +226,7 @@ export default class ComparePlugin extends SitespeedioPlugin {
216
226
  message.data,
217
227
  join(
218
228
  this.compareOptions.baselinePath || process.cwd(),
219
- `${this.options.compare.id}-${this.page}.json`
229
+ `${id}-${this.page}.json`
220
230
  )
221
231
  );
222
232
  }
@@ -178,7 +178,7 @@ if browsertime
178
178
  td
179
179
  a(href=baseHelpURL + 'firstInputDelay') First Input Delay (FID)
180
180
  td.number #{h.time.ms(timings.firstInput.delay)}
181
- else
181
+ else if (cpu && cpu.longTasks)
182
182
  tr
183
183
  td
184
184
  a(href=baseHelpURL + 'totalBlockingTime') Total Blocking Time (TBT)
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "sitespeed.io",
3
- "version": "30.4.0",
3
+ "version": "30.5.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "sitespeed.io",
9
- "version": "30.4.0",
9
+ "version": "30.5.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@google-cloud/storage": "6.9.5",
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "sitespeed.io": "./bin/sitespeed.js",
6
6
  "sitespeed.io-wpr": "./bin/browsertimeWebPageReplay.js"
7
7
  },
8
- "version": "30.4.0",
8
+ "version": "30.5.0",
9
9
  "description": "Analyze the web performance of your site",
10
10
  "keywords": [
11
11
  "performance",