feat: upgrade shiki to v4 and prosemirror-highlight to v0.15.1#2625
feat: upgrade shiki to v4 and prosemirror-highlight to v0.15.1#2625nperez0111 merged 1 commit intomainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughUpgrades Shiki.js library dependencies to version 4.x across multiple packages, updates bundled highlighter factory function references, and removes the deprecated Changes
Poem
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/code-block/package.json (1)
53-57: Declare a Node engine floor for the Shiki v4 bump.Shiki v4 requires Node.js >= 20. Adding an explicit
engines.nodeconstraint prevents ambiguous installs and toolchain failures for consumers. The same declaration should also be added topackages/core/package.json, which also depends on Shiki v4.Suggested patch for packages/code-block/package.json
{ "name": "@blocknote/code-block", + "engines": { + "node": ">=20" + }, ... }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/code-block/package.json` around lines 53 - 57, Add an engines.node constraint to declare Node >=20 for packages that depend on Shiki v4: in the package.json where the Shiki v4 deps appear (the package listing the "@shikijs/*" dependencies, e.g., the code-block package) add an "engines": { "node": ">=20" } field; repeat the same addition to the package.json for the core package that also depends on Shiki v4 so both packages explicitly require Node.js 20 or later.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/code-block/package.json`:
- Around line 53-57: Add an engines.node constraint to declare Node >=20 for
packages that depend on Shiki v4: in the package.json where the Shiki v4 deps
appear (the package listing the "@shikijs/*" dependencies, e.g., the code-block
package) add an "engines": { "node": ">=20" } field; repeat the same addition to
the package.json for the core package that also depends on Shiki v4 so both
packages explicitly require Node.js 20 or later.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 82893b5b-527c-466a-8b6c-a0333608afba
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
examples/04-theming/07-custom-code-block/src/shiki.bundle.tspackages/code-block/package.jsonpackages/code-block/src/shiki.bundle.tspackages/core/package.json
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
Summary
Upgrade shiki from v3 to v4 and prosemirror-highlight from v0.13.0 to v0.15.1 across the core and code-block packages.
Rationale
Shiki v4 includes a fix for the
createdBundledHighlightertypo, Swift precompilation support, and requires Node.js >= 20. prosemirror-highlight v0.15.1 adds explicit shiki v4 compatibility.Changes
@shikijs/*dependencies from^3to^4in@blocknote/code-blockand@blocknote/coreprosemirror-highlightfrom^0.13.0to^0.15.1in@blocknote/core@shikijs/langsdependency (no longer needed)createdBundledHighlighter→createBundledHighlighter(typo fixed in shiki v4) inpackages/code-block/src/shiki.bundle.tsandexamples/04-theming/07-custom-code-block/src/shiki.bundle.ts@shikijs/langs/swift) to precompiled (@shikijs/langs-precompiled/swift), now supported in v4Impact
No breaking API changes for BlockNote consumers. All language highlighting continues to work identically. Swift highlighting now uses precompiled grammars instead of runtime conversion, which is slightly more efficient.
Testing
@blocknote/code-block: 4/4 tests pass@blocknote/core: 309 passed, 3 skipped (all pre-existing skips)Checklist
Additional Notes
Swift was the only language still relying on non-precompiled grammars from
@shikijs/langs. Shiki v4 added precompilation support for Swift, so all 50 supported languages now use@shikijs/langs-precompiledwith the JavaScript regex engine (no WASM).Summary by CodeRabbit