Skip to content

Commit 6e50918

Browse files
committed
Stop displaying size in the README
It's going to unnecessarily complicate the release process, especially now that artifacts aren't saved to the repo anymore.
1 parent c13a7f6 commit 6e50918

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## What is Mithril.js?
1717

18-
A modern client-side JavaScript framework for web applications big and small. It's small (<!-- size -->9.12 KB<!-- /size --> gzipped), fast, and highly stable. And it offers utilities for routing, state management, and more right out of the box.
18+
A modern client-side JavaScript framework for web applications big and small. It's small, fast, and highly stable. And it offers utilities for routing, state management, and more right out of the box.
1919

2020
Mithril.js has been used by companies like Vimeo, Nike, and Amazon, and open source platforms like Lichess. 👍
2121

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434
},
3535
"scripts": {
36-
"build": "node scripts/build.js --save",
36+
"build": "node scripts/build.js",
3737
"lint": "eslint . --cache",
3838
"perf": "node performance/test-perf.js",
3939
"pretest": "npm run lint",

scripts/build.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,6 @@ async function report(file) {
5858
console.log(`${file}.js:`)
5959
console.log(` Original: ${format(originalGzipSize)} bytes gzipped (${format(originalSize)} bytes uncompressed)`)
6060
console.log(` Minified: ${format(compressedGzipSize)} bytes gzipped (${format(compressedSize)} bytes uncompressed)`)
61-
62-
return compressedGzipSize
63-
}
64-
65-
async function saveToReadme(size) {
66-
const readme = await fs.readFile(path.resolve(dirname, "../README.md"), "utf8")
67-
const kb = size / 1000
68-
69-
await fs.writeFile(path.resolve(dirname, "../README.md"),
70-
readme.replace(
71-
/(<!--\s*size\s*-->)(.+?)(<!--\s*\/size\s*-->)/,
72-
`\$1${kb % 1 ? kb.toFixed(2) : kb} KB\$3`
73-
)
74-
)
7561
}
7662

7763
async function main() {
@@ -84,12 +70,10 @@ async function main() {
8470
build("stream.esm", "esm"),
8571
])
8672

87-
const mithrilSize = await report("mithril.umd")
73+
await report("mithril.umd")
8874
await report("mithril.esm")
8975
await report("stream.umd")
9076
await report("stream.esm")
91-
92-
if (process.argv.includes("--save", 2)) await saveToReadme(mithrilSize)
9377
}
9478

9579
main()

0 commit comments

Comments
 (0)