Skip to content

WIP(testing)#8835

Open
avivkeller wants to merge 1 commit intomainfrom
avivkeller-patch-2
Open

WIP(testing)#8835
avivkeller wants to merge 1 commit intomainfrom
avivkeller-patch-2

Conversation

@avivkeller
Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Aviv Keller <me@aviv.sh>
Copilot AI review requested due to automatic review settings April 22, 2026 18:25
@avivkeller avivkeller requested a review from a team as a code owner April 22, 2026 18:25
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

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

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Apr 22, 2026 6:26pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 22, 2026

PR Summary

Medium Risk
Enables twoslash processing in MDX code highlighting for all runtimes, including Cloudflare, which may impact build/runtime behavior and performance in that environment.

Overview
MDX syntax highlighting is changed to always enable Shiki Twoslash by setting twoslash: true in apps/site/mdx/plugins.mjs, removing the previous Cloudflare-specific disablement.

Reviewed by Cursor Bugbot for commit f23ba96. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website

Please review the changes when you have a chance. Thank you! 🙏

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f23ba96. Configure here.

Comment thread apps/site/mdx/plugins.mjs

// TODO(@avivkeller): Find a way to enable Twoslash w/ a VFS on Cloudflare
twoslash: !OPEN_NEXT_CLOUDFLARE,
twoslash: true,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Twoslash enabled on Cloudflare despite known incompatibility

High Severity

The twoslash option is now hardcoded to true, removing the !OPEN_NEXT_CLOUDFLARE guard that previously disabled it on Cloudflare Workers. The removed TODO comment explicitly noted that Twoslash with a VFS doesn't work on Cloudflare. Since the wasm option on the line above still uses the !OPEN_NEXT_CLOUDFLARE conditional for an analogous Cloudflare limitation, this change breaks consistency and will likely cause failures when running on Cloudflare Workers.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f23ba96. Configure here.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.91%. Comparing base (524e64b) to head (f23ba96).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8835      +/-   ##
==========================================
+ Coverage   73.88%   73.91%   +0.02%     
==========================================
  Files         105      105              
  Lines        8889     8889              
  Branches      326      326              
==========================================
+ Hits         6568     6570       +2     
+ Misses       2320     2318       -2     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR appears to be a WIP change to enable Twoslash-based Shiki transformations in the site’s MDX pipeline (apps/site), likely for testing.

Changes:

  • Enable twoslash in the MDX Shiki (rehype-shiki) plugin configuration unconditionally (including Cloudflare builds).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/site/mdx/plugins.mjs

// TODO(@avivkeller): Find a way to enable Twoslash w/ a VFS on Cloudflare
twoslash: !OPEN_NEXT_CLOUDFLARE,
twoslash: true,
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

twoslash is now enabled unconditionally. This file previously disabled Twoslash on Cloudflare specifically because it needs a VFS / Node-like filesystem support there, and nothing else in this PR adds that missing support. As-is, Cloudflare worker builds/runtime MDX compilation are likely to fail (or significantly increase CPU/memory) when Twoslash runs. Please gate Twoslash behind !OPEN_NEXT_CLOUDFLARE again or add a Cloudflare-compatible VFS/feature flag that keeps Cloudflare deployments off by default.

Suggested change
twoslash: true,
// Twoslash needs Node-like filesystem/VFS support and is disabled on
// Cloudflare workers until a compatible implementation is available.
twoslash: !OPEN_NEXT_CLOUDFLARE,

Copilot uses AI. Check for mistakes.
@avivkeller
Copy link
Copy Markdown
Member Author

cc @dario-piotrowicz

@dario-piotrowicz
Copy link
Copy Markdown
Member

cc @dario-piotrowicz

It doesn't seem to be working, does it? 😕

I tried deploying it and this is what I got:
Screenshot 2026-04-22 at 22 53 37

(PS: I'm not sure why the missing CSS there though 😕)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants