Skip to content

grid/jsx-components - #13

Open
sebastianbochan wants to merge 64 commits into
mainfrom
grid/jsx-components
Open

grid/jsx-components#13
sebastianbochan wants to merge 64 commits into
mainfrom
grid/jsx-components

Conversation

@sebastianbochan

@sebastianbochan sebastianbochan commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Added JSX-based Grid configuration.


TODO

Architecture

  • - Options as optional prop
  • - Added DOM children
  • - Options parser

Components

Pagination

Layout handling

  • - Collect and detect Grid child components
  • - Test

Header - optional

Tooling / Tests

Grid Pro

Tailwind

Docs

Demos

  • - Grid Lite with tailwind
  • - Grid Pro with tailwind
  • - Add nextJS Grid Lite demo
  • - Add nextJS Grid Pro demo

@sebastianbochan sebastianbochan self-assigned this Jun 22, 2026
@sebastianbochan sebastianbochan added the Feature New feature or request label Jun 22, 2026
sebastianbochan and others added 29 commits July 10, 2026 09:31
Pin examples and wrappers to the released CSS fixes, and use exact Vite aliases for workspace packages.

Co-authored-by: Cursor <cursoragent@cursor.com>
Update grid-lite and grid-pro packages to 3.1.0.

@KamilKubik KamilKubik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall it looks and works as intendent, excellent work!

I have a few suggestions below:


// Prevent double initialization
if (initStartedRef.current || currGridRef.current) {
return;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not related to the latest changes, but it can create a serious issue when strict mode is on. Because it then mounts twice, there's no proper cleanup (only in the dev environment). I think it would be ideal to always return the cleanup instead.

return (child.props ?? {}) as Record<string, unknown>;
}

function renderChildren(children: ReactNode): string {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I can see that the support here is very basic, even too basic in my opinion, since users aren't allowed to pass their own components, like:

<Caption><div>Team directory</div></Caption>

or, more precisely:

const Component = () => <div>Team directory</div>;
<Caption><Component /></Caption>

I think this is crucial for the integration, but on the other hand, the topic is very complex, since we don't render such components, so React lifecycle-dependent operations aren't supported.

Comment on lines +138 to +144
<Column
headerFormat="#"
width={40}
cellValueGetter={function (this: { row: { index: number } }) {
return String(this.row.index + 1);
}}
/>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In Grid core, id is required, but the integration serves both id and columnId, and neither is required. Not sure why we have both, but I think we should require at least one. Also, I think that's the reason we have this "dead" (unless I'm missing something) column here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if not providing the position prop is the right call, since it's defined in the API and might not be obvious to users that positioning depends on the JSX structure. Have you considered providing it, following the established priority (for example, position over prop)?

Comment on lines 39 to 41
"dependencies": {
"@highcharts/grid-lite": ">=3.0.0"
"@highcharts/grid-lite": "3.1.0"
},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I strongly suggest changing this to peerDependencies. This way, it's gonna be installed automatically, and you'll avoid doubling the instances if users install the same package on their end.

);
const gridOptions = useMemo(
() => build(childOptions, options),
[childOptions, options, ...buildDeps]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I strongly recommend installing the eslint-plugin-react-hooks plugin, which should show an error here (and potentially in other places).

Comment on lines 40 to 42
"dependencies": {
"@highcharts/grid-pro": ">=3.0.0"
"@highcharts/grid-pro": "3.1.0"
},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The same case as for the grid-lite-react.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants