Skip to content

docs: add advisor implementation plans from codebase audit - #628

Merged
antfu merged 1 commit into
unjs:mainfrom
antfubot:docs/advisor-plans
Oct 27, 2026
Merged

antfu merged 1 commit into
unjs:mainfrom
antfubot:docs/advisor-plans

Conversation

@antfubot

@antfubot antfubot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds plans/ — ten self-contained implementation plans from a read-only audit of src/ at v3.5.0 (1ea89aa), plus an index (plans/README.md) with execution order, dependencies, open investigation items, and findings considered and rejected.

No source, test, or config files are changed; this PR only proposes work.

Why

The adapters drift: the last six fix commits (#610 #617 #619 #621 #623 #626) each landed on one or two adapters, and the test harness does not catch the siblings that were left behind. Several of the bugs below are literally "the fix shipped for webpack but not rspack/esbuild/farm".

What the plans cover

Plan Outcome
001 pnpm test works cold (build-first), fixture script cleans/parallelises, webpack/rspack integration tests reject on stats.hasErrors(), loader filter tests actually filter
002 rspack loaders become raw (binary pass-through, parity with #623); rspack buildEnd moves to processAssets (parity with #619)
003 webpack: a throwing resolveId becomes a build error instead of an unhandled rejection; emitFile(Uint8Array) emits the exact byte range
004 esbuild/Bun: '' results honoured, disk read only after the id filter, filters normalised once, per-call watch files, dead sourcemap branch removed, Bun no longer crashes on transformInclude without transform
005 Farm: load→null no longer throws, transform→string is applied, resolveId gets undefined importer / real isEntry, sideEffects parity
006 relative id globs match when the cwd contains ()[]{}; mergeSourceMaps handles a transformed { mappings: '' }; direct tests for src/utils
007 real-bundler tests for watchChange, buildEnd/emitFile on rspack/esbuild/bun, fixture sourcemaps
008 remove write-only __unpluginMeta/__vfsModules, unused Farm helpers; move shared sourcemap helpers out of esbuild/utils
009 share the webpack/rspack hook-invocation bodies through utils/webpack-like.ts
010 AGENTS.md with the adapter-parity checklist and build-first rule; fix stale docs tables/examples

Each plan has inlined code excerpts, exact verification commands, scope boundaries, done criteria, and STOP conditions, written so an executor with no context from the audit can run it.

Caveat

The audit environment had no node_modules, so nothing was executed — every finding is from reading the cited code. Each plan's first step is a failing test so the executor confirms the bug before changing anything.


Created with the help of an agent.

Summary by CodeRabbit

  • Documentation
    • Added an index and ten implementation plans covering test coverage, bundler adapter behavior, shared utilities, code cleanup, and contributor guidance.
    • These documents outline proposed work and verification steps; they do not implement the described changes.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request adds an index and ten plans for proposed repository work. The plans cover testing, bundler adapters, utilities, cleanup, and documentation. They specify implementation steps and verification criteria; they do not implement the planned changes.

Changes: Maintenance planning

Layer / File(s) Summary
Plan index and sequencing
plans/README.md
Adds a status index for plans 001–010, with dependencies, sequencing notes, open investigations, and audit scope.
Test harness and lifecycle coverage
plans/001-test-harness.md, plans/007-lifecycle-hook-coverage.md
Plans fixture test-harness updates and added lifecycle-hook and sourcemap coverage.
Bundler adapter contracts and shared logic
plans/002-rspack-loader-parity.md, plans/003-webpack-resolveid-errors-and-emitfile-bytes.md, plans/005-farm-hook-contract.md, plans/009-webpack-rspack-shared-core.md
Plans webpack and rspack parity and shared logic, webpack resolver and byte-handling fixes, and Farm hook-contract changes.
Utility, hot-path, and cleanup plans
plans/004-esbuild-bun-hot-path.md, plans/006-filter-cwd-escaping-and-utils-tests.md, plans/008-dead-code-removal.md
Plans esbuild and Bun hot-path changes, filter and sourcemap utility work, and dead-code removal with sourcemap helper relocation.
Contributor and guide documentation plan
plans/010-agents-md-and-docs-fixes.md
Plans contributor guidance and corrections to the user guide and related documentation.

Priority: Not assessed

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Possibly related PRs

  • unjs/unplugin#621: Plan 009 covers shared webpack and rspack hook-filter memoization, and Plan 004 describes related normalization work for esbuild and Bun.
  • unjs/unplugin#611: Plan 004 specifies esbuild changes for preserving empty-string results.
  • unjs/unplugin#619: Plan 002 uses the webpack buildEnd timing as a reference for its proposed rspack change.

Suggested reviewers: antfu, sxzz

Merge Risk: Moderate · up to 4121d

These plans may direct contributors toward incorrect changes or reject correct work. Resolve the conflicting instructions and checks before using the plans for implementation.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants