Use esbuild instead of Parcel. (#131)

This replaces Parcel with [esbuild][].

esbuild has a number of advantages over Parcel:

* It is much, much, *much* faster. A Parcel build takes several seconds on my system, while esbuild takes 60-70 _milliseconds_.
* Parcel hard-crashes when I switch branches on Windows, esbuild doesn't.

The one disadvantage is that, as far as I can tell, esbuild doesn't support any kind of auto-reloading in the browser when you change things. IMO this isn't that big a deal and the benefits outweigh this minor inconvenience (and anyways, auto-reload has historically backfired so many times that I usually have been manually reloading the page whenever I make changes).

[esbuild]: https://esbuild.github.io/
pull/133/head
Atul Varma 2021-05-28 07:34:17 -04:00 zatwierdzone przez GitHub
rodzic f3ab28f70d
commit d13c892f3d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
7 zmienionych plików z 188 dodań i 16085 usunięć

4
.gitignore vendored
Wyświetl plik

@ -1,7 +1,7 @@
node_modules node_modules
dist
dist-watch
.cache .cache
lib/_svg-vocabulary-pretty-printed.json lib/_svg-vocabulary-pretty-printed.json
lib/_svg-vocabulary.ts lib/_svg-vocabulary.ts
lib/**/*.avsc.ts lib/**/*.avsc.ts
dist/browser-main.js
dist/browser-main.js.map

Wyświetl plik

Wyświetl plik

@ -174,4 +174,4 @@ ul.navbar li:last-child {
<p>Alas, you need JavaScript to peruse this page.</p> <p>Alas, you need JavaScript to peruse this page.</p>
</noscript> </noscript>
<div id="app" className="app"></div> <div id="app" className="app"></div>
<script src="lib/browser-main.tsx"></script> <script src="browser-main.js"></script>

Wyświetl plik

@ -0,0 +1,5 @@
import * as buf from "buffer/";
export let process = { env: {} };
export let Buffer = buf.Buffer;

16239
package-lock.json wygenerowano

Plik diff jest za duży Load Diff

Wyświetl plik

@ -10,16 +10,18 @@
"typecheck": "tsc --noemit", "typecheck": "tsc --noemit",
"test:watch": "jest --watch", "test:watch": "jest --watch",
"test": "jest", "test": "jest",
"esbuild": "esbuild lib/browser-main.tsx --bundle --outfile=dist/browser-main.js --external:stylus --define:global=window --inject:./lib/esbuild-shims.js --target=es2018 --sourcemap",
"esbuild:build": "npm run esbuild -- --define:process.env.NODE_ENV=\\\"production\\\" --minify",
"esbuild:serve": "npm run esbuild -- --servedir=dist --serve=1234",
"build-prereqs": "node build-vocabulary.js && node build-avro-typescript.js", "build-prereqs": "node build-vocabulary.js && node build-avro-typescript.js",
"build": "npm run build-prereqs && rimraf dist && parcel build index.html -d dist --public-url .", "build": "npm run build-prereqs && npm run esbuild:build",
"watch": "npm run build-prereqs && parcel index.html -d dist-watch" "watch": "npm run build-prereqs && npm run esbuild:serve"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"jest": { "jest": {
"testPathIgnorePatterns": [ "testPathIgnorePatterns": [
"dist", "dist",
"dist-watch",
".cache" ".cache"
] ]
}, },
@ -37,24 +39,20 @@
"avro-js": "^1.10.2", "avro-js": "^1.10.2",
"avro-typescript": "^1.1.0", "avro-typescript": "^1.1.0",
"babel-jest": "^26.6.3", "babel-jest": "^26.6.3",
"buffer": "^6.0.3",
"cheerio": "^1.0.0-rc.5", "cheerio": "^1.0.0-rc.5",
"classnames": "^2.3.1", "classnames": "^2.3.1",
"colorspaces": "^0.1.5", "colorspaces": "^0.1.5",
"esbuild": "^0.12.5",
"gh-pages": "^3.1.0", "gh-pages": "^3.1.0",
"hsluv": "^0.1.0", "hsluv": "^0.1.0",
"jest": "^26.6.3", "jest": "^26.6.3",
"parcel-bundler": "^1.12.4",
"parcel-plugin-static-files-copy": "^2.6.0",
"prettier": "^2.2.1", "prettier": "^2.2.1",
"react": "^17.0.1", "react": "^17.0.1",
"react-dom": "^17.0.1", "react-dom": "^17.0.1",
"toml": "^3.0.0", "toml": "^3.0.0",
"typescript": "^4.1.3" "typescript": "^4.1.3",
"util": "^0.12.3"
}, },
"browserslist": [ "devDependencies": {}
"since 2017-06"
],
"devDependencies": {
"rimraf": "^3.0.2"
}
} }

Wyświetl plik

@ -1,7 +1,6 @@
{ {
"exclude": [ "exclude": [
"dist", "dist",
"dist-watch",
"vendor/**/*.js", "vendor/**/*.js",
], ],
"compilerOptions": { "compilerOptions": {