-
Create an app using the following instructions: https://gist.github.com/nataliemarleny/78fb26ac874a013b7fce4dc0c80eee8f
-
Downloaded all JS files from "Chrome Dev-tools > Sources":
-
Count number of lines
createElement
appears in:
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
#!/usr/bin/env bash | |
set -eu -o pipefail | |
# Script expects these binaries to be present: | |
# - wget | |
# - node | |
# Tested on Mac. | |
# Example: | |
# | |
# bash sizeOfStringInUrl.sh nextjs.org "\bcreateElement\b" |
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
{ | |
"name": "npm-package-name", | |
"dependencies": { | |
"packageDependency": "file:/packageDirectory/packageName" | |
} | |
} |
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
# JavaScript | |
node_modules | |
.next | |
# Mac | |
.DS_Store |
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
const Main = () => ( | |
<div>Main page!</div> | |
); | |
export default Main; |
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
{ | |
"scripts": { | |
"dev": "next", | |
"build": "next build", | |
"start": "next start" | |
} | |
} |
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
{ | |
"scripts": { | |
"test": "jest" | |
} | |
} |
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
function sum(a, b) { | |
return a + b; | |
} | |
module.exports = sum; |
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
const sum = require('./sum'); | |
test('adds 1 + 2 to equal 3', () => { | |
expect(sum(1, 2)).toBe(3); | |
}); |
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
// Reduced | |
const obj1 = { | |
fun1() {} | |
} | |
const obj1 = { | |
fun1: () => {} | |
} | |
// this |