Skip to main content

Migrating from Tiptap to GoTipe: read the conversion report

Updated 4 min readMarkdown

The converted heading still reads "Approval", at level two. Its owner is less obvious: "QA" is sitting in unmapped, outside the document. Save just the document and you leave it behind. That is one reason to read the conversion report before writing the result back to storage.

GoTipe is a block editor library for apps that store Markdown. Its migration package reads Tiptap-exported JSON without loading the source editor runtime, so you can inspect the input before touching your components or imports.

Audit the original export

Preserve the original exports and work with copies. Include your custom nodes in those fixtures. Plain paragraphs won't show what happens to an approval gate.

Call convertProseMirrorToGoTipe and look at document together with preserved, unmapped, and warnings. Keep the full result and its original export while mapping the nodes. Warnings alone don't give you an inventory of every unmapped field. The sample document uses a bold paragraph, an approval node and a level-two heading with releaseOwner: "QA".

Install the tested packages in a fresh directory. Save the script as migration-check.mjs and run node migration-check.mjs.

npm init -y
npm install --save-exact @gotipe/migration@0.1.1 @gotipe/core@0.1.6
import assert from "node:assert/strict";
import { convertProseMirrorToGoTipe, UnsupportedContent } from "@gotipe/migration";

const source = {
  type: "doc",
  content: [
    { type: "paragraph", content: [
      { type: "text", text: "Ship after sign-off.", marks: [{ type: "bold" }] },
    ] },
    { type: "heading", attrs: { level: 2, releaseOwner: "QA" }, content: [
      { type: "text", text: "Approval" },
    ] },
    { type: "approvalGate", attrs: { team: "QA", required: 2 }, content: [
      { type: "text", text: "Release candidate" },
    ] },
  ],
};
const before = structuredClone(source);
const result = convertProseMirrorToGoTipe(source);
const [paragraph, heading, raw] = result.document.blocks;

assert.deepEqual(source, before);
assert.deepEqual(result.document.blocks.map(b => b.type),
  ["paragraph", "heading", "markdownRaw"]);
assert.deepEqual(paragraph.content, [
  { text: "Ship after sign-off.", marks: [{ type: "bold", attrs: {} }] },
]);
assert.deepEqual(heading.attrs, { level: 2 });
assert.deepEqual(heading.content, [{ text: "Approval", marks: [] }]);
assert.deepEqual(result.unmapped, [{
  blockId: heading.id, path: "content[1].attrs", sourceType: "heading",
  fields: { releaseOwner: "QA" },
}]);
assert.deepEqual(raw.attrs, { kind: "json" });
assert.deepEqual(JSON.parse(raw.content), source.content[2]);
assert.equal(result.preservedNodes, 1);
assert.equal(result.skippedNodes, 0);
assert.deepEqual(result.preserved.map(({ blockId, path, sourceType }) =>
  ({ blockId, path, sourceType })), [
  { blockId: raw.id, path: "content[2]", sourceType: "approvalGate" },
]);
assert.equal(result.warnings.length, 2);
assert.throws(() => convertProseMirrorToGoTipe(source, { strict: true }),
  error => error instanceof UnsupportedContent && error.path === "content[2]");

// Strict mode rejects unknown nodes; it does not reject every unmapped field.
const known = convertProseMirrorToGoTipe({
  type: "doc", content: source.content.slice(0, 2),
}, { strict: true });
assert.equal(known.preserved.length, 0);
assert.deepEqual(known.unmapped.map(item => item.fields), [{ releaseOwner: "QA" }]);

const needsReview = result.preserved.length > 0 || result.unmapped.length > 0
  || result.warnings.length > 0;
assert.equal(needsReview, true);
console.log("Block types:", result.document.blocks.map(b => b.type).join(", "));
console.log("Source unchanged; bold text, heading and raw JSON assertions passed.");
console.log("releaseOwner remains in unmapped, outside the document.");
console.log("Audit decision:", needsReview ? "review" : "ready-for-validation");
console.log("Strict mode refused content[2]; known-node metadata still needs review.");
console.log("No editor UI, storage write or approval workflow was executed.");

The audit decision is review. These assertions examine conversion in memory; the script doesn't write storage or open an editor. Strict mode rejects the unknown approval node, but a known heading can have fields left in unmapped.

Follow the data

The paragraph retains its bold span, and the heading keeps level two. The two application-specific pieces take separate routes.

The approvalGate node, with team: "QA" and required: 2, becomes a markdownRaw block holding a JSON string. Parse that string and you recover the source subtree, including its team, required count and child text. This is the data you need to map. The approval widget and its logic are still yours to implement.

The heading's releaseOwner value is in result.unmapped[0].fields, not in result.document. Saving only the converted document would discard that owner field. Decide where it belongs in your application before overwriting stored content.

Test the workflow too

If you're retaining raw blocks, your schema needs to accommodate markdownRaw. Port the approval rule and its editing control, then validate the converted document against the extensions your app actually loads.

Try releasing with one approval and then with two in your app as well. Check that editing and saving the document keeps its mapped owner and approval details intact. Conversion is only a piece of a migration's success.

A batch audit and the report fields are explained in the saved-JSON audit guide. Editor components and custom extensions are covered by the Tiptap migration guide.

@gotipe/migration and @gotipe/core are MIT-licensed. GoTipe's ready-made editor UI and theme use commercial licenses. This post was drafted with AI. The example was executed against the pinned versions above.

About the author

  • GoTipe is a block editor for apps that store Markdown. Our TypeScript and Rust/WASM engines, Markdown codec and headless adapters for React, Vue, Svelte and Solid are MIT-licensed. The ready-made UI and themes use a commercial license. We share runnable examples of Markdown preservation, editor integration, collaboration and AI review. Try the editor and read the docs: https://gotipe.com Source and examples: https://github.com/veniameen/gotipe

No comments yet. Be the first to comment.