Repository navigation
chore(build): Replace es-check with an acorn-based script - #26321
Merged
Merged
Conversation
es-check only ever ran acorn.parse() on our build output, which a small script does too. The old per-package globs (`build/esm/*.js`) were not recursive and only covered ~560 of ~3100 built files; the script checks all of `build/`. Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
Contributor
size-limit report 📦Compared: 93a9591 (PR test merge using develop at 5808281) Against: 5808281 (develop) · base run #65971 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 4 not successful, 56 successful. See the run.
Successful checks
|
…eck-with-acorn-script # Conflicts: # packages/wasm/package.json
web-vitals 6 is inlined untranspiled. Its Array.prototype.at use is guarded since #26347, and its remaining ES2022 syntax (public instance class fields) runs on all supported browsers. Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
mydea
marked this pull request as ready for review
November 13, 2026 10:47
javascript-sdk-gitflow
Bot
requested review from
JPeer264,
chargome and
logaretm
November 13, 2026 10:47
logaretm
approved these changes
Nov 13, 2026
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.
Why: The way we use
es-check(no--checkFeatures, no browserslist), all it does is runacorn.parse(code, { ecmaVersion })on files from a glob.scripts/es-check.mjsdoes that in ~40 lines withacornandfs.globSync, and it drops one package (acorn,browserslistandfast-globare all still used elsewhere).The bigger fix is coverage. The old globs, like
./build/esm/*.js, weren't recursive. They checked about 560 of the roughly 3,100 built files (core: 58/436, node: 8/158, nextjs: 4/224). The script now checks every.js/.mjs/.cjsfile underbuild/(skippingnode_modules). Every file is parsed as a module, so we no longer need--moduleor separate cjs/esm calls. Hashbangs are allowed foraws-serverless's lambda extension.Remix exceptions:
build/esm/v3/client-bundle.js(the./v3/clientbrowser entry) inlinesweb-vitals@6untranspiled, so it is checked against es2022 instead. ItsArray.prototype.atuse is guarded since #26347, and its only ES2022 syntax is public instance class fields (Chrome 72 / Firefox 69 / Safari 14).build/v3-node.mjsis Node-only and uses top-level await, so it's also checked against es2022. To exclude the bundle from the es2020 pass, the script now accepts!globs.Why not
--checkFeatures: I ran it over all of the current build output. It matches on method names, so it gets both kinds of result wrong. Every OTelcontext.with()is reported asArray.prototype.with. Meanwhilearr.at(-1)isn't reported at all (I reproduced that with a two-line file).via @mydea.
--
View Session [Sentry]