chore: use Node 24 LTS for binary builds + explicit tree shaking#1018
Merged
Conversation
- Bump fossilize NODE_VERSION from '22' to 'lts' (resolves to Node 24) - Add explicit treeShaking: true to esbuild configs - Update esbuild target from node22 to node24 Results (linux-x64 with code cache): Binary size: 127 MiB → 125 MiB (-1.6%) JS bundle: 3.9 MiB → 3.7 MiB (-5%) --version: ~1.7s → ~1.0s (~41% faster) completion: ~0.3s → ~0.16s (~47% faster) Node 24 LTS (Krypton) has V8 12.x with faster compilation and better code cache utilization, explaining the startup improvement.
| sourcemap: true, | ||
| platform: "node", | ||
| target: "node22", | ||
| target: "node24", |
There was a problem hiding this comment.
Library bundle targets node24 but package engines allows Node 22
Setting target: "node24" in the npm library bundle (dist/index.cjs) tells esbuild to skip downleveling any syntax that Node 24 supports natively; if any such syntax is used in source or dependencies, it will be emitted verbatim and break consumers running Node 22 (permitted by engines.node >= 22.15).
Evidence
bundle.tsline 197 changestargetfrom"node22"to"node24"for the outputdist/index.cjs, which is the npm library entry point.package.jsonengines.noderemains">=22.15", explicitly allowing Node 22 consumers of the npm package.- esbuild's
targetdetermines which syntax transformations are skipped; anode24-only syntax feature in source or a bundled dep will pass through untransformed. - The binary build (
build.ts) also usesnode24but embeds its own Node 24 runtime (via fossilize), so that path is safe — the library bundle path is not. - The PR description acknowledges the binary embeds Node 24, but does not address this library-bundle target mismatch.
Suggested fix: Keep the library bundle target aligned with the minimum supported engine version so esbuild correctly downlevels any syntax gaps.
Suggested change
| target: "node24", | |
| target: "node22", |
Identified by Warden find-bugs · 89U-MM4
Contributor
Codecov Results 📊✅ Patch coverage is 100.00%. Project has 4286 uncovered lines. Generated by Codecov Action |
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.
Changes
NODE_VERSIONfrom"22"to"lts"(resolves to Node 24 Krypton)treeShaking: trueto bothbuild.tsandbundle.tsesbuild configstargetfromnode22tonode24Results (linux-x64 with code cache)
Note: Earlier measurements showed larger startup improvements but were affected by system load variance. Controlled re-measurement shows startup is comparable, with completions genuinely faster.
Note:
engines.nodein package.json stays at>=22.15— that's the minimum for the npm package (npx sentry). The binary embeds its own Node 24 runtime.