Skip to content

fix: stabilize scoped React rendering across runtimes - #29

Merged
Lojhan merged 3 commits into
mainfrom
fix/scoped-runtime-consistency
Oct 22, 2026
Merged

Lojhan merged 3 commits into
mainfrom
fix/scoped-runtime-consistency

Conversation

@Lojhan

@Lojhan Lojhan commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Use shared scoped registries and testing helpers, load React DOM after environment setup, and preserve live hook results and primitive props. Require the published @pokujs/dom ^1.3.2 helpers and keep DOM as a production dependency. Run the jsdom suite in separate processes so React 18 does not reuse its cached happy-dom document.

Validated locally: typecheck, build, format checks, and the React 18 regression. CI covers Node 20/22/24, Bun, Deno, React 18/19, build, lint, and CodeQL.

The DOM dependency is released: https://github.com/pokujs/dom/releases/tag/dom-v1.3.2.

Comment thread src/react-testing.ts
Comment on lines +30 to +35
// Lazily load `react-dom/client` on first `render()` call rather than at module
// import time. If a user imports `reactTestingPlugin` from the `@pokujs/react`
// barrel inside `poku.config.js` under `isolation: 'none'`, the config module is
// evaluated before `plugin.setup()` installs `window` and `document`. Eagerly
// importing `react-dom/client` before `window` exists causes React DOM to cache
// `canUseDOM = false` and permanently disable its synthetic event system.

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.

👀

@Lojhan
Lojhan marked this pull request as ready for review October 22, 2026 17:27
@Lojhan
Lojhan merged commit 8fea107 into main Oct 22, 2026
15 checks passed
@Lojhan
Lojhan deleted the fix/scoped-runtime-consistency branch October 22, 2026 17:28
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