Skip to content

Instantly share code, notes, and snippets.

View eps1lon's full-sized avatar
:atom:
mt?!" “ .I.r '2 f

Sebastian Silbermann eps1lon

:atom:
mt?!" “ .I.r '2 f
View GitHub Profile
@eps1lon
eps1lon / next.config.js
Last active April 30, 2024 11:33
better Webpack stats for Next.js
const { writeFileSync } = require('fs')
const path = require('path')
const { StatsWriterPlugin } = require('webpack-stats-plugin')
/**
* @type {import('next').NextConfig}
*/
const config = {
webpack: (config, { isServer, nextRuntime, dev }) => {
config.plugins.push(
// jonschlinkert/is-object
type IsObjectObject<T> = T extends
| AnyArray
| AnyFunction
| boolean
| null
| number
| string
| symbol
| undefined
@eps1lon
eps1lon / gh-branch-split
Last active December 6, 2023 09:34
Split branch into one branch per folder
#!/bin/bash
set -e
branchToSplit="feat/react/deprecated-react-node-array"
title="Remove usage of deprecated ReactChild"
message="This PR removes the usage of the deprecated \`ReactChild\` type (see https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/64451)."
mergeBase=$(git merge-base origin/master $branchToSplit)
types=( $(git diff --name-only $mergeBase $branchToSplit | grep -oE 'types/[^/]+/' | cut -d/ -f2 | uniq) )
@eps1lon
eps1lon / react-types-fork-backport.sh
Created May 28, 2023 17:11
react-types-fork-backport
git diff 1a5956fbfda99ad3392a1813bd0822d39c46585f HEAD | sed 's|types/react/|types/react/ts5.0/|' | git apply
@eps1lon
eps1lon / react-dom-test-selectors.md
Last active January 9, 2023 17:26 — forked from bvaughn/react-dom-test-selectors.md
DRAFT NOT FOR SHARE Experimental React DOM test selector API

RFC Test Selectors

Owner: Brian Vaughn, Sebastian Silbermann


As of facebook/react/pull/22760, the experimental Test Selector API is now available in the experimental release channel.

To test the API, first install the experimental release:

@eps1lon
eps1lon / automatic-numbering-ordered-lists.md
Created August 8, 2022 08:52
automatic numbering in markdown ordered lists
  1. first
  2. second
  3. third
@eps1lon
eps1lon / README.md
Last active March 19, 2022 08:29
ARIA spec to aria-query
@eps1lon
eps1lon / README.md
Last active March 2, 2022 07:24
React 18 Working Group work
// Press ctrl+space for code completion
export default function transformer(file, api) {
const j = api.jscodeshift;
function hasPropsArgument(node) {
return node.params.length === 0 || node.params[0].name === 'props';
}
function isFunctionComponent(path) {
const { node } = path;