Skip to content

Instantly share code, notes, and snippets.

Build sizes for a MODIFIED version of https://github.com/facebook/react/pull/15877 that aliases `Error` to a minifiable identifier.
┌───────────────────────────────────────────────────────────────────────┬───────────┬──────────────┬──────┬───────────┬──────────────┬──────┐
│ Bundle │ Prev Size │ Current Size │ Diff │ Prev Gzip │ Current Gzip │ Diff │
├───────────────────────────────────────────────────────────────────────┼───────────┼──────────────┼──────┼───────────┼──────────────┼──────┤
│ react.development.js (UMD_DEV) │ 0 B │ 110.36 KB │ n/a │ 0 B │ 27.88 KB │ n/a │
├───────────────────────────────────────────────────────────────────────┼───────────┼──────────────┼──────┼───────────┼──────────────┼──────┤
│ react.production.min.js (UMD_PROD) │ 0 B │ 12.32 KB │ n/a │ 0 B │ 4.8 KB │ n/a │
├──────────────────────────────────────
@motiz88
motiz88 / Animated-modulo-addition.js
Last active February 10, 2018 18:42
Part of a set of snippets for animated.macro Medium post
const result = Animated.modulo(
Animated.add(phase, Math.PI * 2 + angle),
Math.PI * 2
);
// Work in progress
// Babel plugin to convert Node-style callback code to async/await
export default function(babel) {
const { types: t } = babel;
const asyncControlFlowVisitor = {
CallExpression(path) {
const callee = path.get("callee");
if (
@motiz88
motiz88 / .babelrc
Last active March 19, 2017 14:35
Babel #4367 repro
{
"plugins": [
"transform-es3-property-literals",
"transform-es2015-modules-commonjs",
"transform-es2015-classes",
]
}
@motiz88
motiz88 / package.json
Created October 19, 2016 11:51
Test repo for `nyc --all` with `babel-plugin-istanbul`
{
"name": "dummy",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"build": "babel src -d dist",
"test": "node dist/a",
"test-cov": "cross-env BABEL_ENV=test npm run build && nyc --all node dist/a && nyc report --reporter html"
},
@motiz88
motiz88 / .babelrc
Last active November 23, 2015 11:34
Babel v6 regenerator/runtime/import issue
{
"presets": ["es2015"],
"plugins": ["transform-runtime"]
}
@motiz88
motiz88 / Example.js
Created September 22, 2015 10:04
React lifecycle method grouping, using a decorator
import methodGroups fom './method-groups-decorator';
@methodGroups('lifecycle')
class Example extends React.Component {
static lifecycle = {
componentWillMount() {},
componentDidMount() {},
componentWillReceiveProps() {},
shouldComponentUpdate() {},
componentWillUpdate() {},