Skip to content

Fixed stale toggled state in react useDelayedToggleState, migrated to oxfmt/oxlint, added testcases.#24

Merged
Curstantine merged 21 commits into
masterfrom
react-util-revamp
Feb 4, 2026
Merged

Fixed stale toggled state in react useDelayedToggleState, migrated to oxfmt/oxlint, added testcases.#24
Curstantine merged 21 commits into
masterfrom
react-util-revamp

Conversation

@Curstantine
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 3, 2026 18:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a stale-state bug in useDelayedToggleState, migrates repo tooling from ESLint/dprint to oxlint/oxfmt, and standardizes the monorepo test runner on Vitest (including Playwright-powered browser tests for the React package).

Changes:

  • Updated useDelayedToggleState implementation and adjusted useMediaQuery subscription/snapshot logic.
  • Migrated tests in core, query, and form-data from node:test/assert to Vitest; added browser-based hook tests for @jabascript/react.
  • Replaced ESLint/dprint setup with oxlint/oxfmt config, updated scripts, and introduced Nix flake dev shell files.

Reviewed changes

Copilot reviewed 26 out of 32 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
vitest.config.js Adds root Vitest configuration for multi-project execution.
pnpm-workspace.yaml Normalizes workspace package indentation.
pnpm-lock.yaml Updates lockfile for new tooling/test dependencies (oxlint/oxfmt/vitest/playwright/etc).
packages/react/vitest.config.js Adds Vitest browser (Playwright) configuration for React package tests.
packages/react/tsconfig.test.json Adds a TS config for React tests (noEmit, includes tests).
packages/react/tests/client.test.jsx Adds browser tests for useDelayedToggleState and useMediaQuery.
packages/react/src/client.js Fixes stale state in useDelayedToggleState; refactors useMediaQuery.
packages/react/package.json Adds vitest/playwright tooling and test scripts for the React package.
packages/query/tests/index.test.js Migrates query tests from node:test to Vitest.
packages/query/package.json Switches query package test scripts to Vitest and adds Vitest devDependency.
packages/form-data/tests/index.test.js Migrates form-data tests from node:test to Vitest.
packages/form-data/src/index.js Minor expression/parentheses adjustments in parseFormData.
packages/form-data/package.json Switches form-data package test scripts to Vitest.
packages/core/tests/index.test.js Migrates core tests from node:test to Vitest (vi.fn, expect APIs).
packages/core/tests/enum.test.js Migrates enum tests from node:test to Vitest.
packages/core/package.json Switches core package test scripts to Vitest.
package.json Updates root scripts (vitest/oxlint/oxfmt) and devDependencies; updates pnpm metadata.
flake.nix Adds Nix dev shell including Node/corepack and Playwright browsers.
flake.lock Locks Nix inputs for the new flake.
eslint.config.js Removes ESLint flat config file as part of tool migration.
dprint.json Removes dprint config file as part of tool migration.
README.md Minor formatting adjustment to list indentation.
.zed/settings.json Replaces dprint-based formatting with oxlint/oxfmt LSP configuration for Zed.
.vscode/settings.json Minor formatting changes to VS Code settings arrays.
.oxlintrc.json Adds oxlint configuration file.
.oxfmtrc.json Adds oxfmt configuration file.
.gitignore Ignores .direnv/ for nix/direnv workflows.
.github/workflows/test.yml Keeps CI test job but reformats workflow YAML.
.github/workflows/release.yml Reformats workflow YAML for release pipeline.
.envrc Adds direnv entrypoint to use the flake (use_flake).
.changeset/lucky-seas-own.md Adds changeset for core/query/form-data dependency/test updates.
.changeset/goofy-pigs-marry.md Adds changeset for the React hook fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment thread .vscode/settings.json
Comment thread .github/workflows/test.yml Outdated
Comment thread packages/core/package.json
Comment thread packages/form-data/package.json
Comment thread packages/react/tests/client.test.jsx Outdated
Comment thread vitest.config.js
Comment thread flake.nix
Comment thread packages/react/src/client.js
Comment thread packages/react/tests/client.test.jsx Outdated
@Curstantine Curstantine merged commit 21a1c34 into master Feb 4, 2026
1 check passed
@Curstantine Curstantine deleted the react-util-revamp branch February 4, 2026 07:09
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