Skip to content

feat: support decorators before or after export#5871

Merged
lukastaegert merged 3 commits intomasterfrom
fix/5859
Mar 23, 2025
Merged

feat: support decorators before or after export#5871
lukastaegert merged 3 commits intomasterfrom
fix/5859

Conversation

@TrickyPi
Copy link
Member

@TrickyPi TrickyPi commented Mar 5, 2025

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 #5859

Description

The resolution is based on this idea #5859 (comment)

@vercel
Copy link

vercel bot commented Mar 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 21, 2025 0:55am

@github-actions
Copy link

github-actions bot commented Mar 5, 2025

Thank you for your contribution! ❤️

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

npm install rollup/rollup#fix/5859

Notice: Ensure you have installed the latest stable 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-mvx05p7y6-rollup-js.vercel.app/repl/?pr=5871

@github-actions
Copy link

github-actions bot commented Mar 5, 2025

Performance report

  • BUILD: 7361ms, 746 MB
    • initialize: 0ms, 28.2 MB
    • generate module graph: 2813ms, 560 MB
      • generate ast: 1285ms, 553 MB
    • sort and bind modules: 405ms, 606 MB
    • mark included statements: 4140ms, 746 MB
      • treeshaking pass 1: 2439ms, 741 MB
      • treeshaking pass 2: 479ms, 745 MB
      • treeshaking pass 3: 413ms, 744 MB
      • treeshaking pass 4: 404ms, 750 MB
      • treeshaking pass 5: 396ms, 746 MB
  • GENERATE: 758ms, 986 MB
    • initialize render: 0ms, 883 MB
    • generate chunks: 74ms, 893 MB
      • optimize chunks: 0ms, 891 MB
    • render chunks: 666ms, 963 MB
    • transform chunks: 16ms, 986 MB
    • generate bundle: 0ms, 986 MB

@codecov
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.55%. Comparing base (384d533) to head (b1c8663).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5871   +/-   ##
=======================================
  Coverage   98.55%   98.55%           
=======================================
  Files         269      269           
  Lines        8584     8588    +4     
  Branches     1472     1472           
=======================================
+ Hits         8460     8464    +4     
  Misses         92       92           
  Partials       32       32           

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

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

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

This already looks quite good, but I think we need to also cover the case where there are both inside and outside decorators.

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

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

Great work, this works really well now! I also noticed that we throw a readable error in case decorators appear on both positions, so I will merge this now.

@lukastaegert lukastaegert added this pull request to the merge queue Mar 23, 2025
Merged via the queue into master with commit a48b515 Mar 23, 2025
41 checks passed
@lukastaegert lukastaegert deleted the fix/5859 branch March 23, 2025 06:13
@github-actions
Copy link

This PR has been released as part of rollup@4.37.0. 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.

Allow use of export keyword between (JS) decorator and class

2 participants