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

Do not tree-shake arguments that contain a spread element #3654

Merged
merged 1 commit into from Jul 2, 2020

Conversation

lukastaegert
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 #3652

Description

Disabling argument tree-shaking if a spread element is passed seems prudent as it is hard to associate arguments with variables in such a case, otherwise the logic would grow really convoluted.

@rollup-bot
Copy link
Collaborator

Thank you for your contribution! ❤️

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

npm install rollup/rollup#gh-3652-treeshaken-spread-elements

or load it into the REPL:
https://rollupjs.org/repl/?circleci=12149

@codecov
Copy link

codecov bot commented Jul 1, 2020

Codecov Report

Merging #3654 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3654   +/-   ##
=======================================
  Coverage   96.70%   96.70%           
=======================================
  Files         183      183           
  Lines        6282     6287    +5     
  Branches     1831     1832    +1     
=======================================
+ Hits         6075     6080    +5     
  Misses        105      105           
  Partials      102      102           
Impacted Files Coverage Δ
src/ast/scopes/ParameterScope.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1aeb23b...191767d. Read the comment docs.

@lukastaegert lukastaegert merged commit 1ebaa09 into master Jul 2, 2020
@lukastaegert lukastaegert deleted the gh-3652-treeshaken-spread-elements branch July 2, 2020 03:39
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.

Rollup tree shake removes all fn arguments when using object spread operator
2 participants