Skip to content

[uplift] chore: Vitest 5 in Node and browsers, remove test cruft - #151

Merged
ryan-roemer merged 1 commit into
chore/2026-upliftfrom
chore/uplift-vitest
Nov 8, 2026
Merged

ryan-roemer merged 1 commit into
chore/2026-upliftfrom
chore/uplift-vitest

Conversation

@ryan-roemer

Copy link
Copy Markdown
Member

Part of #140 (Phase 3; includes Phase 2's cruft removal). Closes #12.

What

  • Vitest 5, two projects running the same specs:
    • node: specs that need a DOM opt into jsdom with @vitest-environment.
    • browser: browser mode in headless Chromium, Firefox and WebKit.
  • index.js and the vendored fast-deep-equal fixtures stay CommonJS. Node loads them natively; for the browser project, a small inline plugin in vitest.config.mts wraps module.exports.
  • React 19, Preact 11. The React tests render with react-dom (createRoot + flushSync) instead of react-test-renderer, which is deprecated in 19. The Preact tests use preact/compat's own render.
  • CI:
    • Installs browsers on ubuntu and adds v8 coverage (Node project) to the job summary. Coverage is reported, not gated.
    • Windows runs the Node project only.
    • A new job runs the Node project on React 18.0.0 + Preact 10.
  • Removed: builder, mocha, nyc, sinon, jsdom-global, Karma + launchers, webpack, Babel, core-js, assert, process, @testing-library/*, react-test-renderer, @types/node, the test-* and preversion scripts.
  • CONTRIBUTING's testing section is rewritten.

Not changed

  • Published files: pack:check passes against 3.2.2.
  • The comparison libraries (lodash, nano-equal, shallow-equal-fuzzy) and benchmark: only the benchmark uses them, and they go with its rewrite in Phase 4.

- Vitest 5 replaces mocha, nyc, Karma, webpack and Babel: one spec set (`test/*.spec.mjs`) in a `node` project (jsdom where needed) and a `browser` project (Chromium, Firefox, WebKit via Playwright)
- An inline plugin wraps the CommonJS `index.js` and vendored fixtures for the browser project; Node loads them natively
- React 19 + Preact 11; `react-test-renderer` and `@testing-library/*` replaced with `createRoot` + `flushSync` and Preact's `render`
- Removes `builder`, `nyc`, `sinon`, `jsdom-global`, `core-js`, `assert`, `process`, `@types/node`, Karma + launchers, `test/mocha.opts`, `preversion`
- CI: browsers on ubuntu, v8 coverage in the job summary, Windows runs the Node project, new job on React 18.0.0 + Preact 10
@changeset-bot

changeset-bot Bot commented Nov 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 264706d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ryan-roemer
ryan-roemer merged commit 3273c90 into chore/2026-uplift Nov 8, 2026
3 checks passed
@ryan-roemer
ryan-roemer deleted the chore/uplift-vitest branch November 8, 2026 06:29
@ryan-roemer ryan-roemer mentioned this pull request Nov 12, 2026
ryan-roemer added a commit that referenced this pull request Nov 12, 2026
Final merge of the 2026 uplift (#140) from the integration branch
`chore/2026-uplift`. Each change was reviewed in its own PR into that
branch; this PR brings them to `master`.

**No published change.** The package still ships the same `index.js`
(CommonJS, ES5, `module.exports = isEqual`) and the same `index.d.ts` as
3.2.2. `pack:check` checks this in CI: same file list and manifest
fields, identical `index.d.ts`, and `index.js` byte-identical to 3.2.2's
once both are minified, so only formatting and comments differ. No
changeset, so nothing to release.

## What changed

**Package manager and release** (Phase 1)
- #141: pnpm 12 (yarn 1 removed), Node 26 (`.nvmrc`), 7-day
`minimumReleaseAge`; fast-deep-equal's test cases copied into
`test/fixtures/` (git dependency dropped); Codecov and AppVeyor removed.
- 65c9439: changesets v3; `release.yml` publishes through npm trusted
publishing (OIDC) with provenance, using per-job permissions and the
`npm-publish` environment; canary releases to `next` via
`workflow_dispatch`. Tested with `3.2.3-canary-20261105232110`. npm
tokens are now disallowed and the `NPM_TOKEN` secret is deleted.

**Tooling** (Phase 2)
- #142–#144: oxlint + oxfmt replace ESLint 8 (the format and lint-fix
commits are listed in `.git-blame-ignore-revs`).
- #145: reverts #130's unreleased type guard to 3.2.2's `boolean`
signature.
- #146: `pack:check` compares the packed tarball with 3.2.2 and runs
publint, attw, and `require`/`import` in a clean install.
- #147, #148: TypeScript 7 + JSDoc types on `index.js` (`types:check`
fails if they drift from `index.d.ts`); type probe compiled against the
packed tarball.
- #149: `pnpm size` report in the CI job summary (replaces the
hand-edited badge).
- #154: `pnpm dep:check` (npm-check-updates, 7-day cooldown) and a
manual update routine; knip audit.
- 219a679: `AGENTS.md` + `CLAUDE.md` pointer.

**Tests and CI** (Phase 3)
- #151: Vitest 5 runs the specs in Node and in Chromium, Firefox and
WebKit (browser mode). This replaces mocha, nyc, Karma, webpack and
Babel. Tests use React 19 + Preact 11, and an extra CI job runs React
18.0.0 + Preact 10. v8 coverage goes in the CI job summary.
- #152: zizmor audits the workflows; third-party actions are pinned to
SHAs (pinact).

**Benchmarks** (Phase 4)
- #153: `pnpm bench` compares the working tree, the last release (3.2.2)
and fast-deep-equal for each fixture group, in a report-only CI job. The
old `benchmark/` setup and its dependencies are gone.

**Docs** (Phase 5)
- #155: README, CONTRIBUTING and PR template updated for the new
tooling, with Nearform naming (the repo stays
`FormidableLabs/react-fast-compare`).
- b882172: `AGENTS.md` and CI now point at `master`.

Scripts are now `check` (everything CI gates on), `format`, `test`, plus
`bench`, `size`, `dep:check` and `changeset`.

Closes #140.
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.

1 participant