Skip to content

feat: upgrade shiki to v4 and prosemirror-highlight to v0.15.1#2625

Merged
nperez0111 merged 1 commit intomainfrom
feat/upgrade-shiki
Apr 3, 2026
Merged

feat: upgrade shiki to v4 and prosemirror-highlight to v0.15.1#2625
nperez0111 merged 1 commit intomainfrom
feat/upgrade-shiki

Conversation

@nperez0111
Copy link
Copy Markdown
Contributor

@nperez0111 nperez0111 commented Apr 3, 2026

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 createdBundledHighlighter typo, Swift precompilation support, and requires Node.js >= 20. prosemirror-highlight v0.15.1 adds explicit shiki v4 compatibility.

Changes

  • Bumped all @shikijs/* dependencies from ^3 to ^4 in @blocknote/code-block and @blocknote/core
  • Bumped prosemirror-highlight from ^0.13.0 to ^0.15.1 in @blocknote/core
  • Removed @shikijs/langs dependency (no longer needed)
  • Renamed createdBundledHighlightercreateBundledHighlighter (typo fixed in shiki v4) in packages/code-block/src/shiki.bundle.ts and examples/04-theming/07-custom-code-block/src/shiki.bundle.ts
  • Switched Swift from runtime JS regex conversion (@shikijs/langs/swift) to precompiled (@shikijs/langs-precompiled/swift), now supported in v4

Impact

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)
  • Both packages build successfully

Checklist

  • Code follows the project's coding standards.
  • All existing tests pass.

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-precompiled with the JavaScript regex engine (no WASM).

Summary by CodeRabbit

  • Chores
    • Updated Shiki syntax highlighting library to version 4, replacing the previous v3 with improved highlighting capabilities and performance.
    • Bumped prosemirror-highlight dependency to the latest version for enhanced text processing.
    • Updated related Shiki modules and language packs to maintain compatibility with v4.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blocknote Ready Ready Preview Apr 3, 2026 8:46am
blocknote-website Error Error Apr 3, 2026 8:46am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

📝 Walkthrough

Walkthrough

Upgrades Shiki.js library dependencies to version 4.x across multiple packages, updates bundled highlighter factory function references, and removes the deprecated @shikijs/langs dependency in favor of @shikijs/langs-precompiled.

Changes

Cohort / File(s) Summary
Package.json Dependency Upgrades
packages/code-block/package.json, packages/core/package.json
Bumped @shikijs/core, @shikijs/engine-javascript, @shikijs/langs-precompiled, @shikijs/themes, and @shikijs/types from ^3 to ^4. Removed @shikijs/langs entirely. Updated prosemirror-highlight from ^0.13.0 to ^0.15.1.
Shiki Bundle API Updates
examples/04-theming/07-custom-code-block/src/shiki.bundle.ts, packages/code-block/src/shiki.bundle.ts
Replaced createdBundledHighlighter with createBundledHighlighter factory function. Updated Swift language module import path from @shikijs/langs/swift to @shikijs/langs-precompiled/swift.

Poem

🐰 A bundled upgrade hops our way,
Shiki v4 saves the day!
Old imports fade, new paths arise,
Pre-compiled languages—what a prize!
Our code block shines, fresh and bright,
Dependencies dance in morning light! ✨

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: upgrading shiki to v4 and prosemirror-highlight to v0.15.1, which directly matches the primary objectives of the pull request.
Description check ✅ Passed The description comprehensively covers all major sections from the template including Summary, Rationale, Changes, Impact, Testing, and Checklist with complete information about the upgrade scope and results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/upgrade-shiki

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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.node constraint prevents ambiguous installs and toolchain failures for consumers. The same declaration should also be added to packages/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

📥 Commits

Reviewing files that changed from the base of the PR and between bda3045 and c3e26c1.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • examples/04-theming/07-custom-code-block/src/shiki.bundle.ts
  • packages/code-block/package.json
  • packages/code-block/src/shiki.bundle.ts
  • packages/core/package.json

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 3, 2026

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@2625

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@2625

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@2625

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@2625

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@2625

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@2625

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@2625

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@2625

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@2625

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@2625

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@2625

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@2625

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@2625

commit: c3e26c1

@nperez0111 nperez0111 merged commit 38be5fd into main Apr 3, 2026
22 of 23 checks passed
@nperez0111 nperez0111 deleted the feat/upgrade-shiki branch April 3, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant