Skip to content

Comments

feat: Support output.paths#6470

Merged
graphite-app[bot] merged 1 commit intomainfrom
10-09-feat_output.paths
Oct 10, 2025
Merged

feat: Support output.paths#6470
graphite-app[bot] merged 1 commit intomainfrom
10-09-feat_output.paths

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Oct 9, 2025

Closed #5750

Copy link
Member Author


How to use the Graphite Merge Queue

Add the label graphite: merge 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.

@netlify
Copy link

netlify bot commented Oct 9, 2025

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 5de4f34
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/68e78a94cb123c00082a1492

@netlify
Copy link

netlify bot commented Oct 9, 2025

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit fcf74bc
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/68e8ccc7d5a81500089a8456
😎 Deploy Preview https://deploy-preview-6470--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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

Benchmarks Rust

group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     71.5±1.77ms        ? ?/sec    1.02     72.9±4.09ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     78.1±2.02ms        ? ?/sec    1.01     79.1±1.59ms        ? ?/sec
bundle/bundle@rome_ts                                        1.01    113.9±2.66ms        ? ?/sec    1.00    113.2±1.92ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    129.6±1.83ms        ? ?/sec    1.00    130.2±1.71ms        ? ?/sec
bundle/bundle@threejs                                        1.01     45.5±2.94ms        ? ?/sec    1.00     45.2±0.70ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     52.0±1.20ms        ? ?/sec    1.00     52.0±0.71ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    440.1±6.43ms        ? ?/sec    1.00    440.2±4.98ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    502.8±4.85ms        ? ?/sec    1.00    503.3±3.63ms        ? ?/sec
scan/scan@rome_ts                                            1.00     89.0±2.25ms        ? ?/sec    1.00     88.7±1.82ms        ? ?/sec
scan/scan@threejs                                            1.02     33.3±0.49ms        ? ?/sec    1.00     32.8±0.41ms        ? ?/sec
scan/scan@threejs10x                                         1.02    342.1±5.07ms        ? ?/sec    1.00    336.6±4.89ms        ? ?/sec

@IWANABETHATGUY IWANABETHATGUY force-pushed the 10-09-feat_output.paths branch 4 times, most recently from 3afdf9f to bab0e91 Compare October 10, 2025 07:43
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review October 10, 2025 07:45
@IWANABETHATGUY IWANABETHATGUY changed the title feat: output.paths feat: Support output.paths Oct 10, 2025
@IWANABETHATGUY IWANABETHATGUY changed the title feat: Support output.paths feat: Support output.paths Oct 10, 2025
@IWANABETHATGUY IWANABETHATGUY requested review from hyf0 and shulaoda and removed request for shulaoda October 10, 2025 08:03
@hyf0 hyf0 requested a review from Copilot October 10, 2025 08:04
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 implements support for the output.paths configuration option, which allows mapping external module IDs to custom paths for imports. This enables loading dependencies from CDNs or custom locations instead of using the original module names.

  • Added paths configuration option that accepts either a string map or function for module ID mapping
  • Updated code generation to use mapped paths when resolving external module imports across all output formats
  • Added comprehensive test coverage for both object and function forms of the paths option

Reviewed Changes

Copilot reviewed 27 out of 29 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/rolldown/src/options/output-options.ts Added paths interface definition with comprehensive JSDoc documentation
packages/rolldown/src/utils/validator.ts Added validation schema for paths option supporting both object and function forms
packages/rolldown/src/utils/bindingify-output-options.ts Added paths to the binding options transformation
crates/rolldown_common/src/inner_bundler_options/types/output_option/paths.rs Implemented core PathsOutputOption enum with async function support
crates/rolldown_common/src/module/external_module.rs Modified import path resolution to use paths mapping when available
crates/rolldown/src/ecmascript/format/*.rs Updated all output format renderers to apply paths mapping to external imports
packages/rolldown/tests/fixtures/output/paths/* Added test fixtures for both map and function usage patterns

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@IWANABETHATGUY
Copy link
Member Author

IWANABETHATGUY commented Oct 10, 2025

I need to refactor some code to support call_sync of JsCallback, let's merge this pr first since this only affect user when they use output.paths with less tokio thread.

@IWANABETHATGUY IWANABETHATGUY force-pushed the 10-09-feat_output.paths branch from bab0e91 to f686c55 Compare October 10, 2025 08:51
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 10, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 10-09-feat_output.paths branch from f686c55 to fcf74bc Compare October 10, 2025 09:07
@graphite-app graphite-app bot merged commit fcf74bc into main Oct 10, 2025
29 checks passed
@graphite-app graphite-app bot deleted the 10-09-feat_output.paths branch October 10, 2025 09:24
shulaoda pushed a commit that referenced this pull request Oct 13, 2025
## [1.0.0-beta.43] - 2025-10-13

### 🚀 Features

- add filterVitePlugins utility that uses to skip vite plugins using apply: "serve" (#6502) by @IWANABETHATGUY
- rolldown_plugin_vite_html: align partial can inline entry logic (#6500) by @shulaoda
- rolldown_plugin_vite_html: align get_imported_chunks logic (#6499) by @shulaoda
- rolldown_plugin_vite_html: align HtmlTagDescriptor (#6498) by @shulaoda
- rolldown_plugin_vite_html: align partial utility functions logic (#6497) by @shulaoda
- rolldown_html_vite_html: align partial inject chunk asset links logic (#6496) by @shulaoda
- rolldown_plugin_vite_html: align `processedHtml` logic (#6494) by @shulaoda
- add `nativeMagicString` options (#6469) by @IWANABETHATGUY
- rust: eagerly cleanup resources when calling `close` (#6483) by @hyf0
- rust: varify if bundler is closed for public API (#6481) by @hyf0
- replace [format] placeholder in chunk filename templates (#6476) by @elecmonkey
- implement synchronous JS callback invocation for paths function (#6474) by @IWANABETHATGUY
- rolldown_plugin_vite_html: align partial transform hook logic (#6471) by @shulaoda
- Support `output.paths` (#6470) by @IWANABETHATGUY
- rolldown_plugin_vite_html: align script urls handle logic (#6466) by @shulaoda
- add validation for `preserveEntrySignatures` with `includeDependenciesRecursively` option (#6468) by @hyf0
- rolldown_plugin_vite_html: align partial logic (#6465) by @shulaoda
- background sourcemap generation for Javascript transform hooks (#6293) by @IWANABETHATGUY
- rolldown_plugin_vite_html: handle style tag (#6464) by @shulaoda
- rolldown_plugin_vite_html: handle inline style attribute (#6463) by @shulaoda
- rolldown_plugin_vite_html: patially handle vite-ignore attribute (#6462) by @shulaoda
- dev/node: expose errors of `on_hmr_updatrs` to node (#6454) by @hyf0
- dev/node: expose errors of `on_output` to node (#6453) by @hyf0
- dev: expose hmr errors on `on_hmr_updatrs` callback (#6443) by @hyf0

### 🐛 Bug Fixes

- fallback sourcemap generation for `experimental.nativeMagicString: false` (#6488) by @IWANABETHATGUY
- take `resolve.modules` into account (#6484) by @Pickachu
- rolldown: increase tokio blocking threads size for watch mode (#6467) by @Brooooooklyn
- use len_utf16 in magic_string CharToByteMapper (#6461) by @IWANABETHATGUY
- pass `advancedChunks#includeDependenciesRecursively` to rust (#6448) by @hyf0
- dev: should compute hmr update correctly for multiple clients (#6442) by @hyf0
- allow specifying packageJsonPath in PluginContext.load (#6439) by @sapphi-red
- use transform.target as default for minify target when `minify: { compress: true }` (#6433) by @sapphi-red

### 🚜 Refactor

- extract background sourcemap handling into separate methods (#6501) by @IWANABETHATGUY
- rust: only expose methods of `Bundler` for public usage (#6480) by @hyf0
- dev/node: use napi object instead clss for `BindingClientHmrUpdate` (#6456) by @hyf0
- dev/node: improve `DevOnHmrUpdates` API (#6455) by @hyf0

### 📚 Documentation

- update team page and add acknowledgements page (#6495) by @hyf0
- restructure website and files (#6492) by @hyf0
- correct incorrect documentation about the config file (#6472) by @jsparkdev
- options: `experimental.strictExecutionOrder` (#6450) by @hyf0
- adding `why-plugin-hook-filter` in depth (#6446) by @IWANABETHATGUY

### ⚡ Performance

- rolldown: replace serde JSON string escape with simd impl (#6475) by @Brooooooklyn

### ⚙️ Miscellaneous Tasks

- docs: redirect removed path to new locations for compatibility (#6493) by @hyf0
- deps: lock file maintenance npm packages (#6490) by @renovate[bot]
- deps: update github-actions (major) (#6415) by @renovate[bot]
- deps: update github-actions (#6489) by @renovate[bot]
- rust: add comment for `DiagnosticOptions#stabilize_path` (#6447) by @hyf0
- rust: remove unused `BindingHmrOutput` (#6457) by @hyf0
- rolldown_plugin_vite_html: tweak `utils.rs` (#6460) by @shulaoda
- change node version to lts (#6435) by @iiio2
- rust/test: split hmr related structs into their own files (#6445) by @hyf0
- deps: update crate-ci/typos action to v1.38.1 (#6452) by @renovate[bot]
- rust/test: render hmr errors (#6444) by @hyf0
- examples: add `"type": "module"` in `package.json` (#6441) by @iiio2

### ❤️ New Contributors

* @Pickachu made their first contribution in [#6484](#6484)
* @elecmonkey made their first contribution in [#6476](#6476)
* @jsparkdev made their first contribution in [#6472](#6472)
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.

[Feature Request]: Missing output.paths option in Rolldown OutputOptions interface

2 participants