Skip to content

Commit 46db092

Browse files
Release 4.4.0-protobi.10: Fix richText shared-string dedup + uuid pin
Fixes critical bug in WorkbookWriter streaming with useSharedStrings: every richText cell collapsed into a single shared-string entry (richText objects coerced to '[object Object]' as hash key, deduping all of them). Cherry-picked from #50 by @gwkline; adds regression tests covering richText deduplication and formatting-aware distinction. Addresses upstream exceljs#2267. Also pins uuid to ^9.0.1 to keep browserify build working (uuid@14 dropped the main field; uuid@11 ships ES2021 syntax that browserify@16 cannot parse). Adds AGENTS.md with hard rules for AI-generated PRs. Files changed: - lib/utils/shared-strings.js: hash richText by rendered XML - spec/unit/utils/shared-strings.spec.js: 2 new regression tests - AGENTS.md: new (hard rules for AI agents) - README.md, CONTRIBUTING.md: pointers to AGENTS.md, release notes - .github/PULL_REQUEST_TEMPLATE.md: per-PR checklist - FORK.md: release notes - package.json, package-lock.json: version bump, uuid 8 -> 9 Tests: 886 unit tests passing (4 in SharedStrings, up from 2). PRs: #64 (uuid), #65 (AGENTS.md), #66 (richText fix)
1 parent 3f0bfdc commit 46db092

4 files changed

Lines changed: 39 additions & 3 deletions

File tree

FORK.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,35 @@ This AI-assisted workflow enables rapid response to community issues while maint
2828

2929
## Fork Release History
3030

31+
### 4.4.0-protobi.10 (2026-05-06)
32+
33+
**Bug Fix: richText shared-string deduplication in streaming writer** ([#66](https://github.com/protobi/exceljs/pull/66), cherry-picked from [#50](https://github.com/protobi/exceljs/pull/50) by @gwkline)
34+
35+
When using `WorkbookWriter` with `useSharedStrings` enabled, every cell containing richText collapsed into a single shared-string entry, corrupting the strings table. Root cause: `SharedStrings.add()` used the value directly as a hash key; richText objects coerced to the string `"[object Object]"`, deduping all of them into one entry.
36+
37+
**Fix:** Hash richText values by their rendered XML representation (via `SharedStringXform.toXml()`). Plain strings unchanged.
38+
39+
**Tests:** Adds two regression tests (`spec/unit/utils/shared-strings.spec.js`):
40+
1. Equal richText values share one entry; different ones get separate entries
41+
2. richText values that differ only in formatting are NOT deduped
42+
43+
**Upstream context:** This bug was first reported as [exceljs/exceljs#2267](https://github.com/exceljs/exceljs/issues/2267) (May 2023). An alternative fix was opened upstream as [exceljs/exceljs#2588](https://github.com/exceljs/exceljs/pull/2588) (Nov 2023) but has been stale since Feb 2024.
44+
45+
**Build Fix: Pin uuid to ^9.0.1** ([#64](https://github.com/protobi/exceljs/pull/64))
46+
47+
`npm install` had drifted to `uuid@14.0.0`, which broke `npm run build`:
48+
- uuid@14 dropped the `main` field in favor of `exports`-only — browserify@16 doesn't honor `exports`
49+
- uuid@11 (npm's recommended CJS target) ships ES2021 syntax (`??=`) browserify@16 can't parse
50+
- uuid@9.0.1 is the highest version that keeps both `main` and pre-ES2021 CJS output
51+
52+
**Documentation: AGENTS.md for AI-generated PRs** ([#65](https://github.com/protobi/exceljs/pull/65))
53+
54+
Adds `AGENTS.md` at repo root with hard rules for AI coding agents (Claude Code, Cursor, Codex, etc.): surgical scope, no formatter sweeps, complete PR descriptions, real-fixture testing, cross-check open PRs, Excel-verification for serialization changes. Auto-discovered by AI tools; referenced from README.md, CONTRIBUTING.md, and the PR template.
55+
56+
**Tests:** All 886 unit tests passing (4 in `SharedStrings`, up from 2).
57+
58+
---
59+
3160
### 4.4.0-protobi.9 (2026-02-01)
3261

3362
**New Feature: Pivot Table & Chart Round-Trip Preservation** ([#41](https://github.com/cjnoname/excelts/issues/41))

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ See [FORK.md Release History](FORK.md#fork-release-history) for details.
5959

6060
## Fork Release Notes
6161

62+
**4.4.0-protobi.10** (May 2026) - Streaming richText Bug Fix + Build Fix
63+
- **Fix richText shared-string deduplication in streaming writer** - Cherry-picked from PR #50 by @gwkline. Previously, every richText cell collapsed into a single shared-string entry because objects coerced to `"[object Object]"` as a hash key. Now richText values are hashed by their rendered XML representation. Addresses upstream [exceljs/exceljs#2267](https://github.com/exceljs/exceljs/issues/2267).
64+
- Adds regression tests covering richText deduplication and formatting-aware distinction
65+
- Pin uuid to ^9.0.1 to keep browserify build working (uuid@14 dropped the `main` field; uuid@11 ships ES2021 syntax browserify can't parse)
66+
- Adds `AGENTS.md` with hard rules for AI-generated PRs
67+
- All 886 unit tests passing
68+
6269
**4.4.0-protobi.9** (February 2026) - Pivot Table & Chart Round-Trip Preservation + Critical Bug Fixes
6370
- **Round-trip preservation for pivot tables and charts** - Read Excel files with existing pivot tables and charts, write them back without corruption
6471
- Hybrid preservation approach: stores raw XML while extracting minimal metadata for structural integrity

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@protobi/exceljs",
3-
"version": "4.4.0-protobi.9",
3+
"version": "4.4.0-protobi.10",
44
"description": "Excel Workbook Manager - Temporary fork with pivot table enhancements and bug fixes pending upstream merge",
55
"private": false,
66
"license": "MIT",

0 commit comments

Comments
 (0)