sitespeed.io 33.3.0 → 33.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,5 +1,27 @@
1
1
  # CHANGELOG - sitespeed.io (we use [semantic versioning](https://semver.org))
2
2
 
3
+ ## 33.5.0 - 2024-04-04
4
+ ### Added
5
+ * Updated to Edge 123 in the Docker container [#4135](https://github.com/sitespeedio/sitespeed.io/pull/4135).
6
+ * Added missing default green/yellow/red limits for CLS and TTFB on the start page [#4120](https://github.com/sitespeedio/sitespeed.io/pull/4120).
7
+ * Browsertime 21.7.0 with Edgedriver 123.
8
+
9
+ ### Fixed
10
+ * The summary page alway showed blue color for AXE violations. This PR makes them green/yellow/red [#4123](https://github.com/sitespeedio/sitespeed.io/pull/4123).
11
+ * Updated dependencies:
12
+ * Axe-core 4.9.0 [#4126](https://github.com/sitespeedio/sitespeed.io/pull/4126)
13
+ * CO2 0.14.4 [#4127](https://github.com/sitespeedio/sitespeed.io/pull/4127)
14
+ * import-global 1.1.0 [#4129](https://github.com/sitespeedio/sitespeed.io/pull/4129)
15
+ * AWS SDK 2.1591.0 [#4130](https://github.com/sitespeedio/sitespeed.io/pull/4130)
16
+ * dayjs 1.11.10, fs-extra 11.2.0, uuid 9.0.1, junit-report-builder 3.2.1, [#4131](https://github.com/sitespeedio/sitespeed.io/pull/4131).
17
+ * cli-color 2.0.4, node-scp 0.0.23, ora 8.0.1, os-name 5.0.0 and p-limit 5.0.0 [#4132](https://github.com/sitespeedio/sitespeed.io/pull/4132).
18
+ * tape 5.7.5, find-up 7.0.0, sass 1.72.0 and clean-css-cli 5.6.3 [#4133](https://github.com/sitespeedio/sitespeed.io/pull/4133)
19
+
20
+ ## 33.4.0 - 2024-03-20
21
+ ### Added
22
+ * Chrome 123, Firefox 124 and Edge 122 in the Docker container [#4114](https://github.com/sitespeedio/sitespeed.io/pull/4114).
23
+ * Browsertime [21.6.0](https://github.com/sitespeedio/browsertime/blob/main/CHANGELOG.md#2160---2024-03-20) with updated Chrome/Edgedriver and a fix for running `.stopAsError`.
24
+
3
25
  ## 33.3.0 - 2024-03-16
4
26
  ### Added
5
27
  * Show Long Animation frames (enabled in Chrome 123) [#4180](https://github.com/sitespeedio/sitespeed.io/pull/4108). Using the timeline/profiling is still best doing your tests but long animation frames can help you if you do not have it turned on or familiar with thart data in RUM. Please create an issue if you have any ideas on how we shoudl display the metrics/information!
package/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM sitespeedio/webbrowsers:chrome-122.0-firefox-123.0-edge-121.0
1
+ FROM sitespeedio/webbrowsers:chrome-123.0-firefox-124.0-edge-123.0
2
2
 
3
3
  ARG TARGETPLATFORM=linux/amd64
4
4
 
@@ -2,8 +2,7 @@ import { join, basename, resolve, dirname } from 'node:path';
2
2
  import { readdir as _readdir } from 'node:fs';
3
3
  import { promisify } from 'node:util';
4
4
 
5
- import pkg from 'import-global';
6
- const { silent } = pkg;
5
+ import { importGlobalSilent } from 'import-global';
7
6
  const readdir = promisify(_readdir);
8
7
  const __dirname = dirname(import.meta.url);
9
8
 
@@ -78,7 +77,7 @@ export async function loadPlugins(pluginNames, options, context, queue) {
78
77
  plugins.push(p);
79
78
  } catch (error) {
80
79
  // try global
81
- let plugin = silent(name);
80
+ let plugin = await importGlobalSilent(name);
82
81
  if (plugin) {
83
82
  let p = new plugin(options, context, queue);
84
83
  plugins.push(p);
@@ -8,7 +8,7 @@ function getDomainOrFileName(input) {
8
8
  let domainOrFile = input;
9
9
  domainOrFile = domainOrFile.startsWith('http')
10
10
  ? parse(domainOrFile).hostname
11
- : basename(domainOrFile).replace(/\./g, '_');
11
+ : basename(domainOrFile).replaceAll('.', '_');
12
12
  return domainOrFile;
13
13
  }
14
14
 
@@ -8,7 +8,7 @@ const log = intel.getLogger('sitespeedio.file');
8
8
 
9
9
  function toSafeKey(key) {
10
10
  // U+2013 : EN DASH – as used on https://en.wikipedia.org/wiki/2019–20_coronavirus_pandemic
11
- return key.replace(/[ %&()+,./:?|~–]|%7C/g, '-');
11
+ return key.replaceAll(/[ %&()+,./:?|~–]|%7C/g, '-');
12
12
  }
13
13
 
14
14
  export function pathToFolder(url, options, alias) {
@@ -60,7 +60,7 @@ export function pathToFolder(url, options, alias) {
60
60
 
61
61
  for (const [index, segment] of pathSegments.entries()) {
62
62
  if (segment) {
63
- pathSegments[index] = segment.replace(/[^\w.\u0621-\u064A-]/gi, '-');
63
+ pathSegments[index] = segment.replaceAll(/[^\w.\u0621-\u064A-]/gi, '-');
64
64
  }
65
65
  }
66
66
 
@@ -159,9 +159,8 @@ export async function analyzeUrl(
159
159
  }
160
160
  }
161
161
  const scriptCategories = await browserScripts.allScriptCategories();
162
- let scriptsByCategory = await browserScripts.getScriptsForCategories(
163
- scriptCategories
164
- );
162
+ let scriptsByCategory =
163
+ await browserScripts.getScriptsForCategories(scriptCategories);
165
164
 
166
165
  if (btOptions.script) {
167
166
  const userScripts = await parseUserScripts(btOptions.script);
@@ -194,10 +194,10 @@ export async function getFilmstrip(
194
194
  const files = await readdir(join(dir, 'data', 'filmstrip', run + ''));
195
195
  const timings = [];
196
196
  for (let file of files) {
197
- timings.push({ time: file.replace(/\D/g, ''), file });
197
+ timings.push({ time: file.replaceAll(/\D/g, ''), file });
198
198
  }
199
199
 
200
- const maxTiming = timings.slice(-1)[0].time;
200
+ const maxTiming = timings.at(-1).time;
201
201
 
202
202
  // We step 100 ms each step ... but if you wanna show all and the last change is late
203
203
  // use 200 ms
@@ -18,9 +18,9 @@ export function writeJunit(results, dir, options) {
18
18
  if (url.startsWith('http')) {
19
19
  const parsedUrl = parse(url);
20
20
  name = url.startsWith('http') ? url : url;
21
- parsedUrl.hostname.replace(/\./g, '_') +
21
+ parsedUrl.hostname.replaceAll('.', '_') +
22
22
  '.' +
23
- parsedUrl.path.replace(/\./g, '_').replace(/\//g, '_');
23
+ parsedUrl.path.replaceAll('.', '_').replaceAll('/', '_');
24
24
  }
25
25
 
26
26
  const suite = jrp
@@ -114,7 +114,7 @@ export default class GcsPlugin extends SitespeedioPlugin {
114
114
  if (this.options.copyLatestFilesToBase) {
115
115
  const rootPath = resolve(baseDir, '..');
116
116
  const directoriesAsArray = rootPath.split(sep);
117
- const rootName = directoriesAsArray.slice(-1)[0];
117
+ const rootName = directoriesAsArray.at(-1);
118
118
  await uploadLatestFiles(rootPath, gcsOptions, rootName);
119
119
  }
120
120
  log.info('Finished upload to Google Cloud Storage');
@@ -78,8 +78,8 @@ export function getMetricsFromPageSummary(pageInfo) {
78
78
  return timings.loadEventEnd
79
79
  ? `Median LoadEventEnd: ${timings.loadEventEnd.median}`
80
80
  : '' + timings.fullyLoaded
81
- ? `Median Fully loaded: ${timings.fullyLoaded.median}`
82
- : '';
81
+ ? `Median Fully loaded: ${timings.fullyLoaded.median}`
82
+ : '';
83
83
  } else {
84
84
  return '';
85
85
  }
@@ -11,7 +11,7 @@ function infoBox(stat, name, formatter) {
11
11
  return;
12
12
  }
13
13
 
14
- return _box(stat, name, 'info', formatter, name.replace(/\s/g, ''));
14
+ return _box(stat, name, 'info', formatter, name.replaceAll(/\s/g, ''));
15
15
  }
16
16
 
17
17
  function scoreBox(stat, name, formatter, box, limits) {
@@ -30,7 +30,7 @@ function scoreBox(stat, name, formatter, box, limits) {
30
30
  label = 'error';
31
31
  }
32
32
  }
33
- return _box(stat, name, label, formatter, name.replace(/\s/g, ''));
33
+ return _box(stat, name, label, formatter, name.replaceAll(/\s/g, ''));
34
34
  }
35
35
 
36
36
  function timingBox(stat, name, formatter, box, limits) {
@@ -50,7 +50,7 @@ function timingBox(stat, name, formatter, box, limits) {
50
50
  }
51
51
  }
52
52
 
53
- return _box(stat, name, label, formatter, name.replace(/\s/g, ''));
53
+ return _box(stat, name, label, formatter, name.replaceAll(/\s/g, ''));
54
54
  }
55
55
 
56
56
  function pagexrayBox(stat, name, formatter, box, limits) {
@@ -69,7 +69,7 @@ function pagexrayBox(stat, name, formatter, box, limits) {
69
69
  }
70
70
  }
71
71
 
72
- return _box(stat, name, label, formatter, name.replace(/\s/g, ''));
72
+ return _box(stat, name, label, formatter, name.replaceAll(/\s/g, ''));
73
73
  }
74
74
 
75
75
  function axeBox(stat, name, formatter, url, limits) {
@@ -78,10 +78,10 @@ function axeBox(stat, name, formatter, url, limits) {
78
78
  }
79
79
  let label = 'info';
80
80
 
81
- if (limits && limits.green) {
82
- if (stat.median === limits.green) {
81
+ if (limits) {
82
+ if (stat.median < limits.green) {
83
83
  label = 'ok';
84
- } else if (stat.median === limits.yellow) {
84
+ } else if (stat.median < limits.yellow) {
85
85
  label = 'warning';
86
86
  } else {
87
87
  label = 'error';
@@ -25,6 +25,7 @@ export default {
25
25
  firstPaint: { green: 1000, yellow: 2000 },
26
26
  firstContentfulPaint: { green: 2000, yellow: 4000 },
27
27
  largestContentfulPaint: { green: 2500, yellow: 4000 },
28
+ backEndTime: { green: 800, yellow: 1800 },
28
29
  fullyLoaded: {},
29
30
  pageLoadTime: {},
30
31
  FirstVisualChange: { green: 1000, yellow: 2000 },
@@ -34,8 +35,8 @@ export default {
34
35
  VisualReadiness: { green: 500, yellow: 1000 },
35
36
  VisualComplete: {}
36
37
  },
37
- pageinfo: {
38
- cumulativeLayoutShift: {}
38
+ googleWebVitals: {
39
+ cumulativeLayoutShift: { green: 0.1, yellow: 0.25 }
39
40
  },
40
41
  requests: {
41
42
  total: { green: 80, yellow: 200 },
@@ -58,10 +59,10 @@ export default {
58
59
  transferSize: {}
59
60
  },
60
61
  axe: {
61
- critical: { green: 0, yellow: 1 },
62
- serious: { green: 0, yellow: 1 },
63
- minor: { green: 0, yellow: 1 },
64
- moderate: { green: 0, yellow: 1 }
62
+ critical: { green: 1, yellow: 2 },
63
+ serious: { green: 1, yellow: 2 },
64
+ minor: { green: 1, yellow: 2 },
65
+ moderate: { green: 1, yellow: 2 }
65
66
  },
66
67
  cpu: {
67
68
  longTasks: { green: 1, yellow: 3 },
@@ -104,6 +104,12 @@ export default class S3Plugin extends SitespeedioPlugin {
104
104
  throwIfMissing(this.s3Options, ['key', 'secret'], 's3');
105
105
  }
106
106
  this.storageManager = context.storageManager;
107
+
108
+ if (!this.s3Options.region) {
109
+ log.warning(
110
+ 'You are missing region. We will soon upgrade to AWS SDK 3 and then you need to specify region.'
111
+ );
112
+ }
107
113
  }
108
114
  async processMessage(message, queue) {
109
115
  if (message.type === 'sitespeedio.setup') {
@@ -127,7 +133,7 @@ export default class S3Plugin extends SitespeedioPlugin {
127
133
  if (this.options.copyLatestFilesToBase) {
128
134
  const rootPath = _resolve(baseDir, '..');
129
135
  const directoriesAsArray = rootPath.split(sep);
130
- const rootName = directoriesAsArray.slice(-1)[0];
136
+ const rootName = directoriesAsArray.at(-1);
131
137
  await uploadLatestFiles(rootPath, s3Options, rootName);
132
138
  }
133
139
  log.info('Finished upload to s3');
@@ -43,7 +43,7 @@ function getBoxes(metrics, html) {
43
43
  // foo bar -> fb
44
44
  function abbr(string_) {
45
45
  if (/total|overall/i.test(string_)) return string_.trim();
46
- return string_.replace(/\w+\s?/g, a => a[0]);
46
+ return string_.replaceAll(/\w+\s?/g, a => a[0]);
47
47
  }
48
48
 
49
49
  function noop(a) {
@@ -57,7 +57,7 @@ export class ThirdPartyAggregator {
57
57
  for (let tool of Object.keys(cpuPerTool)) {
58
58
  pushStats(
59
59
  this.cpuPerTool[url],
60
- tool.replace(/\./g, '_'),
60
+ tool.replaceAll('.', '_'),
61
61
  cpuPerTool[tool]
62
62
  );
63
63
  }
@@ -8,7 +8,7 @@ function joinNonEmpty(strings, delimeter) {
8
8
 
9
9
  function toSafeKey(key) {
10
10
  // U+2013 : EN DASH – as used on https://en.wikipedia.org/wiki/2019–20_coronavirus_pandemic
11
- return key.replace(/[ %&()+,./:?|~–]|%7C/g, '_');
11
+ return key.replaceAll(/[ %&()+,./:?|~–]|%7C/g, '_');
12
12
  }
13
13
 
14
14
  export function keypathFromUrl(url, includeQueryParameters, useHash, group) {
@@ -2,7 +2,7 @@ import get from 'lodash.get';
2
2
  import { keypathFromUrl } from './flattenMessage.js';
3
3
 
4
4
  export function toSafeKey(key, safeChar = '_') {
5
- return key.replace(/[ %&+,./:?|~–]|%7C/g, safeChar);
5
+ return key.replaceAll(/[ %&+,./:?|~–]|%7C/g, safeChar);
6
6
  }
7
7
  export function getConnectivity(options) {
8
8
  // if we have a friendly name for your connectivity, use that!