dotnet / dotnet/Open-XML-SDK

Ensure a package only references required types

Open
#1,349 0 comments 0 reactions 1 assignee Claimed by @twsouthwick View on GitHub
architecture
Dominant language
C#
Stars
4.6k
Forks
605
PR merge metrics
No merged PRs in 30d

Description

Currently, there are some generated helper features/methods that will unintentionally link types together that may never be needed. For example, parts that are only for spreadsheets will be referenced by a word document. This prevents the IL trimmer from removing unused code for purposes of trimming and AOT.

Specifically, we should:

- [ ] Implement package specific implementations of `IRootElementFactory`
- [ ] Ensure any element activation code is only linked via pathways where it will be used
- [ ] A single generated file is used for all the root part generation - this would need to be separated out to be per-document type
- [ ] TypedOpenXmlPartReader was introduced in 2.19 as a type that provides the typed factories for use of OpenXmlPartReader with just a stream. This would need to be replaced with a doc specific one
- [ ] The `TypedFeatures` and `Typed...` class should be removed so that there's no shared code there

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.