Skip to content

Conversation

@ovflowd
Copy link
Member

@ovflowd ovflowd commented Nov 9, 2025

This PR optimizes our build process by processing all entries at time and chunking our client-bundle and using Rolldown's importMap feature.

@vercel
Copy link

vercel bot commented Nov 9, 2025

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

Project Deployment Preview Updated (UTC)
api-docs-tooling Ready Ready Preview Nov 11, 2025 2:10am

@codecov
Copy link

codecov bot commented Nov 9, 2025

Codecov Report

❌ Patch coverage is 24.90421% with 196 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.10%. Comparing base (90ccfd1) to head (8b1ada3).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/generators/web/utils/processing.mjs 19.04% 68 Missing ⚠️
src/generators/web/utils/bundle.mjs 7.14% 52 Missing ⚠️
src/generators/web/utils/chunks.mjs 18.60% 35 Missing ⚠️
src/generators/web/index.mjs 36.11% 23 Missing ⚠️
src/generators/web/utils/generate.mjs 33.33% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #488      +/-   ##
==========================================
- Coverage   74.42%   74.10%   -0.33%     
==========================================
  Files         110      111       +1     
  Lines       10468    10562      +94     
  Branches      700      701       +1     
==========================================
+ Hits         7791     7827      +36     
- Misses       2674     2732      +58     
  Partials        3        3              

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ovflowd
Copy link
Member Author

ovflowd commented Nov 10, 2025

@avivkeller thoughts?

@ovflowd ovflowd changed the title feat: twoslash support infra: performance improvements Nov 10, 2025
@ovflowd ovflowd marked this pull request as ready for review November 10, 2025 15:23
@ovflowd ovflowd requested a review from a team as a code owner November 10, 2025 15:23
Copilot AI review requested due to automatic review settings November 10, 2025 15:23
Copy link
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 refactors the web generator to support batch processing of multiple JSX entries and implements performance optimizations through safe file operations.

  • Introduces safeWrite and safeCopy utilities to avoid unnecessary file writes by comparing file sizes
  • Refactors bundling to process multiple entry points together, enabling code splitting and import maps
  • Updates Rolldown from beta.40 to beta.47 and changes output format from IIFE to ESM with module support

Reviewed Changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/utils/safeWrite.mjs New utility to conditionally write files based on size comparison
src/utils/safeCopy.mjs New utility for efficient file copying with change detection
src/utils/tests/safeCopy.test.mjs Comprehensive test suite for safeCopy utility
src/generators/web/utils/processing.mjs Refactored to process multiple JSX entries in batch, now returns results array with js chunks
src/generators/web/utils/bundle.mjs Enhanced to support multiple entry points, ESM output, code splitting, and import maps
src/generators/web/ui/index.css Added @node-core/rehype-shiki CSS import
src/generators/web/ui/components/CodeBox.jsx Updated to pass className and children to BaseCodeBox, fixed notification duration
src/generators/web/template.html Updated to use ES modules and import maps instead of IIFE
src/generators/web/index.mjs Refactored to use batch processing and safeWrite for all file operations
src/generators/legacy-html/index.mjs Updated import path for safeCopy utility
package.json Added @shikijs/twoslash dependency and upgraded Rolldown to beta.47
npm-shrinkwrap.json Lockfile updates for dependency changes
Files not reviewed (1)
  • npm-shrinkwrap.json: Language not supported

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

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

This PR does a quite a lot of work, and it's hard to review what's related to performance and what's not. Can we break it up into several PRs? A lot of changes seem unrelated (ie all the comment changes)

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

I'm gonna put a blocker on this for now, since it's really hard to review this many changes.

Can we try removing all of the rewritten comments, and then breaking this into what's perf related and what's not?

@ovflowd
Copy link
Member Author

ovflowd commented Nov 10, 2025

I'm gonna put a blocker on this for now, since it's really hard to review this many changes.

Can we try removing all of the rewritten comments, and then breaking this into what's perf related and what's not?

Unfortunately that was the AI-nonsense. I asked it to update tests and comments and it started spiralling out of control. That's what happens when I try to multitask, apologies.

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

I am no longer blocking, but I still have (a few) comments

@avivkeller avivkeller requested a review from Copilot November 10, 2025 20:57
Copy link
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

Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.

Files not reviewed (1)
  • npm-shrinkwrap.json: Language not supported

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

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

Image

@avivkeller avivkeller added the Web Generator `web`, `jsx-ast`, and `orama-db` label Nov 10, 2025
@ovflowd
Copy link
Member Author

ovflowd commented Nov 10, 2025

Image

😆

@ovflowd ovflowd requested a review from MattIPv4 November 11, 2025 01:25
@ovflowd ovflowd merged commit f857d38 into main Nov 11, 2025
19 checks passed
@ovflowd ovflowd deleted the feat/twoslash branch November 11, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Web Generator `web`, `jsx-ast`, and `orama-db`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants