I wanted to use RegExp literals using the v flag, but esbuild was too old. Whee.
The build scripts are first moved over to TypeScript (.mts) so upgrading with esbuild is sane. VS Code wouldn't show errors for the previous .mjs files for me, at least. tsc will catch future type errors now. (I can split this out to a separate PR if you really want.)
esbuild is then moved forward one breaking release at a time, to make both authoring and reviewing easier.
esbuild v0.17 breaks our use of esbuild.build({ watch: true }), so that's all refactored to support the new context design and recommended logging setup. We now log our own summaries & errors, but esbuild can still do so with pnpm run build --summary. Care has been taken to prevent logs from separate builds from overlapping. (This delays builds slightly, esp. when --summary is passed, but it's worth it for useful output.) I'd really like to instruct esbuild to call a JavaScript callback whenever it logs. Related issues:
I wanted to use RegExp literals using the
v
flag, but esbuild was too old. Whee.The build scripts are first moved over to TypeScript (
.mts
) so upgrading with esbuild is sane. VS Code wouldn't show errors for the previous.mjs
files for me, at least.tsc
will catch future type errors now. (I can split this out to a separate PR if you really want.)esbuild is then moved forward one breaking release at a time, to make both authoring and reviewing easier.
esbuild v0.16 doesn't break us.
esbuild v0.17 breaks our use of
esbuild.build({ watch: true })
, so that's all refactored to support the newcontext
design and recommended logging setup. We now log our own summaries & errors, but esbuild can still do so withpnpm run build --summary
. Care has been taken to prevent logs from separate builds from overlapping. (This delays builds slightly, esp. when--summary
is passed, but it's worth it for useful output.) I'd really like to instruct esbuild to call a JavaScript callback whenever it logs. Related issues:esbuild v0.18 breaks our type signatures slightly.
esbuild v0.19 doesn't break us.
esbuild v0.20 doesn't break us.
esbuild v0.21 doesn't break us.
esbuild v0.22 breaks our use of
--platform=node
defaults, switching from--packages=bundle
to--packages=external
.esbuild v0.23 switches
--platform=node
defaults back to--packages=bundle
, but I kept our explicit declaration.Each commit passed
pnpm install && pnpm run lint && pnpm run lint-styles && pnpm run testTsc && pnpm run build --dev
on my machine.https://github.com/Vendicated/Vencord/pull/2446 also upgrades esbuild to
^0.21.5
, but the output handling is less robust and I generally think the approach here is cleaner.