Repository navigation
docs: correct the 0.x migration guide for what actually shipped (findings 29-31) - #592
Merged
Merged
Conversation
…ings 29-31) The v2 guide (packages/docs/docs/migration/from-0x.md on v2.0-development) described the lazy read core as the default, promised a byte-identity rewrite guarantee, and listed naturalization under "no migration needed". None of the three is true on this branch: the lazy core was removed per review, writes re-encode with round-trip integrity pinned by tests, and naturalization changed in three documented ways. docs/MIGRATION.md states the branch truth, with each behavioral claim tied to the suite that pins it, and cross-links BREAKING_CHANGES.md and EXAMPLES.md. Co-Authored-By: Claude Fable 5 <[email protected]>
|
🎉 This PR is included in version 1.0.0-beta.1 🎉 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.
What this changes
This lands the corrected 0.x migration guide as
docs/MIGRATION.md, resolving the three documentation findings from the PR #512 review map: 29 (HIGH), 30 (HIGH), and 31 (MED). With the engine fixes and the writers wave already merged, these were the last three unaddressed findings of the 33 in this branch's scope — the remaining open ones (8, 9, 10, 15–19) are image and FHIR code fixes that ride with their own package waves.The old guide lived at
packages/docs/docs/migration/from-0x.mdonv2.0-development. It was written before the 2026-08-02 deprecation and never updated, so it described a library that doesn't exist. Rather than patch it in place, I rewrote it against what is actually onrelease/1.0-beta-core, and tied every behavioral claim to the test suite that pins it. The three findings, one at a time:Finding 29 — the guide documented the lazy core as the default. The old guide said reading was re-platformed onto a lazy, offsets-only tokenizer, that values decode on first access, that
core: "eager"was the escape hatch, and thatDCMJS_CORE=eagerwas the CI override. The truth on this branch: the lazy reader was removed entirely per review,DicomMessage.readFilehas nocoreoption at all, and the eager reader is the only thing it runs — the streaming engine is a separate opt-in underdcmjs.eventStream. The corrected text covers this in "Reading: no migration" (same call, same timing, one try/catch still catches everything) and "The streaming engine: new and opt-in" (nothing routes through it implicitly).Finding 30 — the guide promised a byte-identity guarantee that is gone. The old guide said a zero-edit read-then-write reproduces the input byte-for-byte, shipped runnable sample code asserting
out[i] === src[i], and taught edit-by-assignment because in-place mutation would be "silently discarded" by the passthrough writer. Byte identity came from the passthrough path, which depended on the lazy core and left with it. What remains true, and what the corrected text says in "Writing: what is and is not guaranteed" and "Editing: no migration": writes re-encode every element exactly as 0.x did, in-place mutation still works, and the guarantee is round-trip integrity — same element set, same values, byte-identical PixelData, size stable across rewrite cycles — pinned bytest/issues/issue111-roundtrip-integrity.test.jsandtest/lossless-read-write.test.js. The guide now explicitly warns against asserting byte equality over a rewrite.Finding 31 — the guide listed naturalization under "What needs NO migration" while three changes exist. The corrected text gives naturalization its own section stating all three as they stand on this branch: (1)
_vrMapnow records the VR of elements with no dictionary entry, keyed by hex tag; (2) the naturalize → denaturalize round trip now rebuilds private elements from_vrMapinstead of logging "Unknown name in dataset" and dropping them; (3)registerTag()keywords now denaturalize symmetrically through a registry-local name index. On the third: the review named the globalnameMapmutation (finding 32), but #548 already replaced that withlookupRegisteredTagByName, so the guide documents the side-effect-free form this branch actually has, with a note about the intermediate draft. All three are pinned bytest/issues/issue388-private-tags.test.js; the unchanged contracts (verbatim keywords, single-item SQ proxies, PN accessors) are cited to the issue3/issue218/issue231 suites.Beyond the three findings, I ported only what survives on this branch and checked each claim against the code: deflate-on-write is real here (
test/write-deflate.test.js),allowMissingHeaderis the one new read opt-in, and the v2 guide's "removed APIs", named-child-logger, and lazy-nameMap sections are omitted because none of those changes exist on this branch (DicomMessage.read/readTagandDICOMWEBare still present and still warning, the root loglevel behavior is unchanged, andnameMapstill builds at import). The@dcmjs-org/dcmjswrapper is described as arriving with the wrapper release, per RELEASE_PLAN.md step 7.Cross-links: BREAKING_CHANGES.md now points to MIGRATION.md and vice versa, and EXAMPLES.md gained a one-line pointer for 0.x readers.
Evidence
Documentation only; no code or test changes. The suites the guide cites (issue3, issue111, issue218, issue231, issue388, issue93, write-deflate, lossless-read-write) are already green on this branch. Prettier/lint-staged here cover JS only, so no formatter applies to the markdown.
Breaking changes
None.
Fixtures used
None.
Checklist
feat:,fix:,docs:, …)