Skip to content

feat(css)!: drop builtin CSS bundling to explore alternative solutions#8399

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-20-feat_css_emit_error_when_passing_moduletype_css_to_rolldown
Feb 20, 2026
Merged

feat(css)!: drop builtin CSS bundling to explore alternative solutions#8399
graphite-app[bot] merged 1 commit intomainfrom
02-20-feat_css_emit_error_when_passing_moduletype_css_to_rolldown

Conversation

@hyf0
Copy link
Member

@hyf0 hyf0 commented Feb 20, 2026

Motivation

I will remove CSS related code in another PR for having less chnages. This one is only for rejecting css input and ignore tests we're having.


Rolldown's builtin CSS bundling support is still experimental and immature. To give us room to explore other possible solutions for CSS handling, we are removing the current implementation. When a .css file enters the bundling pipeline as ModuleType::Css, rolldown now throws a clear error directing users to the tracking issue.

Tracking issue: #4271

Changes

1. Error on ModuleType::Css in module loading

  • crates/rolldown/src/module_loader/module_task.rs: Replaced the ModuleType::Css branch with an error: "Bundling CSS is not supported yet." with a link to the tracking issue.
  • crates/rolldown/src/css/mod.rs: Added #[expect(dead_code)] to create_css_view since it is no longer called.

2. Disabled CSS-only Rust tests (dot-prefix)

Renamed test directories to start with . so the #[fixture] macro skips them. 40 directories total:

  • rolldown tests (8 dirs): topics/css/{basic,css_entries,align_vite}, function/file/{css,js_css}, function/asset_filenames, sourcemap/css_sourcemap_reference, issues/3821
  • esbuild DCE tests (7 dirs): all tree_shaking_js_with_associated_css*
  • esbuild default tests (20 dirs): 15 legal_comments_* dirs with CSS entries, plus entry_names_chunk_names_ext_placeholder, line_limit_not_minified, metafile_no_bundle, metafile_various_cases, metafile_very_long_external_paths
  • esbuild loader tests (10 dirs): empty_loader_css, loader_copy_with_bundle_from_css, loader_copy_with_bundle_entry_point, loader_data_url_text_css*, loader_file_*_css

Also removed the pub mod asset_filenames declaration from crates/rolldown/tests/rolldown/function/mod.rs.

3. Removed CSS from mixed JS+CSS Node.js tests

Updated 7 test fixtures to strip CSS imports, CSS config options (cssEntryFileNames, cssChunkFileNames), CSS assertions, and CSS fixture files while keeping the JS parts intact:

  • packages/rolldown/tests/fixtures/output/file-names/{function,string}/
  • packages/rolldown/tests/fixtures/output/file-names/hash/{hex,base36,base64}/
  • packages/rolldown/tests/fixtures/output/hash-filenames/multi/
  • packages/rolldown/tests/fixtures/topics/preserve-modules/basic/

Tests not affected (kept as-is)

  • issues/1733/ — marks CSS as external via plugin, never hits ModuleType::Css
  • function/module_types/empty/ — maps .css to "empty" module type
  • resolve/module-css-should-have-high-priority/ — maps .module.css to "empty" module type

Verification

  • just build-rolldown — compiles
  • just test-rust — all tests pass
  • just test-node (main tests) — all 605 tests pass
  • just lint — passes (pre-existing packages/browser publint issue excluded)

Copy link
Member Author

hyf0 commented Feb 20, 2026


How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@hyf0 hyf0 changed the title feat!(css): emit error when passing ModuleType:css to rolldown feat!(css): remove experimental .css support, emit errors for bundling .css Feb 20, 2026
@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 157c672
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69987d572fe9b30008820acb
😎 Deploy Preview https://deploy-preview-8399--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hyf0 hyf0 marked this pull request as ready for review February 20, 2026 06:49
Copilot AI review requested due to automatic review settings February 20, 2026 06:49
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 removes experimental .css file bundling support from rolldown. The changes disable CSS bundling functionality and convert related tests to disabled state (prefixed with .).

Changes:

  • Removes CSS bundling capability, replacing it with an error message directing users to GitHub issue #4271
  • Disables CSS-related test configurations by prefixing their directories with .
  • Cleans up unused CSS module imports and marks the create_css_view function as dead code

Reviewed changes

Copilot reviewed 27 out of 339 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/rolldown/tests/rolldown/function/mod.rs Removes asset_filenames module reference
crates/rolldown/tests/esbuild/default/*_config.json Disables multiple legal_comments test configurations involving CSS
crates/rolldown/tests/esbuild/default/.*_config.json Adds disabled versions of legal_comments tests with . prefix
crates/rolldown/tests/esbuild/dce/*_config.json Disables tree_shaking CSS-related test configurations
crates/rolldown/tests/esbuild/dce/.*_config.json Adds disabled versions of tree_shaking tests with . prefix
crates/rolldown/src/module_loader/module_task.rs Replaces CSS bundling logic with error message and removes CSS imports
crates/rolldown/src/css/mod.rs Marks create_css_view function as dead code

@hyf0 hyf0 changed the title feat!(css): remove experimental .css support, emit errors for bundling .css feat!(css): drop builtin CSS bundling to explore alternative solutions Feb 20, 2026
@hyf0 hyf0 changed the title feat!(css): drop builtin CSS bundling to explore alternative solutions feat(css)!: drop builtin CSS bundling to explore alternative solutions Feb 20, 2026
@hyf0 hyf0 force-pushed the 02-20-feat_css_emit_error_when_passing_moduletype_css_to_rolldown branch from f915c34 to b547116 Compare February 20, 2026 06:53
@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2026

Benchmarks Rust

  • target: main(cf16fcb)
  • pr: 02-20-feat_css_emit_error_when_passing_moduletype_css_to_rolldown(ba92e11)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     67.9±3.05ms        ? ?/sec    1.05     71.4±4.32ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     73.7±3.07ms        ? ?/sec    1.03     76.2±2.52ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00     98.5±2.71ms        ? ?/sec    1.03    101.9±3.29ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    111.8±6.88ms        ? ?/sec    1.02    114.6±5.78ms        ? ?/sec
bundle/bundle@threejs                                        1.02     36.4±2.36ms        ? ?/sec    1.00     35.8±2.30ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     40.2±1.36ms        ? ?/sec    1.02     40.9±0.95ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00   364.2±16.60ms        ? ?/sec    1.01   368.7±22.41ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00   415.2±16.70ms        ? ?/sec    1.02   425.2±15.37ms        ? ?/sec
scan/scan@rome_ts                                            1.00     77.5±2.08ms        ? ?/sec    1.02     78.7±3.26ms        ? ?/sec
scan/scan@threejs                                            1.00     27.3±0.95ms        ? ?/sec    1.02     28.0±2.28ms        ? ?/sec
scan/scan@threejs10x                                         1.00    279.3±8.88ms        ? ?/sec    1.01    282.2±7.57ms        ? ?/sec

Copilot AI review requested due to automatic review settings February 20, 2026 08:49
@hyf0 hyf0 force-pushed the 02-20-feat_css_emit_error_when_passing_moduletype_css_to_rolldown branch from b547116 to c9a5af1 Compare February 20, 2026 08:49
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 27 out of 344 changed files in this pull request and generated 3 comments.

@hyf0 hyf0 force-pushed the 02-20-feat_css_emit_error_when_passing_moduletype_css_to_rolldown branch from c9a5af1 to ba92e11 Compare February 20, 2026 12:14
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 20, 2026

Merge activity

#8399)

## Motivation

I will remove CSS related code in another PR for having less chnages. This one is only for rejecting css input and ignore tests we're having.

---

Rolldown's builtin CSS bundling support is still experimental and immature. To give us room to explore other possible solutions for CSS handling, we are removing the current implementation. When a `.css` file enters the bundling pipeline as `ModuleType::Css`, rolldown now throws a clear error directing users to the tracking issue.

Tracking issue: #4271

## Changes

### 1. Error on `ModuleType::Css` in module loading

- **`crates/rolldown/src/module_loader/module_task.rs`**: Replaced the `ModuleType::Css` branch with an error: *"Bundling CSS is not supported yet."* with a link to the tracking issue.
- **`crates/rolldown/src/css/mod.rs`**: Added `#[expect(dead_code)]` to `create_css_view` since it is no longer called.

### 2. Disabled CSS-only Rust tests (dot-prefix)

Renamed test directories to start with `.` so the `#[fixture]` macro skips them. **40 directories** total:

- **rolldown tests** (8 dirs): `topics/css/{basic,css_entries,align_vite}`, `function/file/{css,js_css}`, `function/asset_filenames`, `sourcemap/css_sourcemap_reference`, `issues/3821`
- **esbuild DCE tests** (7 dirs): all `tree_shaking_js_with_associated_css*`
- **esbuild default tests** (20 dirs): 15 `legal_comments_*` dirs with CSS entries, plus `entry_names_chunk_names_ext_placeholder`, `line_limit_not_minified`, `metafile_no_bundle`, `metafile_various_cases`, `metafile_very_long_external_paths`
- **esbuild loader tests** (10 dirs): `empty_loader_css`, `loader_copy_with_bundle_from_css`, `loader_copy_with_bundle_entry_point`, `loader_data_url_text_css*`, `loader_file_*_css`

Also removed the `pub mod asset_filenames` declaration from `crates/rolldown/tests/rolldown/function/mod.rs`.

### 3. Removed CSS from mixed JS+CSS Node.js tests

Updated **7 test fixtures** to strip CSS imports, CSS config options (`cssEntryFileNames`, `cssChunkFileNames`), CSS assertions, and CSS fixture files while keeping the JS parts intact:

- `packages/rolldown/tests/fixtures/output/file-names/{function,string}/`
- `packages/rolldown/tests/fixtures/output/file-names/hash/{hex,base36,base64}/`
- `packages/rolldown/tests/fixtures/output/hash-filenames/multi/`
- `packages/rolldown/tests/fixtures/topics/preserve-modules/basic/`

### Tests not affected (kept as-is)

- `issues/1733/` — marks CSS as external via plugin, never hits `ModuleType::Css`
- `function/module_types/empty/` — maps `.css` to `"empty"` module type
- `resolve/module-css-should-have-high-priority/` — maps `.module.css` to `"empty"` module type

## Verification

- `just build-rolldown` — compiles
- `just test-rust` — all tests pass
- `just test-node` (main tests) — all 605 tests pass
- `just lint` — passes (pre-existing `packages/browser publint` issue excluded)
Copilot AI review requested due to automatic review settings February 20, 2026 15:27
@graphite-app graphite-app bot force-pushed the 02-20-feat_css_emit_error_when_passing_moduletype_css_to_rolldown branch from ba92e11 to 157c672 Compare February 20, 2026 15:27
@hyf0 hyf0 review requested due to automatic review settings February 20, 2026 15:27
@graphite-app graphite-app bot merged commit 157c672 into main Feb 20, 2026
34 checks passed
@graphite-app graphite-app bot deleted the 02-20-feat_css_emit_error_when_passing_moduletype_css_to_rolldown branch February 20, 2026 15:39
@github-actions github-actions bot mentioned this pull request Feb 25, 2026
This was referenced Feb 26, 2026
shulaoda added a commit that referenced this pull request Feb 26, 2026
## [1.0.0-rc.6] - 2026-02-26

### 💥 BREAKING CHANGES

- css: remove `css_entry_filenames` , `css_chunk_filenames` and related code (#8402) by @hyf0
- css: drop builtin CSS bundling to explore alternative solutions (#8399) by @hyf0

### 🚀 Features

- rust/data-url: use hash as id for data url modules to prevent long string overhead (#8420) by @hyf0
- validate bundle stays within output dir (#8441) by @sapphi-red
- rust: support `PluginOrder::PinPost` (#8417) by @hyf0
- support `ModuleType:Copy` (#8407) by @hyf0
- expose `ESTree` types from `rolldown/utils` (#8400) by @sapphi-red

### 🐛 Bug Fixes

- incorrect sourcemap when postBanner/postFooter is used with shebang (#8459) by @Copilot
- resolver: disable node_path option to align ESM resolver behavior (#8472) by @sapphi-red
- parse `.js` within `"type": "commonjs"` as ESM for now (#8470) by @sapphi-red
- case-insensitive filename conflict detection for chunk deduplication (#8458) by @Copilot
- prevent inlining CJS exports that are mutated by importers (#8456) by @IWANABETHATGUY
- parse `.cjs` / `.cts` / `.js` within `"type": "commonjs"` as CommonJS (#8455) by @sapphi-red
- plugin/copy-module: correct hooks' priority (#8423) by @hyf0
- plugin/chunk-import-map: ensure `render_chunk_meta` run after users plugin (#8422) by @hyf0
- rust: correct hooks order of `DataUriPlugin` (#8418) by @hyf0
- `jsx.preserve` should also considering tsconfig json preserve (#8324) by @IWANABETHATGUY
- `deferred_scan_data.rs "Should have resolved id: NotFound"` error (#8379) by @sapphi-red
- cli: require value for `--dir`/`-d` and `--file`/`-o` (#8378) by @Copilot
- dev: avoid mutex deadlock caused by inconsistent lock order (#8370) by @sapphi-red

### 🚜 Refactor

- watch: rename TaskStart/TaskEnd to BundleStart/BundleEnd (#8463) by @hyf0
- rust: rename `rolldown_plugin_data_uri` to `rolldown_plugin_data_url` (#8421) by @hyf0
- bindingify-build-hook: extract helper for PluginContextImpl (#8438) by @ShroXd
- give source loading a proper name (#8436) by @IWANABETHATGUY
- ban holding DashMap refs across awaits (#8362) by @sapphi-red

### 📚 Documentation

- add glob pattern usage example to input option (#8469) by @IWANABETHATGUY
- remove `https://rolldown.rs` from links in reference docs (#8454) by @sapphi-red
- mention execution order issue in `output.codeSplitting` docs (#8452) by @sapphi-red
- clarify `output.comments` behavior a bit (#8451) by @sapphi-red
- replace npmjs package links with npmx.dev (#8439) by @Boshen
- reference: add `Exported from` for values / types exported from subpath exports (#8394) by @sapphi-red
- add JSDocs for APIs exposed from subpath exports (#8393) by @sapphi-red
- reference: generate reference pages for APIs exposed from subpath exports (#8392) by @sapphi-red
- avoid pipe character in codeSplitting example to fix broken rendering (#8391) by @IWANABETHATGUY

### ⚡ Performance

- avoid redundant PathBuf allocations in resolve paths (#8435) by @Brooooooklyn
- bump to `sugar_path@2` (#8432) by @hyf0
- use flag-based convergence detection in include_statements (#8412) by @Brooooooklyn

### 🧪 Testing

- execute `_test.mjs` even if `executeOutput` is false (#8398) by @sapphi-red
- add retry to tree-shake/module-side-effects-proxy4 as it is flaky (#8397) by @sapphi-red
- avoid `expect.assertions()` as it is not concurrent test friendly (#8383) by @sapphi-red
- disable `mockReset` option (#8382) by @sapphi-red
- fix flaky failure caused by concurrent resolveId calls (#8381) by @sapphi-red

### ⚙️ Miscellaneous Tasks

- deps: update dependency rollup to v4.59.0 [security] (#8471) by @renovate[bot]
- ai/design: add design doc about watch mode (#8453) by @hyf0
- deps: update oxc resolver to v11.19.0 (#8461) by @renovate[bot]
- ai: introduce progressive spec-driven development pattern (#8446) by @hyf0
- deprecate output.legalComments (#8450) by @sapphi-red
- deps: update dependency oxlint-tsgolint to v0.15.0 (#8448) by @renovate[bot]
- ai: make CLAUDE.md a symlink of AGENTS.md (#8445) by @hyf0
- deps: update rollup submodule for tests to v4.59.0 (#8433) by @sapphi-red
- deps: update test262 submodule for tests (#8434) by @sapphi-red
- deps: update oxc to v0.115.0 (#8430) by @renovate[bot]
- deps: update oxc apps (#8429) by @renovate[bot]
- deps: update npm packages (#8426) by @renovate[bot]
- deps: update rust crate owo-colors to v4.3.0 (#8428) by @renovate[bot]
- deps: update github-actions (#8424) by @renovate[bot]
- deps: update rust crates (#8425) by @renovate[bot]
- deps: update oxc resolver to v11.18.0 (#8406) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.14.2 (#8405) by @renovate[bot]
- ban `expect.assertions` in all fixture tests (#8395) by @sapphi-red
- deps: update oxc apps (#8389) by @renovate[bot]
- ban `expect.assertions` in fixture tests (#8387) by @sapphi-red
- enable lint for `_config.ts` files (#8386) by @sapphi-red
- deps: update dependency oxlint-tsgolint to v0.14.1 (#8385) by @renovate[bot]

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
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.

3 participants