Skip to content

chore(deps): bump @mdxeditor/editor 3.55 → 4.0.2 (PR #559)#565

Merged
jmynes merged 3 commits into
mainfrom
chore/deps/mdxeditor-4
Jun 8, 2026
Merged

chore(deps): bump @mdxeditor/editor 3.55 → 4.0.2 (PR #559)#565
jmynes merged 3 commits into
mainfrom
chore/deps/mdxeditor-4

Conversation

@jmynes

@jmynes jmynes commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

Bumps `@mdxeditor/editor` from 3.55.0 to 4.0.2.

v4's only stated breaking change is the removal of the Sandpack integration. We never used any sandpack APIs, so that part is a no-op for us. But while smoke-testing we found two real issues — one introduced by v4 and one pre-existing — both addressed in this PR.

What's in this PR

1. Sandpack removal cleanup

  • The defensive `@stitches/core` mock in `src/tests/setup.ts` only existed to keep jsdom happy with v3's transitive `@codesandbox/sandpack-react`. v4 drops that whole transitive chain — `@stitches/core` is no longer in the install tree — so the mock is now dead code and is removed.

2. `codeBlockLanguages$` schema migration (the real v4 break)

v4 changed the `codeBlockLanguages$` gurx Cell from yielding `Record<string, string>` (legacy) to `NormalizedCodeBlockLanguages` (`{ items: { value, label }[], keyMap, supportMap }`). Our code called `Object.entries` on the new shape and crashed at runtime with `a.label.localeCompare is not a function` because each item was `["0", { value, label }]` instead of `[value, label]`. Three readers fixed:

  • `src/components/tickets/custom-codemirror-editor.tsx`
  • `src/components/tickets/custom-code-language-select.tsx`
  • `src/components/tickets/readonly-code-block.tsx`

3. `` toolbar button (UX improvement)

Added next to InsertThematicBreak. mdxeditor's keyboard shortcut has always been finicky (multi-line transformer, only fires on paste/import/blur — not while typing); this button gives users a deterministic insertion path. Follow-up to make typing work: PUNT-416.

What's NOT in this PR (and why)

While testing we found that switching to source mode in dev (`next dev --turbopack`) crashes with `Cannot access property Symbol.iterator, tags is undefined`, no matter what content is in the editor. We initially suspected v4 and reverted to v3.55 to bisect — but the same error reproduces on v3.55 in dev. The Railway demo (which runs the production build) works fine on v3, so this is a pre-existing Next.js 16 / Turbopack incompatibility with mdxeditor's CodeMirror-based source editor — not a regression caused by this PR. We're leaving it for a separate investigation.

Test plan

  • `pnpm install` succeeds (sandpack chain shed, `-676 / +13` lockfile diff)
  • `pnpm lint` clean (no new errors)
  • `pnpm test` — 1527 / 1527 pass
  • `tsc --noEmit` reports no new mdxeditor-related errors
  • Manual UI: rich-text editing, code-block insertion via toolbar button, code-block language selection all work in v4
  • CI passes
  • Manual UI check post-merge: open a ticket, edit description with various markdown features, save

Closes #559

🤖 Generated with Claude Code

jmynes and others added 3 commits June 8, 2026 16:16
v4's only breaking change is the removal of the Sandpack integration
(sandpackPlugin, SandpackEditor, SandpackConfig, etc.). We never used
any of those APIs, so no application code changes are needed.

The defensive @stitches/core mock in src/__tests__/setup.ts existed
solely to keep jsdom happy with the transitive @codesandbox/sandpack-react
that v3 pulled in. v4 drops that whole transitive chain, so the mock is
removed.

### Verification
- pnpm install succeeds
- pnpm lint clean (no new errors)
- pnpm test — 1527 / 1527 pass
- tsc --noEmit reports no new mdxeditor-related errors

Closes #559

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…shape

v4 changed the codeBlockLanguages$ Cell from yielding
Record<string, string> (legacy) to NormalizedCodeBlockLanguages
({ items: { value, label }[] }). Our code was treating it as a record
and crashing at runtime with `a.label.localeCompare is not a function`
because Object.entries on the new shape exposed array indexes paired
with item objects (so `label` was an object, not a string).

Updated three call sites to read from `.items`:
- custom-codemirror-editor.tsx
- custom-code-language-select.tsx
- readonly-code-block.tsx

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the InsertCodeBlock button to the description editor's toolbar so
users have a reliable way to create code blocks. Triple-backtick typing
support in mdxeditor's markdown shortcuts has always been finicky (true
in v3 too); this gives a deterministic alternative.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jmynes jmynes merged commit b262578 into main Jun 8, 2026
2 checks passed
@jmynes jmynes deleted the chore/deps/mdxeditor-4 branch June 8, 2026 22:34
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant