Skip to content

Commit 91adb87

Browse files
gmetaisdependabot[bot]macbre
authored
Analyze images module (#1306)
* Build(deps): bump coverallsapp/github-action from 2.2.0 to 2.2.1 (#171) Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.2.0 to 2.2.1. - [Release notes](https://github.com/coverallsapp/github-action/releases) - [Commits](coverallsapp/github-action@v2.2.0...v2.2.1) --- updated-dependencies: - dependency-name: coverallsapp/github-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Build(deps): bump puppeteer from 20.8.1 to 20.8.3 (#172) Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 20.8.1 to 20.8.3. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json) - [Commits](puppeteer/puppeteer@puppeteer-v20.8.1...puppeteer-v20.8.3) --- updated-dependencies: - dependency-name: puppeteer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Build(deps): bump puppeteer from 20.8.3 to 20.9.0 (#173) Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 20.8.3 to 20.9.0. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json) - [Commits](puppeteer/puppeteer@puppeteer-v20.8.3...puppeteer-v20.9.0) --- updated-dependencies: - dependency-name: puppeteer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add AVIF as an image type (#1299) Co-authored-by: Maciej Brencz <maciej.brencz@gmail.com> * Fix a false JSError reported by Phantomas (#1296) Co-authored-by: Maciej Brencz <maciej.brencz@gmail.com> * v2.9.0 * (deps) bump puppeteer to v21.0.2 * Update from upstream Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update from upstream * Introduce a new analyze-images module with a few rules * Linter / prettifier / make-docs * Update package.json + package-lock.json * Fix package-lock.json --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Maciej Brencz <maciej.brencz@gmail.com> Co-authored-by: macbre <macbre@users.noreply.github.com>
1 parent 5e2f929 commit 91adb87

15 files changed

+5943
-546
lines changed

bin/program.js

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ function getProgram() {
131131

132132
// Output and reporting
133133
.option("--analyze-css", "emit in-depth CSS metrics")
134+
.option("--analyze-images", "emit in-depth image metrics")
134135
.option("--colors", "forces ANSI colors even when output is piped")
135136
.option(
136137
"--film-strip",

docs/events.md

+63-72
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ Arguments passed to the event:
140140
"method": "GET",
141141
"headers": {
142142
"Upgrade-Insecure-Requests": "1",
143-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4950.0 Safari/537.36 Phantomas/2.4.0"
143+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.5790.98 Safari/537.36 Phantomas/2.9.0"
144144
},
145145
"mixedContentType": "none",
146146
"initialPriority": "VeryHigh",
147147
"referrerPolicy": "strict-origin-when-cross-origin",
148148
"isSameSite": true,
149-
"_requestId": "7EB9712AA9EB3011BC4F4F792F24758D",
150-
"_timestamp": 233671.373283,
149+
"_requestId": "AB54BDDE82405E50795287A956C56D85",
150+
"_timestamp": 1054644.425833,
151151
"_type": "Document",
152152
"_initiator": {
153153
"type": "other"
@@ -167,14 +167,14 @@ Arguments passed to the event:
167167
"method": "GET",
168168
"headers": {
169169
"Upgrade-Insecure-Requests": "1",
170-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4950.0 Safari/537.36 Phantomas/2.4.0"
170+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.5790.98 Safari/537.36 Phantomas/2.9.0"
171171
},
172172
"mixedContentType": "none",
173173
"initialPriority": "VeryHigh",
174174
"referrerPolicy": "strict-origin-when-cross-origin",
175175
"isSameSite": true,
176-
"_requestId": "7EB9712AA9EB3011BC4F4F792F24758D",
177-
"_timestamp": 233671.373283,
176+
"_requestId": "AB54BDDE82405E50795287A956C56D85",
177+
"_timestamp": 1054644.425833,
178178
"_type": "Document",
179179
"_initiator": {
180180
"type": "other"
@@ -198,49 +198,50 @@ Arguments passed to the event:
198198
"Connection": "keep-alive",
199199
"Content-Encoding": "gzip",
200200
"Content-Type": "text/html",
201-
"Date": "Wed, 04 May 2022 22:02:04 GMT",
202-
"ETag": "W/\"60ae63c4-30f\"",
203-
"Expires": "Thu, 05 May 2022 22:02:04 GMT",
204-
"Last-Modified": "Wed, 26 May 2021 15:05:40 GMT",
201+
"Date": "Tue, 15 Aug 2023 12:28:56 GMT",
202+
"ETag": "W/\"64ac142c-30f\"",
203+
"Expires": "Wed, 16 Aug 2023 12:28:56 GMT",
204+
"Last-Modified": "Mon, 10 Jul 2023 14:22:36 GMT",
205205
"Server": "nginx",
206206
"Transfer-Encoding": "chunked"
207207
},
208208
"mimeType": "text/html",
209-
"connectionReused": false,
210-
"connectionId": 11,
209+
"connectionReused": true,
210+
"connectionId": 37,
211211
"remoteIPAddress": "0.0.0.0",
212212
"remotePort": 8888,
213213
"fromDiskCache": false,
214214
"fromServiceWorker": false,
215215
"fromPrefetchCache": false,
216216
"encodedDataLength": 720,
217217
"timing": {
218-
"requestTime": 233671.37754,
218+
"requestTime": 1054644.429149,
219219
"proxyStart": -1,
220220
"proxyEnd": -1,
221-
"dnsStart": 13.281,
222-
"dnsEnd": 13.289,
223-
"connectStart": 13.289,
224-
"connectEnd": 13.453,
221+
"dnsStart": -1,
222+
"dnsEnd": -1,
223+
"connectStart": -1,
224+
"connectEnd": -1,
225225
"sslStart": -1,
226226
"sslEnd": -1,
227227
"workerStart": -1,
228228
"workerReady": -1,
229229
"workerFetchStart": -1,
230230
"workerRespondWithSettled": -1,
231-
"sendStart": 14.703,
232-
"sendEnd": 15.226,
231+
"sendStart": 1.851,
232+
"sendEnd": 1.881,
233233
"pushStart": 0,
234234
"pushEnd": 0,
235-
"receiveHeadersEnd": 24.219
235+
"receiveHeadersEnd": 19.973
236236
},
237-
"responseTime": 1651701724644.302,
237+
"responseTime": 1692102536904.425,
238238
"protocol": "http/1.1",
239+
"alternateProtocolUsage": "unspecifiedReason",
239240
"securityState": "insecure",
240-
"_requestId": "7EB9712AA9EB3011BC4F4F792F24758D",
241+
"_requestId": "AB54BDDE82405E50795287A956C56D85",
241242
"dataLength": 783,
242243
"chunks": 1,
243-
"_timestamp": 233671.403456
244+
"_timestamp": 1054644.449299
244245
}
245246
]
246247
```
@@ -252,18 +253,18 @@ Arguments passed to the event:
252253
```json
253254
[
254255
{
255-
"id": "7EB9712AA9EB3011BC4F4F792F24758D",
256+
"id": "AB54BDDE82405E50795287A956C56D85",
256257
"url": "http://0.0.0.0:8888/_make_docs.html",
257258
"method": "GET",
258259
"headers": {
259260
"cache-control": "max-age=86400",
260261
"connection": "keep-alive",
261262
"content-encoding": "gzip",
262263
"content-type": "text/html",
263-
"date": "Wed, 04 May 2022 22:02:04 GMT",
264-
"etag": "W/\"60ae63c4-30f\"",
265-
"expires": "Thu, 05 May 2022 22:02:04 GMT",
266-
"last-modified": "Wed, 26 May 2021 15:05:40 GMT",
264+
"date": "Tue, 15 Aug 2023 12:28:56 GMT",
265+
"etag": "W/\"64ac142c-30f\"",
266+
"expires": "Wed, 16 Aug 2023 12:28:56 GMT",
267+
"last-modified": "Mon, 10 Jul 2023 14:22:36 GMT",
267268
"server": "nginx",
268269
"transfer-encoding": "chunked"
269270
},
@@ -274,9 +275,9 @@ Arguments passed to the event:
274275
"protocol": "http",
275276
"domain": "0.0.0.0",
276277
"query": "",
277-
"stalled": 14.703,
278-
"timeToFirstByte": 8.993,
279-
"timeToLastByte": 0.03017300000647083,
278+
"stalled": 1.851,
279+
"timeToFirstByte": 18.092,
280+
"timeToLastByte": 0.023465999867767096,
280281
"headersSize": 293,
281282
"gzip": true,
282283
"contentType": "text/html",
@@ -294,49 +295,50 @@ Arguments passed to the event:
294295
"Connection": "keep-alive",
295296
"Content-Encoding": "gzip",
296297
"Content-Type": "text/html",
297-
"Date": "Wed, 04 May 2022 22:02:04 GMT",
298-
"ETag": "W/\"60ae63c4-30f\"",
299-
"Expires": "Thu, 05 May 2022 22:02:04 GMT",
300-
"Last-Modified": "Wed, 26 May 2021 15:05:40 GMT",
298+
"Date": "Tue, 15 Aug 2023 12:28:56 GMT",
299+
"ETag": "W/\"64ac142c-30f\"",
300+
"Expires": "Wed, 16 Aug 2023 12:28:56 GMT",
301+
"Last-Modified": "Mon, 10 Jul 2023 14:22:36 GMT",
301302
"Server": "nginx",
302303
"Transfer-Encoding": "chunked"
303304
},
304305
"mimeType": "text/html",
305-
"connectionReused": false,
306-
"connectionId": 11,
306+
"connectionReused": true,
307+
"connectionId": 37,
307308
"remoteIPAddress": "0.0.0.0",
308309
"remotePort": 8888,
309310
"fromDiskCache": false,
310311
"fromServiceWorker": false,
311312
"fromPrefetchCache": false,
312313
"encodedDataLength": 720,
313314
"timing": {
314-
"requestTime": 233671.37754,
315+
"requestTime": 1054644.429149,
315316
"proxyStart": -1,
316317
"proxyEnd": -1,
317-
"dnsStart": 13.281,
318-
"dnsEnd": 13.289,
319-
"connectStart": 13.289,
320-
"connectEnd": 13.453,
318+
"dnsStart": -1,
319+
"dnsEnd": -1,
320+
"connectStart": -1,
321+
"connectEnd": -1,
321322
"sslStart": -1,
322323
"sslEnd": -1,
323324
"workerStart": -1,
324325
"workerReady": -1,
325326
"workerFetchStart": -1,
326327
"workerRespondWithSettled": -1,
327-
"sendStart": 14.703,
328-
"sendEnd": 15.226,
328+
"sendStart": 1.851,
329+
"sendEnd": 1.881,
329330
"pushStart": 0,
330331
"pushEnd": 0,
331-
"receiveHeadersEnd": 24.219
332+
"receiveHeadersEnd": 19.973
332333
},
333-
"responseTime": 1651701724644.302,
334+
"responseTime": 1692102536904.425,
334335
"protocol": "http/1.1",
336+
"alternateProtocolUsage": "unspecifiedReason",
335337
"securityState": "insecure",
336-
"_requestId": "7EB9712AA9EB3011BC4F4F792F24758D",
338+
"_requestId": "AB54BDDE82405E50795287A956C56D85",
337339
"dataLength": 783,
338340
"chunks": 1,
339-
"_timestamp": 233671.403456
341+
"_timestamp": 1054644.449299
340342
}
341343
]
342344
```
@@ -347,16 +349,7 @@ Arguments passed to the event:
347349

348350
```json
349351
[
350-
{
351-
"_type": "error",
352-
"_text": "Failed to load resource: the server responded with a status of 404 (Not Found)",
353-
"_args": [],
354-
"_stackTraceLocations": [
355-
{
356-
"url": "http://0.0.0.0:8888/static/foo.min.js"
357-
}
358-
]
359-
}
352+
{}
360353
]
361354
```
362355

@@ -366,10 +359,8 @@ Arguments passed to the event:
366359

367360
```json
368361
[
369-
"ReferenceError: unknown_function_called is not defined",
370-
[
371-
" at http://0.0.0.0:8888/_make_docs.html:31:3"
372-
]
362+
"unknown_function_called is not defined",
363+
[]
373364
]
374365
```
375366

@@ -390,19 +381,19 @@ Arguments passed to the event:
390381
```json
391382
[
392383
{
393-
"Timestamp": 233671.751763,
384+
"Timestamp": 1054644.632499,
394385
"Documents": 3,
395386
"Frames": 1,
396-
"JSEventListeners": 22,
397-
"Nodes": 210,
398-
"LayoutCount": 13,
387+
"JSEventListeners": 23,
388+
"Nodes": 207,
389+
"LayoutCount": 14,
399390
"RecalcStyleCount": 15,
400-
"LayoutDuration": 0.017863,
401-
"RecalcStyleDuration": 0.004322,
402-
"ScriptDuration": 0.074783,
403-
"TaskDuration": 0.190317,
404-
"JSHeapUsedSize": 4006772,
405-
"JSHeapTotalSize": 5857280
391+
"LayoutDuration": 0.009906,
392+
"RecalcStyleDuration": 0.001265,
393+
"ScriptDuration": 0.041899,
394+
"TaskDuration": 0.095868,
395+
"JSHeapUsedSize": 4212528,
396+
"JSHeapTotalSize": 6176768
406397
}
407398
]
408399
```

0 commit comments

Comments
 (0)