chore(deps): bump @mdxeditor/editor 3.55 → 4.0.2 (PR #559)#565
Merged
Conversation
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>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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
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:
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 maketyping 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
Closes #559
🤖 Generated with Claude Code