Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

docs: add implementation plans from a codebase audit - #370

Closed
antfubot wants to merge 4 commits into
Rich-Harris:masterfrom
antfubot:docs/improvement-plans
Closed

antfubot wants to merge 4 commits into
Rich-Harris:masterfrom
antfubot:docs/improvement-plans

Conversation

@antfubot

Copy link
Copy Markdown
Contributor

Adds a `plans/` directory with eleven self-contained implementation plans and an index, produced by a full read-only audit of the library at `abdc931` (v1.4.4). No source code changes.

Each plan is written so that someone with no prior context can execute it: current-state excerpts with `file:line`, ordered steps with a verification command each, scope boundaries, test plan, machine-checkable done criteria, and STOP conditions. `plans/README.md` holds the execution order, dependency notes, semver flags, a 2.0 decision list, and the findings that were considered and rejected (including the ones #363–#367 already fixed).

Bugs the plans address, all reproduced on the v1.4.4 build:

  • `update(undefined, 2, 'X')` on `'abcdef'` returns `"abX"` with a `null` sourcemap column; `remove(NaN, 2)` is a silent no-op; `appendLeft(100, 'X')` on `'abc'` lands at the start; `move` with an out-of-range start throws a raw `TypeError` (plans 001, 003).
  • `storeName: true` loses its `names` reference whenever the overwritten range was split earlier; `overwrite(…, true)` drops the name and never warns (plan 004).
  • `Bundle.addSource` mutates and retains the caller's object, so two bundles sharing a description leak separators and trims into each other (plan 005).
  • `indent({ exclude })` checks the wrong index for a moved edited chunk; `Bundle.toMagicString()` drops `indentExclusionRanges` and does not offset-shift the `replacesUntil`/`replacedFrom` fields from fix: don't treat chunks emptied by an overwrite as removed in replace #367, so `replaceAll` on a flattened bundle skips matches; `Bundle.indent` indents the `\r` of blank CRLF intro lines (plan 006).

The rest: `strict: true` (50 errors, several on the sites above), removal of the unused `DEBUG`/`Stats` timers, a `vitest bench` port covering the hires/Bundle/slice/storeName paths, an O(1) `slice` start lookup, allocation cleanup on the sourcemap path, deduplication of the two mapping walks plus README/JSDoc/type-export sync, and a spike for an in-repo reference edit model with seeded random edit sequences (the kind of fuzzing #364 and #366 did out of tree).

This PR was created with the help of an agent.

@antfu antfu closed this Oct 27, 2026
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