Skip to content

docs: correct the 0.x migration guide for what actually shipped (findings 29-31) - #592

Merged
awatson1978 merged 1 commit into
release/1.0-beta-corefrom
core/migration-guide
Oct 3, 2026
Merged

awatson1978 merged 1 commit into
release/1.0-beta-corefrom
core/migration-guide

Conversation

@awatson1978

Copy link
Copy Markdown
Collaborator

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.md on v2.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 on release/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 that DCMJS_CORE=eager was the CI override. The truth on this branch: the lazy reader was removed entirely per review, DicomMessage.readFile has no core option at all, and the eager reader is the only thing it runs — the streaming engine is a separate opt-in under dcmjs.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 by test/issues/issue111-roundtrip-integrity.test.js and test/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) _vrMap now records the VR of elements with no dictionary entry, keyed by hex tag; (2) the naturalize → denaturalize round trip now rebuilds private elements from _vrMap instead 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 global nameMap mutation (finding 32), but #548 already replaced that with lookupRegisteredTagByName, so the guide documents the side-effect-free form this branch actually has, with a note about the intermediate draft. All three are pinned by test/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), allowMissingHeader is 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/readTag and DICOMWEB are still present and still warning, the root loglevel behavior is unchanged, and nameMap still builds at import). The @dcmjs-org/dcmjs wrapper 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

  • CI is green (tests on Node 22 and 24, lint, format, audit)
  • The title is a conventional commit (feat:, fix:, docs:, …)
  • Pure file moves are in their own commits and declared above
  • The prose follows docs/WRITING_STYLE.md

…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]>
@awatson1978
awatson1978 merged commit 2b0ef0c into release/1.0-beta-core Oct 3, 2026
8 checks passed
@awatson1978
awatson1978 deleted the core/migration-guide branch October 3, 2026 02:42
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant