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

Roll back parameter default tree shaking #4520

Merged
merged 7 commits into from Jun 1, 2022

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:
See comments at #4518

Description

Considering the unprecedented amount of small bugs that the parameter default tree-shaking has caused, I decided to roll back the feature indefinitely for now. The problem is that for this feature to work correctly, we need to be 100% sure that for every function, we can either track 100% of the calls or if not, deoptimize it. The latter has turned out to become the literal whack-a-mole, causing me to inject so much special logic into the feature that IMO is in no relation to its value. I kept all the regression tests (quite a few!) created for the feature in case I ever attempt it again after some major changes in the call tracking logic.

Sorry to everyone who was looking forward to this 😔

@github-actions
Copy link

github-actions bot commented Jun 1, 2022

Thank you for your contribution! ❤️

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

npm install rollup/rollup#roll-back-parameter-default-tree-shaking

or load it into the REPL:
https://rollupjs.org/repl/?pr=4520

@codecov
Copy link

codecov bot commented Jun 1, 2022

Codecov Report

Merging #4520 (ecf1612) into master (696ebd3) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4520      +/-   ##
==========================================
- Coverage   98.77%   98.76%   -0.01%     
==========================================
  Files         209      209              
  Lines        7436     7395      -41     
  Branches     2130     2108      -22     
==========================================
- Hits         7345     7304      -41     
  Misses         32       32              
  Partials       59       59              
Impacted Files Coverage Δ
src/ast/nodes/ArrayExpression.ts 100.00% <ø> (ø)
src/ast/nodes/FunctionDeclaration.ts 100.00% <ø> (ø)
src/ast/nodes/Identifier.ts 98.68% <ø> (-0.02%) ⬇️
src/ast/nodes/ObjectExpression.ts 100.00% <ø> (ø)
src/ast/nodes/shared/ClassNode.ts 100.00% <ø> (ø)
src/ast/nodes/shared/Expression.ts 100.00% <ø> (ø)
src/ast/variables/LocalVariable.ts 93.15% <ø> (+1.25%) ⬆️
src/ast/nodes/ArrowFunctionExpression.ts 94.44% <100.00%> (+1.58%) ⬆️
src/ast/nodes/AssignmentPattern.ts 88.88% <100.00%> (-11.12%) ⬇️
src/ast/nodes/CallExpression.ts 100.00% <100.00%> (ø)
... and 5 more

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 696ebd3...ecf1612. Read the comment docs.

@lukastaegert lukastaegert merged commit 96cf84e into master Jun 1, 2022
@lukastaegert lukastaegert deleted the roll-back-parameter-default-tree-shaking branch June 1, 2022 12:39
pos777 pushed a commit to pos777/rollup that referenced this pull request Jun 18, 2022
* Add more regression tests

* Remove call parameter deoptimization

* Remove includeWithoutParameterDefaults

* Remove default parameter tree-shaking logic

* Clean up deoptimizations

* Clean up deoptimizations
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.

None yet

1 participant