Skip to content

Instantly share code, notes, and snippets.

View anandthakker's full-sized avatar

Anand Eng-Thakker anandthakker

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@font-face {
font-family: 'Rubik';
font-style: normal;
font-weight: 400;
src:
local('Rubik'),
local('Rubik-Regular'),
url('./rubik-v4-latin-regular.woff2') format('woff2'),
url('./rubik-v4-latin-regular.woff') format('woff');
}
@anandthakker
anandthakker / package.json
Last active February 20, 2018 14:36
Rollup code-splitting AMD bug
{
"name": "code-splitting-bug",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"rollup": "^0.56.2"
}
}
global.fn = d => d + 1;
module.exports = global.fn;
// Used by the second rollup pass to reassemble the code-split chunks into a single bundle.
import './out/chunk1.js';
import './out/worker.js';
import './out/main.js';
export default lib;

BUILD: 5645ms

parse modules: 4789ms

  • plugin 4 (node-resolve) - resolveId: 76ms
  • plugin 6 (commonjs) - resolveId: 0ms
  • plugin 6 (commonjs) - resolveId (async): 160ms

load modules: 18ms

  • plugin 6 (commonjs) - load: 2ms
  • plugin 0 (flow-remove-types) - transform: 1097ms
  • plugin 1 (minify-style-spec) - transform: 4ms

BUILD: 5391ms

parse modules: 4564ms

  • plugin 4 (node-resolve) - resolveId: 71ms
  • plugin 6 (commonjs) - resolveId: 0ms
  • plugin 6 (commonjs) - resolveId (async): 152ms load modules: 21ms
  • plugin 6 (commonjs) - load: 2ms
  • plugin 0 (flow-remove-types) - transform: 1022ms
  • plugin 1 (minify-style-spec) - transform: 4ms
  • plugin 2 (json) - transform: 3ms
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="widget" style="width: 100%; height: 300px; background-color: #aacccc">It should not be possible to initiate a page scroll from within this element</div>
<div style="width: 100%; height: 50px; background-color: #ccc"></div>
<div style="width: 100%; height: 50px; background-color: #fff"></div>
<div style="width: 100%; height: 50px; background-color: #ccc"></div>
<div style="width: 100%; height: 50px; background-color: #fff"></div>
const dm = require('deepmerge');
if (typeof dm !== 'function') {
throw new Error("require('deepmerge') is not a function");
}
/* @flow */
type MutablePropertyValues<Props: {[string]: mixed}>
= $Exact<$ObjMap<Props, <T,R>(p: Property<T, R>) => PropertyValue<T, R>>>
type PropertyValues<Props: {[string]: mixed}>
= $ReadOnly<MutablePropertyValues<Props>>;
interface Layout<Props: {[string]: mixed}> {
getValue<S: string>(name: S): $ElementType<PropertyValues<Props>, S>;