This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// | |
// function loader() { | |
// return new Promise((resolve) => { | |
// if (process.env.LAZY_LOAD) { | |
// require.ensure([], (require) => { | |
// resolve(require('./SomeComponent').default); | |
// }); | |
// } | |
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function arrayIncludes(arr, search, fromIndex) { | |
return arr.includes(search, fromIndex); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -bur esm-before/components/CalendarDay.js esm/components/CalendarDay.js | |
--- esm-before/components/CalendarDay.js 2018-08-22 15:21:46.000000000 -0700 | |
+++ esm/components/CalendarDay.js 2018-08-22 15:22:02.000000000 -0700 | |
@@ -25,7 +25,7 @@ | |
import { DAY_SIZE } from '../constants'; | |
-var propTypes = forbidExtraProps(_objectAssign({}, withStylesPropTypes, { | |
+var propTypes = process.env.NODE_ENV !== "production" ? forbidExtraProps(_objectAssign({}, withStylesPropTypes, { | |
day: momentPropTypes.momentObj, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileoverview dynamicImport requires a leading comment with the webpackChunkName | |
* @author Kimberly Strauch | |
* @copyright 2018 Kimberly Strauch. All rights reserved. | |
* See LICENSE file in root directory for full license. | |
*/ | |
'use strict'; | |
const rule = require('../../../lib/rules/dynamic-import-requires-webpack-chunkname'); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Make the script fail on the first error encountered. | |
set -euo pipefail | |
# Create a temp folder that we can use to store files in. | |
if [ "$(uname -s)" = "Darwin" ]; then | |
tmp_dir=$(mktemp -d -t find-dead-modules.XXXXXXXX) | |
else | |
tmp_dir=$(mktemp -d --tmpdir find-dead-modules.XXXXXXXX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Keep track of all DLS components: | |
const DLSComponents = {}; | |
// Keep track of all DLS examples: | |
const DLSExamples = {}; | |
function requireComponent(srcFile, requireFn) { | |
// Extract the component name from the file name: | |
let componentName = path.basename(srcFile, '.jsx'); | |
// Handle ComponentName/index.jsx: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet cc "createClass" b | |
var ${1:`!p snip.rv = ''.join(x.title() for x in re.sub('\.js$', '', snip.basename or 'ModuleName').split('_'))`} = React.createClass({ | |
/** | |
* @return {Object} | |
*/ | |
render: function() { | |
return ( | |
$0 | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo '"days ago","tests"' > testCounts.csv | |
for i in $(seq 1 365); | |
do | |
git checkout "$(git rev-list -n 1 --before="$i days ago" origin/master)" | |
matches=$(\ | |
find spec/javascripts -name "*.js" -o -name "*.jsx" | \ |