go-pptx v2 Splits Its Public API from a Layered Internal Architecture
The go-pptx project is replacing its v1 all-in-one package with a thin public facade, layered internals, shared read-only orchestration and CI-enforced dependency rules.

Key takeaways
go-pptx v2 moves from an all-in-one module root to a layered architecture with a thin public facade.
The official v2 import path is github.com/F31/go-pptx/v2/pptx, while implementation resides under internal/.
CLI and WASM share read-only orchestration through internal/engine, with dependency exceptions recorded in internal/archlint.
Generated OOXML types support read-side projection and auditing but are excluded from the write path.
go-pptx is reorganising its Go architecture for v2 after a v1 design placed the public API and most implementation in the same package. The earlier module root contained 63 non-test files and more than 20,000 lines, while its Presentation and Slide types each exposed more than 100 methods. CLI, WebAssembly and intermediate-representation integrations all connected directly to that facade, creating opportunities for implementation drift.
ADR-030 defines the replacement: a layered meta-repository with a deliberately small public surface and a substantially richer internal model. Under the v2 layout, the module root contains no Go files. External users instead import github.com/F31/go-pptx/v2/pptx. The migration is explicitly treated as a one-time breaking change intended to preserve more freedom for future internal changes.
A thin facade over a domain model
The public pptx package retains stable types and delegates work inward. Business logic sits primarily in internal/document, supporting a “thin facade, thick domain model” approach. That division gives maintainers a clearer place to evolve document behaviour without making every implementation detail part of the external API.
The design also separates generated read-side representations from writing. Go types generated from the ECMA-376 Part 4 Transitional XSD cover 26 schemas across eight namespaces and produce more than 7,300 lines of generated material in internal/ooxml/schema. They support projection and auditing for content such as slides, notes, timing and chart data, but are prohibited from entering the write path.
Instead, writing uses xmlstore span patching and byte copying for unmodified Parts4. This keeps the modification path distinct from schema-driven inspection and limits generated code’s role to reading and analysis.
CLI and WASM now share internal/engine. The package provides read-only orchestration for Inspect, Validate, Capability and ProjectIR, while remaining independent of file I/O, command-line flags, exit codes and standard output. Callers open inputs and decide how results should be represented.
internal/engine is the sole registered exception to the normal internal/* dependency rule that points toward pptx. That exception is recorded in internal/archlint, rather than left as an informal convention.
Architecture rules as executable checks
The project’s architecture guard is implemented with the Go standard library’s go/parser and go list. It runs through go test, so no separate CI tool is required. The checks reject reverse imports into the facade, restrict which packages may use internal/engine, require new packages to be registered and verify cross-layer boundaries.
Package-local tests move with the code they exercise. Together with the dependency checks, that makes the architecture part of ordinary development rather than a document maintainers must remember to update manually.
Explicit boundaries
The project has not scoped an implementation for native rendering, which would bring dependencies such as fonts, shaping and layout. Third-party adapters may implement the rendering interface, but must state their capability scope; limited preview output cannot establish visual equivalence with PowerPoint. Encryption and signature writing, OLE writing, complete animation editing or playback evaluation, in-place source saving and full OOXML coverage are also outside the current implementation.
Why it matters for your role
Pick the building you work in.

For software engineers
The v2 layout gives engineers a stable import surface while moving business logic into internal/document. Shared engine code and executable dependency checks also reduce divergence between CLI and WASM integrations.

For QA engineers
Package-local tests migrate with their implementation, while archlint runs through go test to enforce layer boundaries. The explicit capability limits also clarify what the project does not currently verify or write.
Based on reporting by DEV Community (source article).
Written with AI assistance and reviewed under our editorial standards. Spotted an error? Tell the desk.









Comments