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

fix: use the original class name in the class body #4827

Merged
merged 7 commits into from Feb 1, 2023

Conversation

TrickyPi
Copy link
Member

@TrickyPi TrickyPi commented Jan 28, 2023

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

Description

The Variable renders a proper name according to the return of the useOriginalName function.

@netlify
Copy link

netlify bot commented Jan 28, 2023

Deploy Preview for rollupjs ready!

Name Link
🔨 Latest commit f8d67fc
🔍 Latest deploy log https://app.netlify.com/sites/rollupjs/deploys/63d7ccf51825ae0009572ba3
😎 Deploy Preview https://deploy-preview-4827--rollupjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@TrickyPi TrickyPi changed the title Fix/static block class fix: use class name in static block Jan 28, 2023
@codecov
Copy link

codecov bot commented Jan 28, 2023

Codecov Report

Merging #4827 (f8d67fc) into master (48553ca) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4827   +/-   ##
=======================================
  Coverage   99.00%   99.00%           
=======================================
  Files         219      219           
  Lines        7834     7835    +1     
  Branches     2168     2168           
=======================================
+ Hits         7756     7757    +1     
  Misses         26       26           
  Partials       52       52           
Impacted Files Coverage Δ
src/Chunk.ts 99.82% <ø> (ø)
src/utils/renderHelpers.ts 100.00% <ø> (ø)
src/ast/nodes/ClassDeclaration.ts 100.00% <100.00%> (ø)
src/ast/nodes/Identifier.ts 100.00% <100.00%> (ø)
src/ast/variables/Variable.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link

github-actions bot commented Jan 30, 2023

Thank you for your contribution! ❤️

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

npm install TrickyPi/rollup#fix/static-block-class

or load it into the REPL:
https://deploy-preview-4827--rollupjs.netlify.app/repl/?pr=4827

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.

Very nice!

src/utils/renderHelpers.ts Outdated Show resolved Hide resolved
@lukastaegert
Copy link
Member

For the failing tests, note that you can add a parameter minNodeVersion to _config.js files to skip tests on older Node versions, i.e.

module.exports = {
  description: 'use class name instead of renderName in static block',
  minNodeVersion: 16
};

@TrickyPi
Copy link
Member Author

TrickyPi commented Jan 30, 2023

For the failing tests, note that you can add a parameter minNodeVersion to _config.js files to skip tests on older Node versions, i.e.

module.exports = {
  description: 'use class name instead of renderName in static block',
  minNodeVersion: 16
};

Ok, Thanks!

@TrickyPi TrickyPi changed the title fix: use class name in static block fix: use the original class name in the class body Jan 30, 2023
@lukastaegert lukastaegert merged commit 4faf350 into rollup:master Feb 1, 2023
lukastaegert pushed a commit that referenced this pull request Feb 1, 2023
* fix: add useOriginalName option

* test: add test

* test: remove solo

* test: set minNodeVersion

* refactor: override useOriginalName in ClassDeclaration

* test: add more cases

* test: tweak description
@rollup-bot
Copy link
Collaborator

This PR has been released as part of rollup@3.12.1. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

self reference in static block is not working well on rename
3 participants