Fixed stale toggled state in react useDelayedToggleState, migrated to oxfmt/oxlint, added testcases.#24
Merged
Merged
Conversation
There was a problem hiding this comment.
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
useDelayedToggleStateimplementation and adjusteduseMediaQuerysubscription/snapshot logic. - Migrated tests in
core,query, andform-datafromnode:test/assertto 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.
command to pnpm exec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.