Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci_framework-majors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ jobs:
@types/react-dom@${{ matrix.react-major }}

- name: 🔬 React ${{ matrix.react-major }}
run: npm test
run: npm test
37 changes: 14 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,56 @@

## [1.5.1](https://github.com/pokujs/react/compare/react-v1.5.0...react-v1.5.1) (2026-04-22)


### Bug Fixes

* use --preload for Bun instead of --import ([#22](https://github.com/pokujs/react/issues/22)) ([bd4a8dc](https://github.com/pokujs/react/commit/bd4a8dc0babcb711982da1fed58769fa20009f10))
- use --preload for Bun instead of --import ([#22](https://github.com/pokujs/react/issues/22)) ([bd4a8dc](https://github.com/pokujs/react/commit/bd4a8dc0babcb711982da1fed58769fa20009f10))

## [1.5.0](https://github.com/pokujs/react/compare/react-v1.4.0...react-v1.5.0) (2026-04-20)


### Features

* add concurrent scope isolation ([#19](https://github.com/pokujs/react/issues/19)) ([f8d7370](https://github.com/pokujs/react/commit/f8d73708d8adf8d32ec43d9eb94e54b43e969763))
- add concurrent scope isolation ([#19](https://github.com/pokujs/react/issues/19)) ([f8d7370](https://github.com/pokujs/react/commit/f8d73708d8adf8d32ec43d9eb94e54b43e969763))

## [1.4.0](https://github.com/pokujs/react/compare/react-v1.3.0...react-v1.4.0) (2026-04-05)


### Features

* extract shared DOM/testing core to @pokujs/dom + benchmark suite ([#14](https://github.com/pokujs/react/issues/14)) ([cc60962](https://github.com/pokujs/react/commit/cc6096274a4b736d24031e5523668cf8320f956e))
* optimize react testing runtime and add prettier ([#6](https://github.com/pokujs/react/issues/6)) ([424194b](https://github.com/pokujs/react/commit/424194b2c5bdc5f8c3d3c7a41bc91b50d51dd38c))
* refactor plugin internals and stabilize isolation:none ([#8](https://github.com/pokujs/react/issues/8)) ([cd2d93d](https://github.com/pokujs/react/commit/cd2d93d41f913c0a581663a8f9e261c2c6574f27))

- extract shared DOM/testing core to @pokujs/dom + benchmark suite ([#14](https://github.com/pokujs/react/issues/14)) ([cc60962](https://github.com/pokujs/react/commit/cc6096274a4b736d24031e5523668cf8320f956e))
- optimize react testing runtime and add prettier ([#6](https://github.com/pokujs/react/issues/6)) ([424194b](https://github.com/pokujs/react/commit/424194b2c5bdc5f8c3d3c7a41bc91b50d51dd38c))
- refactor plugin internals and stabilize isolation:none ([#8](https://github.com/pokujs/react/issues/8)) ([cd2d93d](https://github.com/pokujs/react/commit/cd2d93d41f913c0a581663a8f9e261c2c6574f27))

### Bug Fixes

* add missing @pokujs/dom dependency and update to ^1.0.1 ([5b82a9a](https://github.com/pokujs/react/commit/5b82a9ab26cc187e6edd0a0d76d74acd01d6ba2a))
* add repository metadata required for npm provenance ([#4](https://github.com/pokujs/react/issues/4)) ([f20b16a](https://github.com/pokujs/react/commit/f20b16a9ab72bb957743c7739a926d0bfb851f68))
* clarify Deno compatibility guidance in README ([#2](https://github.com/pokujs/react/issues/2)) ([ee28792](https://github.com/pokujs/react/commit/ee28792965b9cc9dacc8bee2fc96a5f84088f2d1))
* update package repository URL ([#12](https://github.com/pokujs/react/issues/12)) ([3da8523](https://github.com/pokujs/react/commit/3da85234d70a7ec846a48ea7b066bf82e50763bb))

- add missing @pokujs/dom dependency and update to ^1.0.1 ([5b82a9a](https://github.com/pokujs/react/commit/5b82a9ab26cc187e6edd0a0d76d74acd01d6ba2a))
- add repository metadata required for npm provenance ([#4](https://github.com/pokujs/react/issues/4)) ([f20b16a](https://github.com/pokujs/react/commit/f20b16a9ab72bb957743c7739a926d0bfb851f68))
- clarify Deno compatibility guidance in README ([#2](https://github.com/pokujs/react/issues/2)) ([ee28792](https://github.com/pokujs/react/commit/ee28792965b9cc9dacc8bee2fc96a5f84088f2d1))
- update package repository URL ([#12](https://github.com/pokujs/react/issues/12)) ([3da8523](https://github.com/pokujs/react/commit/3da85234d70a7ec846a48ea7b066bf82e50763bb))

### Performance Improvements

* replace manual fireEvent loop with shared wrapFireEventMethods ([#16](https://github.com/pokujs/react/issues/16)) ([1f86e4d](https://github.com/pokujs/react/commit/1f86e4db4d0e20dab72149131ddbb248d628c57d))
- replace manual fireEvent loop with shared wrapFireEventMethods ([#16](https://github.com/pokujs/react/issues/16)) ([1f86e4d](https://github.com/pokujs/react/commit/1f86e4db4d0e20dab72149131ddbb248d628c57d))

## [1.3.0](https://github.com/pokujs/react/compare/v1.2.1...v1.3.0) (2026-04-05)


### Features

* extract shared DOM/testing core to @pokujs/dom + benchmark suite ([#14](https://github.com/pokujs/react/issues/14)) ([cc60962](https://github.com/pokujs/react/commit/cc6096274a4b736d24031e5523668cf8320f956e))

- extract shared DOM/testing core to @pokujs/dom + benchmark suite ([#14](https://github.com/pokujs/react/issues/14)) ([cc60962](https://github.com/pokujs/react/commit/cc6096274a4b736d24031e5523668cf8320f956e))

### Bug Fixes

* add missing @pokujs/dom dependency and update to ^1.0.1 ([5b82a9a](https://github.com/pokujs/react/commit/5b82a9ab26cc187e6edd0a0d76d74acd01d6ba2a))
- add missing @pokujs/dom dependency and update to ^1.0.1 ([5b82a9a](https://github.com/pokujs/react/commit/5b82a9ab26cc187e6edd0a0d76d74acd01d6ba2a))

## [1.2.1](https://github.com/pokujs/react/compare/v1.2.0...v1.2.1) (2026-04-03)


### Bug Fixes

* update package repository URL ([#12](https://github.com/pokujs/react/issues/12)) ([3da8523](https://github.com/pokujs/react/commit/3da85234d70a7ec846a48ea7b066bf82e50763bb))
- update package repository URL ([#12](https://github.com/pokujs/react/issues/12)) ([3da8523](https://github.com/pokujs/react/commit/3da85234d70a7ec846a48ea7b066bf82e50763bb))

## [1.2.0](https://github.com/Lojhan/poku-react-testing/compare/v1.1.0...v1.2.0) (2026-04-01)


### Features

* refactor plugin internals and stabilize isolation:none ([#8](https://github.com/Lojhan/poku-react-testing/issues/8)) ([cd2d93d](https://github.com/Lojhan/poku-react-testing/commit/cd2d93d41f913c0a581663a8f9e261c2c6574f27))
- refactor plugin internals and stabilize isolation:none ([#8](https://github.com/Lojhan/poku-react-testing/issues/8)) ([cd2d93d](https://github.com/Lojhan/poku-react-testing/commit/cd2d93d41f913c0a581663a8f9e261c2c6574f27))

## [1.1.0](https://github.com/Lojhan/poku-react-testing/compare/v1.0.1...v1.1.0) (2026-03-31)

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ npm i -D jsdom

```js
// poku.config.js
import { defineConfig } from 'poku';
import { reactTestingPlugin } from '@pokujs/react/plugin';
import { defineConfig } from 'poku';

export default defineConfig({
plugins: [
Expand All @@ -98,8 +98,8 @@ export default defineConfig({

```tsx
// tests/my-component.test.tsx
import { afterEach, assert, test } from 'poku';
import { cleanup, render, screen } from '@pokujs/react';
import { afterEach, assert, test } from 'poku';

afterEach(cleanup);

Expand All @@ -115,13 +115,13 @@ test('renders a heading', () => {

### Library Support

| Package | Supported range |
| ------- | :-------------: |
| `react` | `>=18` |
| `react-dom` | `>=18` |
| `poku` | `>=4.1.0` |
| `happy-dom` | `>=20` |
| `jsdom` | `>=22` |
| Package | Supported range |
| ----------- | :-------------: |
| `react` | `>=18` |
| `react-dom` | `>=18` |
| `poku` | `>=4.1.0` |
| `happy-dom` | `>=20` |
| `jsdom` | `>=22` |

### Isolation Support

Expand Down
49 changes: 25 additions & 24 deletions benchmark/REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@

## Environment

| Property | Value |
|---|---|
| Node.js | v22.5.1 |
| Platform | darwin 25.4.0 |
| CPU | Apple M3 Pro |
| CPU Cores | 12 |
| Total RAM | 18.0 GB |
| Runs/scenario | 7 (trim ±1) |
| Property | Value |
| ------------- | ------------- |
| Node.js | v22.5.1 |
| Platform | darwin 25.4.0 |
| CPU | Apple M3 Pro |
| CPU Cores | 12 |
| Total RAM | 18.0 GB |
| Runs/scenario | 7 (trim ±1) |

## Scenarios

Each scenario runs the **same 9 React tests** across 5 test files:

| Test File | Tests |
|---|---|
| 'counter.test.jsx' | 1 — stateful counter, event interaction |
| 'hooks.test.jsx' | 2 — custom hook harness + `renderHook` |
| 'lifecycle.test.jsx' | 2 — `rerender`, `unmount` + effect cleanup |
| 'context.test.jsx' | 1 — `createContext` + wrapper injection |
| 'concurrency.test.jsx' | 2 — React 19 `use()` + `useTransition` |
| Test File | Tests |
| ---------------------- | ------------------------------------------ |
| 'counter.test.jsx' | 1 — stateful counter, event interaction |
| 'hooks.test.jsx' | 2 — custom hook harness + `renderHook` |
| 'lifecycle.test.jsx' | 2 — `rerender`, `unmount` + effect cleanup |
| 'context.test.jsx' | 1 — `createContext` + wrapper injection |
| 'concurrency.test.jsx' | 2 — React 19 `use()` + `useTransition` |

### Frameworks under test

| Combination | DOM layer | Assertion style |
|---|---|---|
| poku + @pokujs/react | happy-dom | `assert.strictEqual` |
| poku + @pokujs/react | jsdom | `assert.strictEqual` |
| jest 29 + @testing-library/react | jsdom (jest-environment-jsdom) | `expect().toBe()` |
| vitest 3 + @testing-library/react | jsdom | `expect().toBe()` |
| vitest 3 + @testing-library/react | happy-dom | `expect().toBe()` |
| Combination | DOM layer | Assertion style |
| --------------------------------- | ------------------------------ | -------------------- |
| poku + @pokujs/react | happy-dom | `assert.strictEqual` |
| poku + @pokujs/react | jsdom | `assert.strictEqual` |
| jest 29 + @testing-library/react | jsdom (jest-environment-jsdom) | `expect().toBe()` |
| vitest 3 + @testing-library/react | jsdom | `expect().toBe()` |
| vitest 3 + @testing-library/react | happy-dom | `expect().toBe()` |

## Results

| Scenario | Mean | Min | Max | Stdev | Peak RSS | vs poku+happy-dom |
|--------------------|--------|--------|--------|--------|----------|-------------------|
| poku + happy-dom | 0.115s | 0.112s | 0.109s | 0.004s | 127.4 MB | *(baseline)* |
| ------------------ | ------ | ------ | ------ | ------ | -------- | ----------------- |
| poku + happy-dom | 0.115s | 0.112s | 0.109s | 0.004s | 127.4 MB | _(baseline)_ |
| poku + jsdom | 0.294s | 0.280s | 0.299s | 0.007s | 172.1 MB | +157% |
| jest + jsdom | 0.843s | 0.768s | 0.879s | 0.041s | 198.8 MB | +636% |
| vitest + jsdom | 0.968s | 0.951s | 0.986s | 0.011s | 147.8 MB | +745% |
Expand Down Expand Up @@ -101,6 +101,7 @@ processes with minimal bootstrap — means cold-start overhead is proportional t
files, not to the framework's own initialization.

**jest** carries the heaviest startup cost due to:

1. Babel transformation of every TSX file on first run (no persistent cache in this benchmark)
2. 'jest-worker' process pool initialisation
3. JSDOM environment setup per test file
Expand Down
2 changes: 1 addition & 1 deletion benchmark/poku.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'poku';
import { reactTestingPlugin } from '@pokujs/react/plugin';
import { defineConfig } from 'poku';

const dom = process.env.POKU_REACT_TEST_DOM;
if (!dom) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@
"failures": 0
}
]
}
}
12 changes: 2 additions & 10 deletions benchmark/run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ function runOnce(args, cwd, extraEnv = {}) {
}

const plainStdout = (result.stdout ?? '').replace(/\u001b\[[0-9;]*m/g, '');
const reportedDurationMatch = plainStdout.match(
/Duration\s+›\s+([\d.]+)ms/
);
const reportedDurationMatch = plainStdout.match(/Duration\s+›\s+([\d.]+)ms/);
const reportedDurationMs = reportedDurationMatch
? Number(reportedDurationMatch[1])
: null;
Expand All @@ -143,13 +141,7 @@ function runOnce(args, cwd, extraEnv = {}) {

// ─── scenario runner ────────────────────────────────────────────────────────

function benchmarkScenario(
label,
args,
cwd,
extraEnv = {},
options = {}
) {
function benchmarkScenario(label, args, cwd, extraEnv = {}, options = {}) {
process.stdout.write(` ${pad(label, 36)}`);

const measurements = [];
Expand Down
2 changes: 1 addition & 1 deletion benchmark/tests/poku/concurrency.test.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterEach, assert, test } from 'poku';
import { cleanup, fireEvent, render, screen } from '@pokujs/react';
import { afterEach, assert, test } from 'poku';
import React, { Suspense, use, useState, useTransition } from 'react';

afterEach(cleanup);
Expand Down
2 changes: 1 addition & 1 deletion benchmark/tests/poku/context.test.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterEach, assert, test } from 'poku';
import { cleanup, render, screen } from '@pokujs/react';
import { afterEach, assert, test } from 'poku';
import React, { createContext, useContext } from 'react';

afterEach(cleanup);
Expand Down
2 changes: 1 addition & 1 deletion benchmark/tests/poku/counter.test.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterEach, assert, test } from 'poku';
import { cleanup, fireEvent, render, screen } from '@pokujs/react';
import { afterEach, assert, test } from 'poku';
import React, { useState } from 'react';

afterEach(cleanup);
Expand Down
8 changes: 1 addition & 7 deletions benchmark/tests/poku/hooks.test.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { cleanup, fireEvent, render, renderHook, screen } from '@pokujs/react';
import { afterEach, assert, test } from 'poku';
import {
cleanup,
fireEvent,
render,
renderHook,
screen,
} from '@pokujs/react';
import React, { useMemo, useState } from 'react';

afterEach(cleanup);
Expand Down
2 changes: 1 addition & 1 deletion benchmark/tests/poku/lifecycle.test.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterEach, assert, test } from 'poku';
import { cleanup, render, screen } from '@pokujs/react';
import { afterEach, assert, test } from 'poku';
import React, { useEffect } from 'react';

afterEach(cleanup);
Expand Down
5 changes: 1 addition & 4 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"nodeModulesDir": "auto",
"imports": {
"@pokujs/dom": "npm:@pokujs/dom@^1.2.0"
}
"nodeModulesDir": "manual"
}
Loading
Loading