Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency ClosedXML to v0.102.0 #87

Merged
merged 1 commit into from
Jun 24, 2023
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 24, 2023

Mend Renovate

This PR contains the following updates:

Package Type Update Change
ClosedXML nuget minor 0.101.0 -> 0.102.0

Release Notes

ClosedXML/ClosedXML

v0.102.0

Compare Source

Breaking changes

Please read migration guide from 0.101 to 0.102. The key ones changes are:

  • IXLCell is now a proxy to a sparse array and a new proxy is created each time it is requested by user code. Object.ReferenceEquals(ws.Cell("A1"), ws.Cell("A1")) now evaluates to false (used to be true)
  • IXLWorksheet AddWorksheet(DataTable dataTable) and IXLWorksheet AddWorksheet(DataTable dataTable, string sheetName) now use different name for the created table.

Significant changes

Replaced cell storage engine (#​1969)

The cells in a workbook used to be stored in a Dictionary<int, Dictionary<XLCell>>. That has several significant drawbacks and the storage has been replaced with a sparse arrays of individual slices (basically a sparse array containing a specific part of a cell).

slices

Key benefits (in long term):

  • Decrease in memory consumption - sparse arrays don't use values that aren't use, from esoteric OLAP cube id to styles.
  • Bulk operations - there was pretty much no way to optimize bulk operations. Clear - go through each cell. With sparse arrays, ClosedXML can operate on pices of an array (e.g. preallocate for large inserts, clear an area).
  • Most operations use only data from a slice (e.g. setting a formula doesn't have to check all cells, only those that contain formula). Due to nature of sparse array of a slice, I only need to go through cells that contains actually useful content.
  • Easier insertion/deletion of rows. XLCell originally contain an address and when a row was inserted, I had to go though all cells and fix address (+ 20 other things).

Other than memory, it's a potential for the future. Replacing a storage engine is not simple and pretty much everything uses XLCell adapter.

An example of different for 500k rows of value only cells (gist). About 200MB vs 900MB.
image
image

Embedded fonts (#​2106)

Default graphic engine of ClosedXML now contains an embedded font. That should be a quality of life improvement for users on Linux and other non-Windows environment who encountered

Unable to find font font name or fallback font fallback font name. Install missing fonts or specify a different fallback font through ‘LoadOptions.DefaultGraphicEngine = new DefaultGraphicEngine(“Fallback font name”)’..

The embedded font is an absolute bare bones Carlito font (though with a different name to avoid collision with the real one).

See doc for workflow of font selection: https://closedxml.readthedocs.io/en/latest/features/graphic-engine.html#fallback-and-embedded-font

Array formulas

A basic support for array formulas has been added. You can create array formula through IXLRangeBase object.
csharp ws.Range("B2:D3").FormulaArrayA1 = "B1:D1*POWER(1+A2:A3, 2)";
image

For more info, see doc: https://closedxml.readthedocs.io/en/latest/features/formulas.html#array-formulas

Refactored pivot source (#​1238)

The ancient PR from 2019 has been finally fixed and merged. It doesn't really add very useful features (multiple pivot tables don't have to have individual data store files in a xlsx file), but it is a big step to represent pivot cache data in a workbook. That is pretty much required to do anything useful with pivot tables.

The biggest visible improvement is that there is at least some very basic documentation about pivot tables https://closedxml.readthedocs.io/en/latest/features/pivot-tables.html

Bugfix: Normal style is not required in a workbook (#​2102)

Some other OOXML producers (e.g. NPOI) don't add Normal style into a stylesheet and in 0.101 a feature had a missing null check leading to NullReferenceException.

Misc info & next release

Not really something that is useful at this moment, but there has been significant work done on a replacement of a XLParser (https://github.com/ClosedXML/ClosedXML.Parser).

I hope to be done with the Phase 1 of my maintainership - architecture and dependencies. Most of the "OMG, this must be done before anything else" has been done. I hope to finish the rest (split writers of individual files from 5000+LOC file, use better parser and use calculation chain for formula evaluation) in the next one.

What's Changed

Performance improvements

Features

Bugfixes

Documentation

Quality of life

New Contributors

Full Changelog: ClosedXML/ClosedXML@0.101.0...0.102.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added bot Created by bot dependency Update dependencies labels Jun 24, 2023
@Pettor Pettor merged commit b32b364 into main Jun 24, 2023
1 check passed
@Pettor Pettor deleted the renovate/closedxml-0.x branch June 24, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot Created by bot dependency Update dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant