Skip to content

Commit bdd0740

Browse files
Update FORK.md with table addRow() adoption from rmartin93/exceljs-fork
1 parent cc6912e commit bdd0740

1 file changed

Lines changed: 48 additions & 4 deletions

File tree

FORK.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ Upstream exceljs has 100+ open PRs, some over a year old. We needed these fixes
3939

4040
**Status:** All original contributions submitted, waiting for upstream review
4141

42+
### 🤝 Community Fork Contributions (Adopted & Submitted)
43+
44+
| Feature/Fix | Our Issue | Source | Upstream PR | Status | Date |
45+
|-------------|-----------|--------|-------------|--------|------|
46+
| Table addRow() fix | [#23](https://github.com/protobi/exceljs/issues/23) | [rmartin93/exceljs-fork](https://github.com/rmartin93/exceljs-fork) | TBD | 🔄 Preparing | Nov 2025 |
47+
48+
**Status:** Adopted from community fork, preparing upstream submission
49+
4250
### 🔒 Security & Maintenance
4351

4452
| Feature/Fix | Our Issue | Upstream PR | Status |
@@ -162,7 +170,41 @@ worksheet.addPivotTable({
162170

163171
**Upstream status:** PR exists ([#2885](https://github.com/exceljs/exceljs/pull/2885)), adopted here
164172

165-
### 3. Enhanced Bug Fixes
173+
### 3. Table addRow() Fix for Templates
174+
175+
**Why it matters:** Loading Excel files with tables and adding rows to them crashes in official exceljs. This is critical for template-based workflows.
176+
177+
**Code:**
178+
```javascript
179+
// ✅ Works in @protobi/exceljs
180+
// ❌ Crashes in official exceljs with "Cannot read properties of undefined (reading 'length')"
181+
182+
const workbook = new Excel.Workbook();
183+
await workbook.xlsx.readFile('template.xlsx');
184+
185+
const worksheet = workbook.getWorksheet('Data');
186+
const table = worksheet.getTable('MyTable');
187+
188+
// Add rows to the loaded table
189+
table.addRow(['New', 'Data', 'Here']); // Works!
190+
table.addRow(['More', 'Data', 'Here']); // Works!
191+
192+
await workbook.xlsx.writeFile('output.xlsx');
193+
```
194+
195+
**What it fixes:**
196+
- "Cannot read properties of undefined (reading 'length')" error
197+
- Missing worksheet references in loaded tables
198+
- Table references not expanding dynamically when rows are added
199+
- Excel filter buttons disappearing after save
200+
201+
**Files changed:**
202+
- `lib/doc/table.js` - Dynamic table reference updates, autoFilterRef handling
203+
- `lib/doc/worksheet.js` - Table loading compatibility fixes
204+
205+
**Upstream status:** Adopted from [rmartin93/exceljs-fork](https://github.com/rmartin93/exceljs-fork), preparing upstream PR
206+
207+
### 4. Enhanced Bug Fixes
166208

167209
See "Status Tracking" section above for 6 bug fixes adopted from upstream PRs.
168210

@@ -226,6 +268,7 @@ npm run test:integration -- --grep "Pivot Tables"
226268
- ✅ All upstream tests (197 passing)
227269
- ✅ Pivot table count metric tests
228270
- ✅ Multiple pivot tables tests
271+
- ✅ Table addRow() workflow tests
229272

230273
---
231274

@@ -267,7 +310,8 @@ We actively monitor upstream for:
267310
**Current watch list:**
268311
- 6 adopted PRs awaiting merge (#2851, #2915, #2956, #2973, #2978, #2885)
269312
- 3 original PRs awaiting merge (#2995, #2996, #2997)
270-
- **Total: 9 PRs** submitted to upstream
313+
- 1 community fork contribution preparing (#23 → TBD)
314+
- **Total: 9 PRs** submitted to upstream, 1 preparing
271315

272316
**Update frequency:** Monthly check for upstream progress
273317

@@ -292,5 +336,5 @@ See [LICENSE](LICENSE)
292336
---
293337

294338
**Last Updated:** 2025-11-07
295-
**Watching:** 9 upstream PRs awaiting review/merge
296-
**Status:** Active maintenance until upstream merge - All features submitted!
339+
**Watching:** 9 upstream PRs awaiting review/merge, 1 preparing
340+
**Status:** Active maintenance until upstream merge - Continuing to adopt community contributions!

0 commit comments

Comments
 (0)