Skip to content

Does not add an extra leading line feed for addons#6403

Merged
lukastaegert merged 3 commits into
masterfrom
fix/6401
Jun 3, 2026
Merged

Does not add an extra leading line feed for addons#6403
lukastaegert merged 3 commits into
masterfrom
fix/6401

Conversation

@TrickyPi
Copy link
Copy Markdown
Member

@TrickyPi TrickyPi commented Jun 2, 2026

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
resolves #6401

Description

Copilot AI review requested due to automatic review settings June 2, 2026 07:01
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

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

Project Deployment Actions Updated (UTC)
rollup Ready Ready Preview, Comment Jun 3, 2026 7:10am

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#fix/6401

Notice: Ensure you have installed the latest nightly Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust.

or load it into the REPL:
https://rollup-oz84d98kf-rollup-js.vercel.app/repl/?pr=6403

Copy link
Copy Markdown
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

Fixes a formatting bug where addon hooks (banner/intro/outro/footer) could introduce an unintended leading line feed when the first addon content originates from plugins (i.e., the initial option value is empty), aligning output with expected “addon starts at byte 0” behavior (resolves #6401).

Changes:

  • Update addon concatenation logic to only insert separators (\n / \n\n) when there is already prior content.
  • Adjust the existing enforce-addon-order expected output to match the corrected newline behavior.
  • Add a new form sample that asserts no extra leading line feed across all major output formats.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/addons.ts Prevents leading separators when concatenating the first addon contribution.
test/form/samples/enforce-addon-order/_expected.js Updates fixture to remove now-unwanted leading/extra blank lines.
test/form/samples/addon-functions-no-extra-leading-line-feed/_config.js New regression test config covering plugin-provided addons with empty initial values.
test/form/samples/addon-functions-no-extra-leading-line-feed/main.js Minimal entry for the new regression sample.
test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/amd.js Expected output ensuring banner starts without a leading LF (AMD).
test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/cjs.js Expected output ensuring banner starts without a leading LF (CJS).
test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/es.js Expected output ensuring banner starts without a leading LF (ES).
test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/iife.js Expected output ensuring banner starts without a leading LF (IIFE).
test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/system.js Expected output ensuring banner starts without a leading LF (System).
test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/umd.js Expected output ensuring banner starts without a leading LF (UMD).

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Performance report

  • BUILD: 7088ms, 829 MB (-3%)
    • initialize: 0ms, 23.9 MB
    • generate module graph: 2716ms, 635 MB
      • generate ast: 1395ms (-33ms, -2.3%), 626 MB
    • sort and bind modules: 408ms, 698 MB
    • mark included statements: 3951ms, 829 MB (-3%)
      • treeshaking pass 1: 2325ms, 821 MB (-3%)
      • treeshaking pass 2: 460ms, 838 MB
      • treeshaking pass 3: 394ms, 827 MB (-3%)
      • treeshaking pass 4: 382ms, 847 MB (+3%)
      • treeshaking pass 5: 379ms, 829 MB (-3%)
  • GENERATE: 685ms, 921 MB
    • initialize render: 0ms, 829 MB (-3%)
    • generate chunks: 38ms, 838 MB
      • optimize chunks: 0ms, 846 MB (-3%)
    • render chunks: 635ms, 895 MB
    • transform chunks: 16ms, 921 MB
    • generate bundle: 0ms, 921 MB

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.78%. Comparing base (765167f) to head (e546f28).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6403   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files         274      274           
  Lines       10785    10785           
  Branches     2882     2882           
=======================================
  Hits        10654    10654           
  Misses         89       89           
  Partials       42       42           

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

Comment thread src/utils/addons.ts Outdated
Co-authored-by: Lukas Taegert-Atkinson <[email protected]>
@lukastaegert lukastaegert added this pull request to the merge queue Jun 3, 2026
Merged via the queue into master with commit 7bdce6c Jun 3, 2026
48 checks passed
@lukastaegert lukastaegert deleted the fix/6401 branch June 3, 2026 08:45
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

This PR has been released as part of [email protected]. You can test it via npm install rollup.

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.

always one LF above plugin added banner

3 participants