Skip to content

refactor(preact-query-devtools): replace deprecated 'JSX.CSSProperties' with 'CSSProperties' from Preact namespace#10622

Merged
sukvvon merged 2 commits intomainfrom
refactor/preact-query-devtools-use-preact-cssproperties
May 2, 2026
Merged

refactor(preact-query-devtools): replace deprecated 'JSX.CSSProperties' with 'CSSProperties' from Preact namespace#10622
sukvvon merged 2 commits intomainfrom
refactor/preact-query-devtools-use-preact-cssproperties

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented May 2, 2026

🎯 Changes

Replace deprecated JSX.CSSProperties with CSSProperties from the Preact namespace, as recommended by Preact's deprecation message:

@deprecated — Please import from the Preact namespace instead

The CSSProperties type is the same in both locations; this is a type-only refactor with no runtime or user-facing type behavior change.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Refactor
    • Updated type definitions in the preact-query-devtools package.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 2, 2026

📝 Walkthrough

Walkthrough

This PR updates the Preact Query devtools package to replace deprecated JSX.CSSProperties with CSSProperties imported directly from the Preact namespace, alongside a changeset entry documenting the patch release.

Changes

Type Import Refactor

Layer / File(s) Summary
Type Imports
packages/preact-query-devtools/src/PreactQueryDevtoolsPanel.tsx
CSSProperties and VNode are imported directly from preact instead of using JSX-scoped types.
Type Declaration
packages/preact-query-devtools/src/PreactQueryDevtoolsPanel.tsx
DevtoolsPanelOptions.style is updated from JSX.CSSProperties to CSSProperties.
Changelog
.changeset/cyan-words-hunt.md
Changeset entry documents the patch release and type deprecation fix.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Imports dance from JSX's old way,
To Preact's namespace, here they stay,
CSS Properties, fresh and bright,
Types aligned, all feels so right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing deprecated JSX.CSSProperties with CSSProperties from the Preact namespace, which aligns perfectly with the changeset and file modifications.
Description check ✅ Passed The description follows the required template structure with all key sections completed: Changes section explains the refactor with motivation, Checklist section has all items checked, and Release Impact section confirms changeset generation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/preact-query-devtools-use-preact-cssproperties

Review rate limit: 4/5 reviews remaining, refill in 12 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 2, 2026

View your CI Pipeline Execution ↗ for commit f07a0cf

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 1m 30s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-02 02:15:08 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

🚀 Changeset Version Preview

1 package(s) bumped directly, 23 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/preact-query-devtools 5.100.7 → 5.100.8 Changeset
@tanstack/angular-query-experimental 5.100.7 → 5.100.8 Dependent
@tanstack/angular-query-persist-client 5.100.7 → 5.100.8 Dependent
@tanstack/eslint-plugin-query 5.100.7 → 5.100.8 Dependent
@tanstack/preact-query 5.100.7 → 5.100.8 Dependent
@tanstack/preact-query-persist-client 5.100.7 → 5.100.8 Dependent
@tanstack/query-async-storage-persister 5.100.7 → 5.100.8 Dependent
@tanstack/query-broadcast-client-experimental 5.100.7 → 5.100.8 Dependent
@tanstack/query-core 5.100.7 → 5.100.8 Dependent
@tanstack/query-devtools 5.100.7 → 5.100.8 Dependent
@tanstack/query-persist-client-core 5.100.7 → 5.100.8 Dependent
@tanstack/query-sync-storage-persister 5.100.7 → 5.100.8 Dependent
@tanstack/react-query 5.100.7 → 5.100.8 Dependent
@tanstack/react-query-devtools 5.100.7 → 5.100.8 Dependent
@tanstack/react-query-next-experimental 5.100.7 → 5.100.8 Dependent
@tanstack/react-query-persist-client 5.100.7 → 5.100.8 Dependent
@tanstack/solid-query 5.100.7 → 5.100.8 Dependent
@tanstack/solid-query-devtools 5.100.7 → 5.100.8 Dependent
@tanstack/solid-query-persist-client 5.100.7 → 5.100.8 Dependent
@tanstack/svelte-query 6.1.26 → 6.1.27 Dependent
@tanstack/svelte-query-devtools 6.1.26 → 6.1.27 Dependent
@tanstack/svelte-query-persist-client 6.1.26 → 6.1.27 Dependent
@tanstack/vue-query 5.100.7 → 5.100.8 Dependent
@tanstack/vue-query-devtools 6.1.26 → 6.1.27 Dependent

@sukvvon sukvvon self-assigned this May 2, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 2, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10622

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10622

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10622

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10622

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10622

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10622

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10622

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10622

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10622

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10622

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10622

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10622

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10622

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10622

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10622

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10622

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10622

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10622

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10622

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10622

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10622

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10622

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10622

commit: f07a0cf

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

size-limit report 📦

Path Size
react full 12.1 KB (0%)
react minimal 9.07 KB (0%)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/preact-query-devtools/src/PreactQueryDevtoolsPanel.tsx`:
- Line 6: The import is pulling CSSProperties from 'preact' which is invalid;
update the import in PreachQueryDevtoolsPanel.tsx to import JSX instead of
CSSProperties (e.g., use import type { JSX, VNode } from 'preact') and then
change the usage at the style type (previously referenced as CSSProperties at
line 31) to JSX.CSSProperties; alternatively, if you intend to use the React
compatibility layer, import CSSProperties from 'preact/compat' and keep the
existing usage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7898191f-8050-4d33-b60f-8b149922cc53

📥 Commits

Reviewing files that changed from the base of the PR and between bf2546f and f07a0cf.

📒 Files selected for processing (2)
  • .changeset/cyan-words-hunt.md
  • packages/preact-query-devtools/src/PreactQueryDevtoolsPanel.tsx

import type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'
import type { QueryClient } from '@tanstack/preact-query'
import type { JSX, VNode } from 'preact'
import type { CSSProperties, VNode } from 'preact'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check Preact's type definitions for CSSProperties export

# Check if CSSProperties is exported from main preact module
rg -n "export.*CSSProperties" node_modules/preact/src/ node_modules/preact/*.d.ts 2>/dev/null || echo "Preact source not found in node_modules"

# Also check the package's type definition files
fd -e d.ts -e ts --max-depth 3 . node_modules/preact 2>/dev/null | head -20 | xargs rg -l "CSSProperties" 2>/dev/null || echo "No matches found"

Repository: TanStack/query

Length of output: 309


🌐 Web query:

Does Preact 10.28.0 export CSSProperties type from the main 'preact' module? Is JSX.CSSProperties deprecated in Preact?

💡 Result:

No, Preact 10.28.0 does not export a CSSProperties type from the main 'preact' module. The CSSProperties type is defined internally in Preact's type declaration files (e.g., src/jsx.d.ts and src/dom.d.ts) as an interface for style props, extending AllCSSProperties and DOMCSSProperties to support CSS properties, custom properties, strings, numbers, null, and undefined values. It is used in JSX namespace for typing the style attribute (style?: string | CSSProperties | undefined), but there is no explicit export statement for CSSProperties from the main 'preact' module or index.d.ts. There is no evidence that JSX.CSSProperties is deprecated in Preact. References to JSX.CSSProperties appear in user issues (e.g., importing from preact/compat), but Preact's official types use CSSProperties directly in the JSX namespace without a nested JSX.CSSProperties, and no deprecation notices exist in changelogs, releases, or documentation for version 10.28.0.

Citations:


🏁 Script executed:

cat -n packages/preact-query-devtools/src/PreactQueryDevtoolsPanel.tsx | head -40

Repository: TanStack/query

Length of output: 1644


🌐 Web query:

What is the correct import path for CSSProperties in Preact? How should style types be imported from Preact?

💡 Result:

There is no separate "CSSProperties" type that needs to be explicitly imported for use with Preact's style prop in pure Preact projects. The style prop on HTML elements is typed as style?: string | CSSProperties | undefined (or SignalLike<string | CSSProperties | undefined>), where CSSProperties is defined internally in Preact's src/jsx.d.ts or src/dom.d.ts files as: export interface CSSProperties extends AllCSSProperties, DOMCSSProperties { cssText?: string | null; } export type DOMCSSProperties = { [key in keyof Omit<CSSStyleDeclaration, | 'item' | 'setProperty' | 'removeProperty' | 'getPropertyValue' | 'getPropertyPriority'>]?: string | number | null | undefined; }; export type AllCSSProperties = { [key: string]: string | number | null | undefined; }; This provides typed autocomplete for standard CSS properties (derived from CSSStyleDeclaration) plus support for custom properties and values like null/undefined. When using preact/compat (React compatibility layer), CSSProperties can be explicitly imported from "preact/compat", as shown in usage examples from Preact issues. For style types in pure Preact: - Use JSX.CSSProperties after importing JSX namespace, e.g.: import type { JSX } from 'preact'; type StyleType = JSX.CSSProperties; - Or reference via HTML attributes: import type { HTMLAttributes } from 'preact'; (style is on this interface). No external packages like csstype are needed; Preact bundles its own CSS type definitions (inlined from csstype historically). Example usage: const style: JSX.CSSProperties = { color: 'red', '--custom': 'value' };

Remove the incorrect CSSProperties import from the preact module.

The import statement at line 6 attempts to import CSSProperties directly from 'preact', but Preact does not export this type from the main module. This will cause a TypeScript compilation error.

Use import type { JSX } from 'preact' instead and reference the type as JSX.CSSProperties at line 31, or import CSSProperties from 'preact/compat' if using the React compatibility layer.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/preact-query-devtools/src/PreactQueryDevtoolsPanel.tsx` at line 6,
The import is pulling CSSProperties from 'preact' which is invalid; update the
import in PreachQueryDevtoolsPanel.tsx to import JSX instead of CSSProperties
(e.g., use import type { JSX, VNode } from 'preact') and then change the usage
at the style type (previously referenced as CSSProperties at line 31) to
JSX.CSSProperties; alternatively, if you intend to use the React compatibility
layer, import CSSProperties from 'preact/compat' and keep the existing usage.

@sukvvon sukvvon merged commit 60b4416 into main May 2, 2026
10 checks passed
@sukvvon sukvvon deleted the refactor/preact-query-devtools-use-preact-cssproperties branch May 2, 2026 04:03
@github-actions github-actions Bot mentioned this pull request May 2, 2026
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.

1 participant