Skip to content

fix(rolldown): dynamic import#615

Open
avivkeller wants to merge 2 commits intomainfrom
dynamic-rolldown
Open

fix(rolldown): dynamic import#615
avivkeller wants to merge 2 commits intomainfrom
dynamic-rolldown

Conversation

@avivkeller
Copy link
Member

This prevents non-web generators from throwing errors on machines that don't support the new generators.

In the future, we will need a permanent solution (likely just not generating on these minority distros), but for now, this is a low-impact fix.

Copilot AI review requested due to automatic review settings February 18, 2026 19:48
@avivkeller avivkeller requested a review from a team as a code owner February 18, 2026 19:48
@vercel
Copy link

vercel bot commented Feb 18, 2026

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

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Feb 18, 2026 7:54pm

Request Review

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.62%. Comparing base (32a824c) to head (e07fbb7).

Files with missing lines Patch % Lines
src/generators/web/utils/bundle.mjs 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #615      +/-   ##
==========================================
- Coverage   78.62%   78.62%   -0.01%     
==========================================
  Files         128      128              
  Lines       12461    12468       +7     
  Branches      902      902              
==========================================
+ Hits         9798     9803       +5     
- Misses       2658     2660       +2     
  Partials        5        5              

☔ 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.

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

orama-db Generator

File Base Head Diff
orama-db.json 8.03 MB 8.03 MB -1.78 KB (-0.02%)

web Generator

File Base Head Diff
styles.css 128.14 KB 128.21 KB +67.00 B (+0.05%)

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 reduces runtime/import-time failures on platforms that don’t support certain native bindings by deferring/avoiding problematic imports in the web generator pipeline.

Changes:

  • Switch Lightning CSS usage in the web generator from lightningcss to lightningcss-wasm.
  • Replace the static rolldown import with a lazy dynamic import so it isn’t loaded unless bundling runs.
  • Update dependency metadata (Dependabot + shrinkwrap) to reflect the new package.

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/generators/web/utils/processing.mjs Uses lightningcss-wasm for final CSS minification.
src/generators/web/utils/css.mjs Uses lightningcss-wasm for CSS modules bundling.
src/generators/web/utils/bundle.mjs Lazily imports rolldown and resolves build at runtime.
package.json Replaces lightningcss with lightningcss-wasm dependency.
npm-shrinkwrap.json Lockfile updates for lightningcss-wasm and removal of root lightningcss.
.github/dependabot.yml Updates the dependency group pattern to lightningcss-wasm.

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@avivkeller avivkeller added the fast track This PR can land before the typical review time, with a :+1: from collaborators label Feb 18, 2026
Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

Wait, isn't the web generator already lazily imported? Why is it throwing error then?

@avivkeller
Copy link
Member Author

@ovflowd We load all the generators on the main thread to extract the configuration options. They are dynamically loaded on threads

@avivkeller avivkeller requested a review from ovflowd February 19, 2026 13:35
@ovflowd
Copy link
Member

ovflowd commented Feb 19, 2026

@ovflowd We load all the generators on the main thread to extract the configuration options. They are dynamically loaded on threads

Im fairly sure I changed the generators list so that the values only load when called. Why do we load all generators on main thread? We shouldn't. All we do is access the keys.

@avivkeller
Copy link
Member Author

We need to import the generator files on the main thread as a part of initializing configuration values. Feel free to check the code base, I’m certain of this behavior. It’s intentional, as we need to access more than just the named keys.

@ovflowd
Copy link
Member

ovflowd commented Feb 19, 2026

Then let's close this PR, Ill change the generators structure so instead of the value being lazy, the actual impl being lazy, hold tight.

@avivkeller
Copy link
Member Author

Let’s leave this open, should we need to come back to this, but sure

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

Labels

fast track This PR can land before the typical review time, with a :+1: from collaborators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments