Skip to content

build(website): build with rolldown and swc#1071

Merged
yamadashy merged 6 commits intoyamadashy:mainfrom
TheAlexLichter:website-rolldown-swc
Jan 4, 2026
Merged

build(website): build with rolldown and swc#1071
yamadashy merged 6 commits intoyamadashy:mainfrom
TheAlexLichter:website-rolldown-swc

Conversation

@TheAlexLichter
Copy link
Contributor

@TheAlexLichter TheAlexLichter commented Jan 3, 2026

Bundles with Rolldown + swc as minifier via plugin.
This yields a 4.7M server.mjs for me.

image

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

This PR migrates the server bundling process from esbuild to Rolldown with SWC minification. Three new dependencies are added (@swc/core, rolldown, rollup-plugin-swc3), and the build script is updated to use Rolldown's API, configuration options, and SWC plugin instead of esbuild-specific implementations.

Changes

Cohort / File(s) Summary
Dependency additions
website/server/package.json
Added @swc/core ^1.15.8, rolldown ^1.0.0-beta.58, and rollup-plugin-swc3 ^0.12.1 as new build dependencies. No existing dependencies modified.
Bundler migration to Rolldown
website/server/scripts/bundle.mjs
Replaced esbuild with Rolldown for bundling. Updated imports, function name (bundleWithEsbuild → bundleWithRolldown), configuration (treeshake, SWC minification plugin), and build pipeline to generate dist-bundled/server.mjs with ES module output and banner preservation. WASM collection and post-bundle steps unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks required checklist items (npm run test, npm run lint) from the template and provides minimal context about the changes. Add the required checklist section with test and lint verification items before merging.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'build(website): build with rolldown and swc' clearly and concisely summarizes the main change: replacing the build tool from esbuild to rolldown with swc as the minifier.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @TheAlexLichter, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the website server's build pipeline by switching the primary bundling tool from esbuild to Rolldown, leveraging SWC for compilation and minification. This strategic move is designed to enhance the efficiency and output size of the server-side JavaScript bundle, contributing to overall performance improvements.

Highlights

  • Build Tool Migration: The website server's bundling process has been migrated from esbuild to Rolldown for improved performance and optimization.
  • New Dependencies: New dependencies @swc/core, rolldown, and rollup-plugin-swc3 have been added to support the new bundling strategy.
  • Bundling Script Refactor: The bundle.mjs script was updated to utilize Rolldown with the SWC plugin for minification and aggressive tree-shaking, replacing the previous esbuild implementation.
  • Optimized Output: The change aims to produce a more optimized server.mjs bundle, with the author noting a size of 4.7M.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the website server's bundling process from esbuild to Rolldown with SWC, aiming for a smaller bundle size. The changes are concentrated in the build script and package configuration files. My review highlights a few key areas for improvement:

  • Dependency Management: Build-time tools should be in devDependencies.
  • Build Configuration: The Rolldown configuration can be simplified by removing a redundant plugin.
  • Code Safety: The tree-shaking options are very aggressive and could lead to incorrect builds.
  • Code Style: There's a minor style inconsistency in function declarations.

Overall, this is a good step towards optimizing the build, and with a few adjustments, it will be ready to merge.

Copy link
Contributor

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
website/server/package.json (1)

31-31: Remove unused esbuild dependency.

The esbuild dependency is no longer used after migrating to Rolldown. Consider removing it to keep the dependencies clean and reduce potential confusion.

🔎 Proposed fix
   "devDependencies": {
     "@types/node": "^24.10.4",
     "@typescript/native-preview": "^7.0.0-dev.20251226.1",
-    "esbuild": "^0.27.2",
     "rimraf": "^6.1.2",
     "tsx": "^4.21.0",
     "typescript": "^5.9.3"
   }
website/server/scripts/bundle.mjs (1)

14-14: Add missing semicolon for consistency.

Line 14 is missing a trailing semicolon, which is inconsistent with the semicolon usage on line 13 and throughout the rest of the file.

🔎 Proposed fix
-import { swc, defineRollupSwcOption } from 'rollup-plugin-swc3'
+import { swc, defineRollupSwcOption } from 'rollup-plugin-swc3';
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 218f0db and 86c99d6.

⛔ Files ignored due to path filters (1)
  • website/server/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • website/server/package.json
  • website/server/scripts/bundle.mjs
🔇 Additional comments (1)
website/server/scripts/bundle.mjs (1)

49-55: Tree-shaking configuration is validated at build time.

The aggressive tree-shaking settings are intentional and already tested through the bundled build process. The warmup.mjs script imports the entire bundled server.mjs during Docker build, which would fail if tree-shaking broke critical module initialization, property access, or side effects. This validation happens for every build, and the configuration is working correctly in production deployments.

@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.19%. Comparing base (218f0db) to head (bfcf055).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1071   +/-   ##
=======================================
  Coverage   87.19%   87.19%           
=======================================
  Files         116      116           
  Lines        4350     4350           
  Branches     1011     1011           
=======================================
  Hits         3793     3793           
  Misses        557      557           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yamadashy
Copy link
Owner

@TheAlexLichter
Thanks for the contribution!
I've verified it works on my end, so I'll merge this.

Once this fix is available in Rolldown, I plan to remove the SWC plugin and switch to oxc.

@yamadashy yamadashy merged commit 0773453 into yamadashy:main Jan 4, 2026
53 checks passed
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.

2 participants