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 count accessing members of an external namespace as side-effects. #4001

Merged
merged 1 commit into from Mar 18, 2021

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:
#3999

Description

This solves a regression introduced in #3999 where accessing properties of external namespaces was considered side-effectful, preventing tree-shaking.

@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#no-namespace-access-side-effect

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

@codecov
Copy link

codecov bot commented Mar 18, 2021

Codecov Report

Merging #4001 (e06d6ff) into master (9c19865) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4001   +/-   ##
=======================================
  Coverage   97.24%   97.24%           
=======================================
  Files         191      191           
  Lines        6741     6742    +1     
  Branches     1967     1968    +1     
=======================================
+ Hits         6555     6556    +1     
  Misses         99       99           
  Partials       87       87           
Impacted Files Coverage Δ
src/ast/variables/ExternalVariable.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 9c19865...e06d6ff. Read the comment docs.

@lukastaegert lukastaegert merged commit 5dfc489 into master Mar 18, 2021
@lukastaegert lukastaegert deleted the no-namespace-access-side-effect branch March 18, 2021 05:04
This was referenced Mar 18, 2021
This was referenced Mar 18, 2021
@stefcameron
Copy link

@lukastaegert Thank you for this fix, it solved my issue!

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

3 participants