Skip to content

🧹 chore: remove dead code and stale api-extractor report - #13643

Merged
bluebill1049 merged 1 commit into
react-hook-form:masterfrom
saulo-silva:remove-dead-code-and-stale-api-report
Aug 7, 2026
Merged

🧹 chore: remove dead code and stale api-extractor report#13643
bluebill1049 merged 1 commit into
react-hook-form:masterfrom
saulo-silva:remove-dead-code-and-stale-api-report

Conversation

@saulo-silva

Copy link
Copy Markdown
Contributor

Proposed Changes

This PR removes two dead internal modules and a stale API report file, and aligns the api-extractor config with the report it actually generates.

Dead code (only referenced by their own test files):

Both modules are already tree-shaken from the published bundle, so there is no runtime or bundle-size impact — this is purely source hygiene (−107 lines of unused code and tests).

Stale API report:

  • Deleted reports/api-extractor.md — api-extractor enforces the .api.md extension, so the report is actually generated and validated as reports/api-extractor.md.api.md. The old file stopped being rewritten (last touched Mar 2025) and has drifted ~500 lines behind: it is missing Watch, FormStateSubscribe, setValues, the current Controller signature, and more, while still being tracked in git as if it were the public API report.
  • Set reportFileName to api-extractor.api.md in api-extractor.json (matching the extension requirement documented in the config itself) and renamed the generated report accordingly: reports/api-extractor.md.api.mdreports/api-extractor.api.md. Re-running pnpm api-extractor:build reproduces the renamed file with no diff, and pnpm api-extractor:ci passes.

Type of change

  • None of the listed options — internal cleanup with no runtime, public API, or bundle changes

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes (pnpm test: 118 suites / 1215 tests, pnpm test:type, pnpm lint, pnpm build, pnpm api-extractor:ci)

@saulo-silva
saulo-silva force-pushed the remove-dead-code-and-stale-api-report branch from c82467a to 09d8390 Compare August 6, 2026 14:56
@saulo-silva

Copy link
Copy Markdown
Contributor Author

Heads-up on the failing playwright-run check: the useFieldArrayUnregister.spec.ts failure appears to be a pre-existing flake on master, unrelated to this PR (which only removes files with no production importers — dist/index.esm.mjs builds byte-identical to master's).

Evidence from local runs of pnpm e2e useFieldArrayUnregister --repeat-each=3:

  • this branch: 3/3 failed
  • master (9fde5f3): one invocation passed 3/3, two subsequent invocations failed — same assertion as CI (the dirtyFields poll after move(4, 2), missing conditional: true at index 2)

The Playwright page snapshot at the failure point shows the conditional input at index 2 is mounted and touchedFields moved { name, conditional } to index 2 correctly — but dirtyFields lost the conditional flag. So it looks like a timing race between the move() dirty-state recomputation and the conditional field's unregister({ keepDirty: true }) / re-register effect cycle, rather than anything in this diff.

I've re-pushed to retrigger CI. Happy to open a separate issue with the full repro details if that's useful.

@bluebill1049 bluebill1049 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙏

Comment thread src/__tests__/logic/getNodeParentName.test.ts
Comment thread src/__tests__/utils/deepMerge.test.ts
@bluebill1049
bluebill1049 merged commit 6a77f43 into react-hook-form:master Aug 7, 2026
6 checks passed
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.

issue: Populating form with reset and keepDefaultValues as true breaks fieldarray actions

2 participants