Repository navigation
test: import the ParserOptions type the SyntaxTree tests use - #22875
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Change: Other Merge Risk: ⚪ Minimal · up to
|
Types CoverageCoverage after merging test/parser-options-typedef into main will be
Coverage Report |
|
This PR is packaged and the instant preview of its latest commit is available. Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@22875
yarn add -D webpack@https://pkg.pr.new/webpack@22875
pnpm add -D webpack@https://pkg.pr.new/webpack@22875 |
Generated code sizeComparing base (
Read No asset changed size. No runtime gained or lost a runtime module. Built |
Same change as #22875; main's lint:types-test fails without it. Claude-Session: https://claude.ai/code/session_01GVKiUEUTFEzHrHQoE1ryyx
Ported from #22875, which fixes the `lint` failure on `main`. Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD
Ported from #22875, which fixes the `lint` failure on `main`. Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD
Merging this PR will degrade performance by 45.01%2 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
* test: cover declared chunk hash dependencies Cases for a chunk naming another chunk's file: a runtime chunk renamed by the compilation hash, a plugin declaring the dependency, the hashing order and the warnings for dependencies that cannot be honored. * feat: add compilation.hooks.chunkHashDependencies A chunk declares the chunks whose hashes its output reads. createHash hashes them first, in a shared order RuntimeTemplate reads too, and JavascriptModulesPlugin mixes their hashes into the chunk's. The ESM and CommonJS chunk formats declare what their startup imports or requires. * chore: add changeset for chunkHashDependencies * chore: regenerate types for chunkHashDependencies * refactor: share one chunk hash order and cover other chunk kinds Positions run across the hashing rounds, so RuntimeTemplate compares them instead of classifying rounds itself; the walk positions chunks as it goes and JavascriptModulesPlugin mixes dependency hashes in one tap. A watch case covers HTML, CSS and worker chunks naming other chunks' files. * style: format chunk hash order loop * chore: restore schema key order * perf: look up chunk hash rounds once per chunk Recomputing the round per dependency edge walks the chunk's groups in canBeInitial; a map filled while sorting chunks into rounds is cheaper. * test: load fs as an ESM external in the chunk kinds case node-commonjs externals import createRequire, which Node 10 lacks. * chore: drop a ChunkGraph cast main's narrower types made redundant Claude-Session: https://claude.ai/code/session_01GVKiUEUTFEzHrHQoE1ryyx * test: import the ParserOptions type the SyntaxTree tests use Same change as #22875; main's lint:types-test fails without it. Claude-Session: https://claude.ai/code/session_01GVKiUEUTFEzHrHQoE1ryyx
….length` (#22871) * fix(minify): read a local function handed the global object or a built-in Its parameter stands for what it is handed, so `patch(Array)` writing `C.prototype` or `patch(globalThis)` writing `g.Number` counts, while a helper that only reads, as `isGlobal(globalThis)`, still folds. Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD * feat(minify): read `arguments[i]` as its parameter without `reduce_vars`, and `[-0]` as `[0]` Where nothing writes the parameter or the `arguments` object, as swc does; closes swc's `12209` and `arguments-canonical-index` gaps. Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD * feat(minify): drop unread call arguments and fold `Object.keys`, `.length` and `Array(-0)` Trim arguments past a known function's or constructor's parameters, and write `0` for one an unused parameter takes, where terser leaves them; fold `Object.keys` without `reduce_vars` once the probe finds no write of `Object`, `Math` calls of another's result, and a known function's `length` under `unsafe`. Closes eleven of swc's gaps and two of oxc's. Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD * fix(minify): read a parameter as the object handed it, whatever its name, and keep `Array(-0)` where `Array` is written A function handed a second, different object counts as patching it. Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD * fix(minify): resolve no callee or global write where the program reads `eval` An `eval` may write any binding unseen, as swc's `issue_11684_nested_eval_preserves_constructor_arguments` does. Retire the twelve terser cases the trimmed arguments closed. Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD * perf(minify): release the probe's function and name tables once a program is compressed Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD * test: import the ParserOptions type the SyntaxTree tests use Ported from #22875, which fixes the `lint` failure on `main`. Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD * fix(minify): follow a name set to a local function when it is handed a global `const alias = patch; alias(Array)` no longer lets a prototype patch go unseen. Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD
Summary
#22815 added a
/** @type {ParserOptions} */intest/unitCases/javascript/parser.unittest.jswithout importing the type, solint(lint:types-test) fails onmainand on every PR:This adds the missing typedef next to the file's other imports from
syntax-parser.yarn lintpasses with it.What kind of change does this PR introduce?
test
Did you add tests for your changes?
No, it is a type import in an existing test file.
Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
Claude Code found the failure while linting another change and wrote the one-line fix.
Generated by Claude Code
Summary by CodeRabbit