Repository navigation
v2.0.0-alpha.2
Pre-release
Pre-release
Minor Changes
- 8e8348f: Add the dataset builders:
fromDataset({ columns, data }, options):key,pathand function accessors; header groups as merged header cells; falsy (conditional) columns skipped; per-columntypecoercion,numFmt,width(including'auto'),hiddenand styles.- Freeze and autofilter on the header rows, and a totals row with
SUBTOTALformulas whose cached values are computed from the data. fromDatasetsstacks several blocks on one sheet.toDataset(sheet)reads a sheet back into{ columns, data }with null-prototype rows.
- e6a4a94: Add
javascript-excel/worker:exposeWorker()for the app's two-line worker file andcreateWorkerClient(worker)withwrite,read,toCsvandparseCsv; progress, warnings and AbortSignal work across the boundary, results are transferred, errors keep their class and code. Performance: the shared strings table is written in chunks (no long main-thread block for large tables), CRC-32 uses slicing-by-8, andonProgressis throttled to one event per 50 ms.
Patch Changes
- 46ad4e1:
fromDatasetshares style objects across rows (one per column, and one per column androwStyleobject for banding) instead of building a new one per cell. The writer then resolves each distinct style once from its identity cache. In a local run of 1M rows × 4 styled, banded columns, building went from 2.6 s to 0.5 s and writing from 11.7 s to 7.3 s. - 6e37bc8:
dateToSerial, and so the writer, now accepts 1899-12-31, Excel's day 0, as serials 0 to below 1.serialToDatereturns time-only values on that day, so a time-only cell read back byread()can now be written again; it used to throwINVALID_DATE. - 3d1b402: The
exportsmap now names the type declarations explicitly: each subpath hasimport: { types: "./dist/x.d.ts", default: "./dist/x.js" }andrequire: { types: "./dist/x.d.cts", default: "./dist/x.cjs" }. TypeScript already found the declarations next to the JavaScript files; the explicittypesconditions don't depend on that lookup. - 65c5275: The writer's content-keyed style cache now applies only to styles made of plain objects. A style containing an object with
toJSON(or another non-plain object) could share a cache key with a valid style and skip validation: an invalid colour{ toJSON: () => "FF0000" }was written as red instead of throwingINVALID_STYLE. Such styles are now resolved as they are.