Skip to content

Commit 6b9c9d3

Browse files
authored
fix: 🐛 minimal react 19 and RSC support (#756)
* chore: 🤖 update required packages * chore: 🤖 provide styled components types * fix: 🐛 linter should ignore d.ts files * fix: 🐛 use double quotes * fix: 🐛 vite > v2 separates vitest config * chore: 🤖 reorder package * chore: 🤖 remove side property (deprecated) * fix: 🐛 dropdown amends * fix: 🐛 theme prop * fix: 🐛 type * chore: 🤖 TIAS build version supported on next v16 RSC * chore: 🤖 WIP ongoing styled-component v6.1.11 (non experimental) support * chore: 🤖 strict react version for dev * fix: 🐛 missing ref on forwardRef, might have plenty of these * chore: 🤖 update lockfile * chore: 🤖 remove optional flag from ref (typo) * chore: 🤖 add comment for future ref * refactor: 💡 banner * chore: 🤖 lint amends (double quotes) * refactor: 💡 removes style prop as typed prop * chore: 🤖 remove ajv * chore: 🤖 format * test: 💍 add aria pressed to ButtonGroup * chore: 🤖 format * test: 💍 use local getByText * chore: 🤖 update lockfile * chore: 🤖 add changeset * chore: 🤖 small text amend to trigger vercel deploy * chore: 🤖 prevent running on CI * chore: 🤖 add HUSKY to preven husky runnig pre-commit hook * fix: 🐛 conflict resolution * chore: 🤖 bump rc number * chore: 🤖 use 0.0.251-rc.17 * chore: 🤖 changeset update * chore: 🤖 set changeset to minor insetad of patch
1 parent 85f9e50 commit 6b9c9d3

16 files changed

Lines changed: 1207 additions & 11522 deletions

.changeset/dark-pigs-visit.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
"@clickhouse/click-ui": minor
3+
---
4+
5+
The previous versions of click-ui (e.g., <= 0.0.250), break on the latest of Nextjs, Vitejs, any React >= 19 or RSC enabled builds. To mitigate it, this initial change provides the minimal setup required for it to work in such environments, e.g. when installing the package, it should run in dev and build processes.
6+
It does NOT try to modify, replace, introduce or change breaking changes; there might be a few subtle changes related to Radix. At the time of writing, the library requires a browser runtime, which means that is client-only. Separately, there'll be other PR to address other related concerns and expand on this initial PR, e.g. none interactive components shall render server-side.
7+
8+
# What changed?
9+
10+
The @clickhouse/click-ui package was updated, which includes an updated Radix UI dependency that removed the side, align, and sideOffset props from ContextMenu.Content.
11+
12+
Radix made this change because the ContextMenuContentProps TypeScript type now explicitly omits these props:
13+
14+
```
15+
interface ContextMenuContentProps extends Omit<MenuContentProps, 'onEntryFocus' | 'side' | 'sideOffset' | 'align'> {}
16+
```
17+
18+
1. Context menus are fundamentally different from dropdown menus — they open at the cursor position (where the user right-clicked), not relative to a trigger element
19+
20+
2. The side and align props don't make sense for context menus since there's no anchor element to position against
21+
22+
3. Smaller bundle size — removing unused positioning logic reduces the bundle for ContextMenu consumers
23+
24+
# Migration Guide
25+
26+
Before: <ContextMenu.Content side="bottom" align="start">
27+
After: <ContextMenu.Content>
28+
29+
Before: sideOffset={5}
30+
After: Use alignOffset for vertical spacing if needed
31+
32+
The props were never functionally useful for context menus (which position at the cursor), so removing them is just a cleanup.
33+
34+
Simply delete these props from your ContextMenu.Content components.
35+
36+
Sources:
37+
- https://www.radix-ui.com/primitives/docs/overview/releases
38+
- https://github.com/radix-ui/primitives/issues/3208
39+
- https://www.radix-ui.com/primitives/docs/components/context-menu

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import globals from "globals";
99

1010
export default tseslint.config(
1111
{
12-
ignores: ["dist/**", "node_modules/**", "build/**", "coverage/**"],
12+
ignores: ["dist/**", "node_modules/**", "build/**", "coverage/**", "**/*.d.ts"],
1313
},
1414
js.configs.recommended,
1515
...tseslint.configs.recommended,

0 commit comments

Comments
 (0)