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

Remove Symbol polyfill in module namespaces #3135

Merged
merged 5 commits into from Sep 26, 2019

Conversation

mkubilayk
Copy link
Contributor

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:

Fixes #3097.

Description

This simplifies generated code for module namespaces by removing the Symbol polyfill. It is technically a breaking change but it was agreed in #3097 (comment).

@codecov
Copy link

codecov bot commented Sep 26, 2019

Codecov Report

Merging #3135 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3135      +/-   ##
==========================================
- Coverage   89.32%   89.31%   -0.01%     
==========================================
  Files         165      165              
  Lines        5731     5726       -5     
  Branches     1740     1737       -3     
==========================================
- Hits         5119     5114       -5     
  Misses        379      379              
  Partials      233      233
Impacted Files Coverage Δ
src/ast/variables/NamespaceVariable.ts 100% <100%> (ø) ⬆️

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 a92d09d...a4c1696. Read the comment docs.

}${_}}${_}});${n}`;
output += `${callee}(${name});`;
}
let output = `${options.varOrConst} ${name} = ${`${callee}({${n}${members.join(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the compact output, there are still a few empty spaces that can be replaced with ${_}, which will be replaced with an empty string for compact: true output (around the =). Also, is the template string inside the template string intended?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I see the ${_} were already missing in the original form.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, nested template string is intended and were there already. You are right, ${_} were missing but should I update?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also if getting rid of the nested template string is possible, that would be nice. Looks like this to me.

@mkubilayk
Copy link
Contributor Author

@lukastaegert Thanks for the review. Incorporated your feedback.

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lukastaegert lukastaegert merged commit a1ec55c into rollup:master Sep 26, 2019
@mkubilayk mkubilayk deleted the tostring-polyfill branch September 26, 2019 16:08
@Havunen
Copy link

Havunen commented Sep 30, 2019

Nice feature. Documentation missing tho! :)
edit: nvm. found it here: https://rollupjs.org/guide/en/#javascript-api

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.

Simplify Symbol.toStringTag for module namespaces
3 participants