Skip to content

Tree-shake side-effect-free string methods on template literals#4511

Merged
lukastaegert merged 2 commits intomasterfrom
template-literal-members
May 27, 2022
Merged

Tree-shake side-effect-free string methods on template literals#4511
lukastaegert merged 2 commits intomasterfrom
template-literal-members

Conversation

@lukastaegert
Copy link
Copy Markdown
Member

@lukastaegert lukastaegert commented May 27, 2022

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

Description

This applies the same optimization to template literals as to strings e.g. calling .trim() is no longer considered a side effect.

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 27, 2022

Thank you for your contribution! ❤️

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

npm install rollup/rollup#template-literal-members

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

@lukastaegert lukastaegert mentioned this pull request May 27, 2022
@codecov
Copy link
Copy Markdown

codecov bot commented May 27, 2022

Codecov Report

Merging #4511 (38aa416) into master (46a193b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4511   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files         208      208           
  Lines        7425     7431    +6     
  Branches     2118     2120    +2     
=======================================
+ Hits         7335     7341    +6     
  Misses         34       34           
  Partials       56       56           
Impacted Files Coverage Δ
src/ast/nodes/Literal.ts 100.00% <ø> (ø)
src/ast/nodes/TemplateLiteral.ts 100.00% <100.00%> (ø)
src/ast/values.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 46a193b...38aa416. Read the comment docs.

@lukastaegert lukastaegert merged commit 65068c0 into master May 27, 2022
@lukastaegert lukastaegert deleted the template-literal-members branch May 27, 2022 08:21
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.

about tree-shaking

1 participant