build: upgrade esbuild to 0.28 and tsx to 4 - #1151
Open
nealrichardson wants to merge 2 commits into
Open
nealrichardson wants to merge 2 commits into
nealrichardson wants to merge 2 commits into
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
esbuild 0.16 -> 0.28: - `watch`/`onRebuild` were removed in 0.17, so dev mode now uses context().watch() with an onEnd logger plugin. - Since 0.18 esbuild no longer takes `target` from tsconfig, so without an explicit target the bundles would be un-lowered esnext. Set `target: 'node22'`, the Node in VS Code 1.101 (the decided engines.vscode floor). - esbuild is now a `dependency` of packages/build (the library that imports it) and is no longer declared in apps/vscode and apps/lsp, which never import it. esbuild-plugin-copy 2.1.1. tsx 3 / 4.7 -> ^4.23.15 everywhere. tsx and packages/build now share a single esbuild copy, and the deprecated @esbuild-kit/* loaders are gone. Also drop the apps/lsp asset entry for ./src/run.js, which doesn't exist. Fixes quarto-dev#1140 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
esbuild-plugin-copy has been unmaintained since 2023 and pulls in old chokidar/globby, whose picomatch/braces/micromatch versions have advisories. With esbuild now a runtime dependency of packages/build (and @quarto/_json-validator depending on build), Snyk flags that chain. The replacement copies the same files on every onEnd using the built-in fs.promises.glob, so it adds no dependencies. The copied LSP assets are byte-identical to the plugin's output. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
nealrichardson
force-pushed
the
build/esbuild-0.28-tsx-4
branch
from
September 25, 2026 22:36
4002160 to
be93a5c
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 0.3 of the dependency upgrade.
Changes
esbuild 0.16.17 → 0.28.2 (
packages/build/src/index.ts)watch/onRebuild(it rejects evenwatch: false), so dev mode now usescontext()+ctx.watch(), with a smallonEndplugin that logs[watch] build finished/failed. Non-dev builds still callbuild(). Two behavior changes inyarn dev-vscode:out/main.jsuntil the error is fixed.target: 'node22': since 0.18, esbuild no longer readstargetfromtsconfig.json. Without an explicit value, the bundles would be un-loweredesnext.node22is the Node in VS Code 1.101, theengines.vscodefloor we decided on (the manifest bump is still to come). The previous effective targets were ES2019–ES2021, taken per file from tsconfig. All of them are below Node 22, so this doesn't lower the syntax floor for any host we support.dependencyofpackages/build, which is the only workspace that imports it. I removed it fromapps/vscodeandapps/lsp, which don't import it.esbuild-plugin-copyand replaced it with a small inlinecopy-assetsplugin, using the built-infs.promises.globand no new dependencies. The package has been unmaintained since 2023, and its oldchokidar/globbychain carriespicomatch/braces/micromatchadvisories. Once esbuild became a runtime dependency ofpackages/build, Snyk flagged that chain, because@quarto/_json-validatordepends onbuild. The copied LSP assets are byte-identical to what the plugin produced.tsx →
^4.23.15everywhere (it was 3.12 inapps/vscode/apps/lspand 4.7 in the packages). tsx andpackages/buildnow resolve one shared esbuild 0.28 copy, and the deprecated@esbuild-kit/*loaders are gone from the lockfile. The only other esbuild left is 0.15, from vite 3.apps/lsp/build.ts: removed the asset entry for./src/run.js, which doesn't exist, so it never copied anything. Fixes #1140.Verification
yarn build --force: 14/14 tasks.main:out/main.js: 4,568,904 → 4,565,143 bytesout/lsp/lsp.js: 3,282,709 → 3,269,173 bytesout/lsp/: identical file list (25 files, including the sqlite.wasmandresources/**)yarn audit --groups dependencies: no advisories reachable throughbuildlsp.js.map)node --checkpasses on both bundles under Node 22.15.1 (the VS Code 1.101 floor).tsx build.ts dev): both watchers start. An edit triggers a rebuild, and a syntax error prints once and logs[watch] build failed. After the fix it rebuilds andout/main.jscomes back.yarn build-lang: no diff undersyntaxes/. This covers tsx 4's CJSrequire()of.ts.yarn test-packages: 8/8 tasks.yarn test-vscode(VS Code 1.109, Quarto CLI on PATH):Workspace Symbols - R Projectfails intermittently. I reproduced that onmain(1 of 3 full runs), so it's pre-existing and unrelated.yarn lint --continue: unchanged frommain(the 6 pre-existingquarto-lspno-unused-varserrors).🤖 Generated with Claude Code