Skip to content

feat(output): make output folding-friendly using #region - #1278

Closed
hyfdev wants to merge 1 commit into
mainfrom
05-29-feat_output_wrap_pretty_module_path_in_region_
Closed

hyfdev wants to merge 1 commit into
mainfrom
05-29-feat_output_wrap_pretty_module_path_in_region_

Conversation

@hyfdev

@hyfdev hyfdev commented May 29, 2024 •

Copy link
Copy Markdown
Member

Description

With #region

image

Without #region. If the bundling code is pure esm, the folded output code will be more ugly.

image

hyfdev commented May 29, 2024

Copy link
Copy Markdown
Member Author

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

Join @hyf0 and the rest of your teammates on Graphite Graphite

@netlify

netlify Bot commented May 29, 2024 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit f01c059
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/665706e0e03ddd00083213e6

@codecov

codecov Bot commented May 29, 2024 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.50%. Comparing base (97d425d) to head (f01c059).
Report is 45 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1278   +/-   ##
=======================================
  Coverage   87.49%   87.50%           
=======================================
  Files         134      134           
  Lines        6598     6601    +3     
=======================================
+ Hits         5773     5776    +3     
  Misses        825      825           

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

@hyfdev hyfdev changed the title feat(output): wrap pretty module path in #region feat(output): make output folding-friendly using #region May 29, 2024
@github-actions

Copy link
Copy Markdown
Contributor

Benchmarks Rust

  • target: main(88a7d9c)
  • pr: 05-29-feat_output_wrap_pretty_module_path_in_region_(674f0b3)
group                                      pr                                     target
-----                                      --                                     ------
rolldown benchmark/threejs-bundle          1.00     30.2±0.44ms        ? ?/sec    1.04     31.3±1.80ms        ? ?/sec
rolldown benchmark/threejs-scan            1.01     21.7±0.92ms        ? ?/sec    1.00     21.4±0.25ms        ? ?/sec
rolldown benchmark/threejs-sourcemap       1.06     43.9±1.09ms        ? ?/sec    1.00     41.2±0.67ms        ? ?/sec
rolldown benchmark/threejs10x-bundle       1.00    328.9±5.37ms        ? ?/sec    1.00    330.0±4.12ms        ? ?/sec
rolldown benchmark/threejs10x-scan         1.00    206.9±1.66ms        ? ?/sec    1.02    210.7±4.65ms        ? ?/sec
rolldown benchmark/threejs10x-sourcemap    1.00    450.9±7.98ms        ? ?/sec    1.00    451.5±9.89ms        ? ?/sec

@hyfdev
hyfdev force-pushed the 05-29-feat_output_wrap_pretty_module_path_in_region_ branch from 674f0b3 to f01c059 Compare May 29, 2024 10:43
@hyfdev

hyfdev commented May 29, 2024

Copy link
Copy Markdown
Member Author

I'm gonna close this PR for now due to main-stream IDE use different keywords. Will re-open it if there is any universal solution.

@hyfdev hyfdev closed this May 29, 2024
@codspeed

codspeed Bot commented May 29, 2024

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #1278 will not alter performance

Comparing 05-29-feat_output_wrap_pretty_module_path_in_region_ (f01c059) with main (4520a81)

Summary

✅ 6 untouched benchmarks

@hyfdev hyfdev reopened this Jun 3, 2024
@hyfdev hyfdev closed this Jun 4, 2024
@Brooooooklyn
Brooooooklyn deleted the 05-29-feat_output_wrap_pretty_module_path_in_region_ branch January 17, 2025 05:07
IWANABETHATGUY added a commit that referenced this pull request Oct 20, 2026
… pairs (#11235)

`experimental.attachDebugInfo: 'simple'` (the default) now writes a `//
<module id>` line where each module starts, like esbuild and Bun, and no
longer wraps each module in `//#region` / `//#endregion`.

The pairs came in with #1278 / #1330 so that VS Code and WebStorm can
fold each module of the output. Today few people read bundler output in
an editor, but agents read it often, and for an agent the pairs are only
extra tokens. The start line keeps the part that is still useful: which
file the code comes from.

The test harness used `//#endregion` to find where the runtime ends, so
`HiddenModuleMarkersPlugin` now wraps only the hidden modules in a
temporary region pair before the minify pass. Other markers are no
longer protected from the dce-only pass, so snapshots drop the same
markers that production builds drop. Vite's `rolldown-canary` tests
check the old markers, so they need an update there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant