Skip to content

Commit 47c105b

Browse files
author
Asif Ansari
committed
fix: post-ship patches for v1.2.0
- CellErrorBoundary: switch to renderFn prop so renderCell is called inside the boundary's own render() — previously the throw happened in the parent before the boundary could catch it - exportToPdf: double cast through unknown to satisfy installed jspdf types (autoTable/lastAutoTable not on jsPDF class by default) - package.json: add jspdf + jspdf-autotable to devDependencies so the demo build and local tests work out of the box - deploy: copy index.html → 404.html for GitHub Pages SPA routing - CLAUDE.md: bump current version to 1.2.0, add v1.2.0 changelog section
1 parent f1a05da commit 47c105b

7 files changed

Lines changed: 294 additions & 9 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
run: |
3434
mkdir -p deploy-out
3535
cp -r demo/dist/* deploy-out/
36+
cp deploy-out/index.html deploy-out/404.html
3637
touch deploy-out/.nojekyll
3738
3839
- name: Deploy to GitHub Pages 🚀

‎CLAUDE.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This file is auto-loaded by Claude Code and other AI coding assistants. It provi
1313
- **Tests:** Vitest 4 + `@testing-library/react` (`renderHook` for hooks, component tests for UI)
1414
- **Build:** Vite (library mode). `npm run build` produces `dist/opengridx.es.js` and `dist/opengridx.umd.js`.
1515
- **Lint:** `npm run lint` (ESLint). Must pass before every commit.
16-
- **Current version:** 1.1.0
16+
- **Current version:** 1.2.0
1717

1818
---
1919

@@ -127,6 +127,15 @@ Full doc: `docs/architecture/grid-row-meta.md`
127127

128128
---
129129

130+
## v1.2.0 — significant changes
131+
132+
- **`exportToPdf`** — native PDF export via optional peer deps `jspdf` + `jspdf-autotable`; lazy-loaded, zero bundle impact for non-PDF consumers
133+
- **`PdfExportOptions`** — 12-field interface: fileName, title, logoUrl, orientation, selectedRows, aggregationResult, aggregationModel, filterModel, alternateRowColor, headerBackgroundColor, headerTextColor, fontSize
134+
- **`CellErrorBoundary` fix** — changed to `renderFn` prop so the boundary calls `renderCell` inside its own `render()`; previously the throw occurred in the parent before the boundary could catch it
135+
- **GitHub Pages SPA routing** — deploy workflow now copies `404.html` so direct URL access to demo routes works
136+
137+
---
138+
130139
## v1.1.0 — significant changes
131140

132141
- **`GridRowMeta`** — hierarchy metadata moved off `GridRowModel` into `Map<GridRowId, GridRowMeta>`; exposed via `params.rowMeta` in `renderCell`

‎lib/components/Cell/Cell.tsx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,10 @@ function CellImpl<R extends GridRowModel = GridRowModel>(props: CellProps<R>) {
239239
/>
240240
)
241241
) : colDef.renderCell ? (
242-
<CellErrorBoundary field={colDef.field} resetKey={value}>
243-
{colDef.renderCell({
242+
<CellErrorBoundary
243+
field={colDef.field}
244+
resetKey={value}
245+
renderFn={() => colDef.renderCell!({
244246
value,
245247
row,
246248
field: colDef.field,
@@ -249,7 +251,7 @@ function CellImpl<R extends GridRowModel = GridRowModel>(props: CellProps<R>) {
249251
colIndex,
250252
rowMeta,
251253
})}
252-
</CellErrorBoundary>
254+
/>
253255
) : (
254256
formattedValue
255257
)}

‎lib/components/Cell/CellErrorBoundary.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22

33
interface CellErrorBoundaryProps {
4-
children: React.ReactNode;
4+
renderFn: () => React.ReactNode;
55
field: string;
66
resetKey?: unknown;
77
}
@@ -48,6 +48,6 @@ export class CellErrorBoundary extends React.Component<CellErrorBoundaryProps, C
4848
</div>
4949
);
5050
}
51-
return this.props.children;
51+
return this.props.renderFn();
5252
}
5353
}

‎lib/utils/export/exportToPdf.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export async function exportToPdf<R extends GridRowModel>(
114114
let JsPDF: new (opts: Record<string, unknown>) => JsPDFDoc;
115115
try {
116116
const mod = await import('jspdf');
117-
JsPDF = mod.default as new (opts: Record<string, unknown>) => JsPDFDoc;
117+
JsPDF = mod.default as unknown as new (opts: Record<string, unknown>) => JsPDFDoc;
118118
await import('jspdf-autotable');
119119
} catch {
120120
throw new Error(

0 commit comments

Comments
 (0)