Skip to content

Instantly share code, notes, and snippets.

View sidx1024's full-sized avatar

Sid sidx1024

View GitHub Profile
@rohit-gohri
rohit-gohri / v8Coverage.js
Created April 13, 2022 04:50
Get runtime coverage from V8 in istanbul format
/* eslint-disable global-require, import/no-extraneous-dependencies, @typescript-eslint/no-use-before-define */
/**
* @see https://github.com/bcoe/c8/issues/376
* @see https://github.com/tapjs/processinfo/blob/33c72e547139630cde35a4126bb4575ad7157065/lib/register-coverage.cjs
*/
if (process.env.V8_COVERAGE) {
process.setSourceMapsEnabled(true);
const inspector = require('inspector');
const session = new inspector.Session();

⚠️ Warning: this document is out of date.

For the most recent webpack5 instructions see MIGRATION.md.

Storybook experimental Webpack 5 support

Storybook 6.2 includes experimental Webpack 5 support. Webpack 5 brings a variety of performance improvements, as well as exciting new features like module federation. Here's a quick guide to get you going.

Intro

@ccnokes
ccnokes / detect-reflow.js
Created May 27, 2017 05:34
script for detecting DOM method calls that are know to cause a reflow
// These methods and getter/setters force layout/reflow in Chrome/WebKit
// From https://gist.github.com/paulirish/5d52fb081b3570c81e3a
const getterSetters = [
'offsetLeft',
'offsetTop',
'offsetWidth',
'offsetHeight',
'offsetParent',
'clientLeft',
@Rich-Harris
Rich-Harris / service-workers.md
Last active May 19, 2024 23:55
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.