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

Support nullish coalescing with tree-shaking #3548

Merged
merged 2 commits into from May 10, 2020
Merged

Conversation

lukastaegert
Copy link
Member

@lukastaegert lukastaegert commented May 10, 2020

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

Description

This adds nullish coalescing support including advanced tree-shaking support for these expressions. At that point, the only thing we are missing is optional chaining, let's keep our fingers crossed!

Tree-shaking examples via the REPL

@rollup-bot
Copy link
Collaborator

rollup-bot commented May 10, 2020

Thank you for your contribution! ❤️

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

npm install rollup/rollup#nullish-coalescing

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

@codecov
Copy link

codecov bot commented May 10, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3548   +/-   ##
=======================================
  Coverage   96.24%   96.25%           
=======================================
  Files         176      176           
  Lines        6025     6027    +2     
  Branches     1777     1778    +1     
=======================================
+ Hits         5799     5801    +2     
  Misses        112      112           
  Partials      114      114           
Impacted Files Coverage Δ
src/ast/nodes/ExportAllDeclaration.ts 100.00% <ø> (ø)
src/ast/nodes/ExportNamedDeclaration.ts 100.00% <ø> (ø)
src/ast/nodes/NodeType.ts 100.00% <ø> (ø)
src/ast/nodes/index.ts 100.00% <ø> (ø)
src/Graph.ts 98.72% <100.00%> (ø)
src/Module.ts 98.90% <100.00%> (+<0.01%) ⬆️
src/ast/nodes/LogicalExpression.ts 98.75% <100.00%> (+0.01%) ⬆️

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 6919037...e1d5dc5. Read the comment docs.

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.

Support nullish coalescing
2 participants