feat!: migrate to document-schema.js 4.0.0 (ContentDocument drops formatVersion) - #61
Merged
Conversation
document-schema.js 4.0.0 retired ContentDocument's per-arm formatVersion literal and the CONTENT_FORMAT_VERSION constant: ContentDocument is the in-process codec-exchange type, never a serialised artefact in its own right, so versioning now lives only at the serialised-artefact boundary via the release-pinned $schema URI. Drop the constant's imports and stop setting the field at every construction site: the ods embedded-object dispatch's four kind arms (readEmbeddedObjectDocument) and the formula reader (readOdfFormulaDocument). The formula reader test asserting the stamp goes with it. BREAKING CHANGE: every ContentDocument odf.js produces now omits formatVersion, and the package requires document-schema.js ^4.0.0.
Three comments described reader behaviour that does not exist: - odt/read.ts's SCOPE note scoped out "fields beyond their cached/last-computed text value", implying the cached text is read -- run collection has no field branch at all (readOdfParagraph drops a field child without even its cached text), so fields go unread entirely. - The same note listed cell borders as out of scope, but readCellStyleDecoration (typed/shared/table.ts) has resolved borders through the table-cell style chain since it landed. - odb/form.ts claimed the drawing layer's draw:control geometry "is read by readOdt as ordinary document content" -- readBlocks has no draw:control branch and the ods shape walker skips the element explicitly, so control geometry is dropped today. Comment-only changes, no behaviour.
Contributor
|
🎉 This PR is included in version 4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the schema 4.0.0 family migration (ExaDev/document-schema.js#20).
document-schema.js 4.0.0 retired
ContentDocument's per-armformatVersionliteral and theCONTENT_FORMAT_VERSIONconstant:ContentDocumentis the in-process codec-exchange type, never a serialised artefact in its own right, so versioning now lives only at the serialised-artefact boundary via the release-pinned$schemaURI. This PR migrates odf.js to^4.0.0in the same mechanical shape as the other codecs:formatVersionat everyContentDocumentconstruction: the ods embedded-object dispatch's four kind arms (readEmbeddedObjectDocumentinsrc/typed/ods/read.ts) andreadOdfFormulaDocumentinsrc/typed/formula/read.tsCONTENT_FORMAT_VERSIONimportsLayout*family (onlyLayoutMetadata, which stays in the schema)While in the readers, three stale scope claims recorded by this repo's fidelity inventory (#59) are corrected, comment-only with no behaviour change: fields are dropped entirely (run collection has no field branch, so even the cached text is unread), cell borders ARE resolved by
readCellStyleDecoration(src/typed/shared/table.ts), anddraw:controlgeometry is dropped today (readBlockshas nodraw:controlbranch and the ods shape walker skips it explicitly).BREAKING:
ContentDocuments produced by odf.js no longer carryformatVersion, and the package requiresdocument-schema.js^4.0.0 → major release.Generated by Claude Code