Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: find whitespace from operator position to start #5584

Merged
merged 1 commit into from
Jul 27, 2024
Merged

Conversation

TrickyPi
Copy link
Member

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

Description

Copy link

vercel bot commented Jul 21, 2024

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 Jul 21, 2024 4:38pm

Copy link

github-actions bot commented Jul 21, 2024

Thank you for your contribution! ❤️

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

npm install rollup/rollup#fix-5583

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-5kj4kflxf-rollup-js.vercel.app/repl/?pr=5584

Copy link

github-actions bot commented Jul 21, 2024

Performance report!

Rough benchmark

Command Mean [s] Min [s] Max [s] Relative
node _benchmark/previous/bin/rollup -i ./perf/entry.js -o _benchmark/result/previous.js 9.177 ± 0.025 9.161 9.206 1.00 ± 0.00
node _benchmark/current/bin/rollup -i ./perf/entry.js -o _benchmark/result/current.js 9.171 ± 0.021 9.152 9.194 1.00

Internal benchmark

  • BUILD: 8112ms, 748 MB
    • initialize: 0ms, 25.9 MB
    • generate module graph: 3128ms, 574 MB
      • generate ast: 1530ms, 567 MB
    • sort and bind modules: 451ms, 621 MB
    • mark included statements: 4536ms, 748 MB
      • treeshaking pass 1: 1534ms, 715 MB
      • treeshaking pass 2: 737ms, 744 MB
      • treeshaking pass 3: 290ms, 745 MB
      • treeshaking pass 4: 269ms, 744 MB
      • treeshaking pass 5: 314ms, 747 MB
      • treeshaking pass 6: 257ms, 755 MB
      • treeshaking pass 7: 242ms, 753 MB
      • treeshaking pass 8: 235ms, 758 MB
      • treeshaking pass 9: 214ms, 755 MB
      • treeshaking pass 10: 217ms, 752 MB
      • treeshaking pass 11: 213ms, 748 MB
  • GENERATE: 882ms, 1.02 GB
    • initialize render: 0ms, 914 MB
    • generate chunks: 87ms, 917 MB
      • optimize chunks: 0ms, 918 MB
    • render chunks: 774ms, 1 GB
    • transform chunks: 21ms, 1.02 GB
    • generate bundle: 0ms, 1.02 GB

Copy link

codecov bot commented Jul 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.05%. Comparing base (28546b5) to head (348dd91).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5584   +/-   ##
=======================================
  Coverage   99.05%   99.05%           
=======================================
  Files         241      241           
  Lines        9273     9280    +7     
  Branches     2444     2446    +2     
=======================================
+ Hits         9185     9192    +7     
  Misses         58       58           
  Partials       30       30           

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

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.

Thanks so much for the fix! This makes me wonder if we should not consider including ParenthesizedExpression nodes at some point, even if they are non-standard. But maybe they would cause more problems in other areas...

@lukastaegert lukastaegert added this pull request to the merge queue Jul 27, 2024
Merged via the queue into master with commit 610d7c0 Jul 27, 2024
39 checks passed
@lukastaegert lukastaegert deleted the fix-5583 branch July 27, 2024 04:39
Copy link

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

@TrickyPi
Copy link
Member Author

The SWC AST include ParenthesisExpression node. If we want to include ParenthesisExpression in the Rollup AST, we need to compatibilize the ESTree AST nodes from third-party plugins.

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.

TreeShake ERROR: Expected ")" but found "}"
2 participants