Skip to content

Instantly share code, notes, and snippets.

View connorjclark's full-sized avatar

Connor Clark connorjclark

View GitHub Profile
"treemap-data": {
"id": "treemap-data",
"title": "Treemap Data",
"description": "Used for treemap visualization.",
"score": null,
"scoreDisplayMode": "informative",
"details": {
"type": "debugdata",
"treemapData": {
"scripts": [
@connorjclark
connorjclark / count-strings-i18n.js
Last active July 22, 2020 18:31
historical LH i18n string coverage
// git rev-list master~1000..master | xargs -n1 -I{} sh -c 'git checkout --quiet {} && yarn i18n:collect-strings > /dev/null && git rev-parse HEAD && node ~/tmp/count/count-strings-i18n.js'
// https://github.com/GoogleChrome/lighthouse/pull/11149
'use strict';
const fs = require('fs');
const glob = require('glob');
/** @typedef {import('../../lib/i18n/locales.js').LhlMessages} LhlMessages */
@connorjclark
connorjclark / README.md
Last active July 8, 2020 03:17
webdev learning materials
@connorjclark
connorjclark / gist:515d05094ffd1fc038894a77156bf226
Created June 9, 2020 23:09
babel preset env esmodules true output
@babel/preset-env: `DEBUG` option
Using targets:
{
"android": "61",
"chrome": "61",
"edge": "16",
"firefox": "60",
"ios": "10.3",
"opera": "48",
@connorjclark
connorjclark / README.md
Created June 8, 2020 22:49
regenerator transpile
// @ts-nocheck
/* eslint-disable */

class MyTestClass {};
async function reg(...args) {
  await 1;
  for (let i = 0; i < 10; i++) await 2;
  await 3;
}
@connorjclark
connorjclark / memory-test.ts
Created May 27, 2020 18:48
memory leak test
import { ChildProcess, spawn } from 'child_process';
import * as puppeteer from 'puppeteer';
const DEBUG = Boolean(process.env.DEBUG);
const CI = Boolean(process.env.CI);
const QUERY = Boolean(process.env.QUERY);
jest.setTimeout((QUERY ? 200 : 100) * 1000);
interface MemorySample {
@connorjclark
connorjclark / README.md
Last active May 15, 2020 18:02
Lighthouse Scoring Changes 5.6.0 -> 6.0
Match author styles (not UA or user styles) for an element: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/css/resolver/style_resolver.cc;l=681;drc=28442cacc3be1a7d05a898aba663025a143095ac?originalUrl=https:%2F%2Fcs.chromium.org%2F
... 2 call stack frames away from ...
Collect the rules for an element: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/css/element_rule_collector.cc;drc=28442cacc3be1a7d05a898aba663025a143095ac;bpv=0;bpt=1;l=207?originalUrl=https:%2F%2Fcs.chromium.org%2F
... which calls this a few times for different matching scenarios ...
Collect matching rules: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/css/element_rule_collector.cc;l=133;drc=28442cacc3be1a7d05a898aba663025a143095ac?originalUrl=https:%2F%2Fcs.chromium.org%2F
@connorjclark
connorjclark / 5.6.0-6.0v1.json
Last active April 28, 2020 23:20
11ty Lighthouse 5.6 -> 6.0 Scoring
[
{
"name": "performance",
"url": "https://www.teami.io/",
"mean": "13.2 -> 35.4",
"mean Δ": 22.2
},
{
"name": "performance",
"url": "https://tto.koser.us/",
@connorjclark
connorjclark / README.md
Last active March 27, 2020 18:04
Direct Audit

Direct Audit

This recipe is for advanced usages of Lighthouse as a Node library.

Normally, Lighthouse runs Chrome and generates a set of artifacts to use as input to many core modules (such as audits or computed artifacts). You can use these modules directly, but you must provide the inputs yourself.