Skip to content

Migrate to Vitest and Oxc with compatible TypeScript builds - #212

Merged
jdalton merged 1 commit into
dperini:masterfrom
jdalton:chore/vitest-oxc-rolldown
Sep 6, 2026
Merged

Migrate to Vitest and Oxc with compatible TypeScript builds#212
jdalton merged 1 commit into
dperini:masterfrom
jdalton:chore/vitest-oxc-rolldown

Conversation

@jdalton

@jdalton jdalton commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Tooling

Use Vitest 5.0.0, Oxlint 1.81.0,
Oxfmt 0.66.0, Rolldown 1.2.7, and Vite 8.2.2. Replace ESLint and Terser;
the dependency tree has no esbuild. Keep one Node.js 26 CI job with pinned actions.

Move runtime sources, tooling, configuration, and tests to .mts. Runtime source
files are exact renames, without selector changes or wholesale reformatting.
Vitest runs the existing tests, restores the adapter loader spy, and rebuilds
generated files before watch-mode reruns.

Package compatibility

Rolldown's transform and minify APIs preserve the existing script wrappers.
npm pack and npm publish build the same nine published files, including
src/nwsapi.js, src/dom-selector.js, both extension modules, and
dist/nwsapi.min.js. The package stays CommonJS with the same main and deep-import
paths. TypeScript sources and build tools are not shipped. The lazy optional
css-tree peer remains external.

Syntax tests enforce the existing ES2015 core, ES5 extension, and ES2019 adapter
levels. The browser global and AMD factory remain supported. No npm release is
published by this PR.

Dependency tools

Require npm ^11.19.0 or ≥ 12.0.2, or pnpm ^11.25.0 or ≥ 12.3.4 for development. The npm 11 minimum includes the release-age fix backported from 12.0.2. New resolutions have a one-day release-age delay, dependency scripts need explicit approval, and non-registry subdependencies are restricted. pnpm also checks for trust downgrades. Both lockfiles are included; shared scripts and package tests work with either manager. CI uses npm 12.0.2. These are development requirements, not consumer runtime requirements.

Packed-consumer tests pass with npm 11.19.0 and 12.0.2 and pnpm 11.25.0 and 12.3.4. Older version boundaries are rejected.

Validation

  • All 32 Node tests pass, including build and syntax checks.
  • The packed file list and CommonJS entry points match; all 11 jsdom override tests pass.
  • All 41 WPT pages pass against both unminified and minified builds, with the existing 352 expected failures unchanged.
  • Lint, formatting, coverage, clean-build, and watch-mode rebuild checks pass.

Follows merged #167 and #211.

@jdalton
jdalton force-pushed the chore/vitest-oxc-rolldown branch from 92d8f18 to 7242c0a Compare September 6, 2026 01:50
@jdalton
jdalton force-pushed the chore/vitest-oxc-rolldown branch from 7242c0a to 5c9e373 Compare September 6, 2026 02:07
@jdalton
jdalton merged commit eaf4233 into dperini:master Sep 6, 2026
1 check passed
@jdalton
jdalton deleted the chore/vitest-oxc-rolldown branch September 6, 2026 02:20
This was referenced Sep 6, 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.

1 participant