Skip to content

Conversation

@silviuaavram
Copy link
Collaborator

@silviuaavram silviuaavram commented Dec 5, 2025

Pull Request

What

Update dependencies, improve infrastructure.

Why

Be up to date.
Close #1505

How

Update packages, run build and fix as needed.

Changes

Dependencies

  • Updated 16 dev dependencies to latest versions - security fixes and feature improvements
  • Downgraded Docusaurus to 3.3.2 - React 18 compatibility (3.9+ requires React 19)
  • Downgraded React to 18.3.1 - Docusaurus incompatibility with React 19
  • Updated kcd-scripts to 16.0.0 - breaking change: now outputs .cjs/.mjs extensions
  • Updated @testing-library/preact to 3.2.4 - latest testing utilities

Configuration

  • cypress/.eslintrc: Migrated from deprecated env: {"cypress/globals": true} to explicit globals - eslint-plugin-cypress 5.2.1 requirement
  • other/misc-tests/jest.config.js: Added customExportConditions: ['require', 'node'] - handle ESM-only @testing-library/preact
  • package.json: Updated main, module, react-native, and exports fields to match new file extensions - kcd-scripts 16.0.0 outputs .cjs.cjs, .esm.mjs
  • .github/workflows/validate.yml: Updated Node.js version - align with current LTS
  • tsconfig.preact.json: Updated configuration - preact compatibility

Tests

  • Updated React 18 component test expectations - React 18 passes empty object instead of undefined as second parameter
  • Fixed test assertions compatibility - align with updated testing library APIs
  • Changed toThrowError to toThrow - Jest best practices

Checklist

  • Documentation
  • Tests
  • TypeScript Types
  • Ready to be merged

@silviuaavram silviuaavram force-pushed the dev/update-dependencies-and-node branch from be9636a to dd02285 Compare December 7, 2025 13:10
@silviuaavram silviuaavram force-pushed the dev/update-dependencies-and-node branch from a2858ab to 8e555ef Compare January 31, 2026 07:31
Copilot AI review requested due to automatic review settings January 31, 2026 07:31
Copy link

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

Updates project dependencies and CI Node versions, along with a few test adjustments to align with newer React/Jest APIs.

Changes:

  • Bump runtime/dev dependencies (React 19, testing libs, build tooling, etc.).
  • Update GitHub Actions validation matrix to run on newer Node versions.
  • Adjust tests for updated Jest matcher APIs and React 18+/client rendering.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tsconfig.preact.json Adds a Preact-specific TS config with a dedicated outDir.
.github/workflows/validate.yml Expands CI Node matrix and bumps release job Node version.
package.json Updates many dependencies/devDependencies.
src/__tests__/downshift.misc.js Migrates legacy ReactDOM.render usage to react-dom/client and updates a test.
src/__tests__/downshift.get-menu-props.js Updates expectations around ref/refKey error logging behavior.
src/__tests__/downshift.get-button-props.js Adjusts expectation for function component call signature.
src/hooks/**/__tests__/* Replaces deprecated toThrowError usage with toThrow.
src/__tests__/__snapshots__/downshift.get-menu-props.js.snap Removes a snapshot that’s no longer asserted.

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

Comment on lines 17 to 20
strategy:
matrix:
node: [18, 20]
node: [20, 22, 24]
runs-on: ubuntu-latest
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

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

The workflow now runs on Node 24, but it still uses actions/setup-node@v1 (Node12-based, deprecated) which is unlikely to support Node 24 and can cause the job to fail. Update to a supported setup-node major version (and consider updating actions/checkout and codecov-action as well) so the matrix can actually run on 20/22/24 reliably.

Copilot uses AI. Check for mistakes.
Comment on lines 68 to +71
- name: ⎔ Setup node
uses: actions/setup-node@v1
with:
node-version: 16
node-version: 24
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

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

The release job pins node-version to 24 but still uses actions/setup-node@v1, which is deprecated and may not install/run Node 24 correctly. Bump setup-node to a supported major version to avoid release pipeline breakage.

Copilot uses AI. Check for mistakes.
Comment on lines +91 to +99
const container = document.createElement('div')
const root = ReactDOM.createRoot(container)

const dsRef = React.createRef()

// eslint-disable-next-line testing-library/no-unnecessary-act
act(() => {
root.render(<DownshiftWrapper ref={dsRef} />)
})
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

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

createRoot is created and rendered, but the root is never unmounted. This can leak mounted trees between tests and trigger act/cleanup warnings in newer React/testing-library versions. Add cleanup to unmount the root (and optionally remove the container) at the end of the test.

Copilot uses AI. Check for mistakes.
const downshiftInstance = dsRef.current

expect(downshiftInstance.items).toEqual([item])
downshiftInstance.clearItems()
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

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

downshiftInstance.clearItems() is very likely to trigger a state update; with createRoot/React 18+ this should be wrapped in act (or use testing-library utilities that already wrap updates) to avoid warnings and potential flakiness.

Suggested change
downshiftInstance.clearItems()
act(() => {
downshiftInstance.clearItems()
})

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

import Downshift from 'downshift' returns a commonJs module

2 participants