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(rollup): generated JS always uses clean names #847

Merged
merged 8 commits into from
May 25, 2022

Conversation

tivac
Copy link
Owner

@tivac tivac commented May 24, 2022

Description

Adding in an extra layer of tracking of renamed/uniqued variables so that they're always used instead of raw classnames, for instances where that isn't a valid JS identifier that can be safely exported/imported.

Motivation and Context

Fixes #846

How Has This Been Tested?

Wrote tests for it.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • [] My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@ghost
Copy link

ghost commented May 24, 2022

👇 Click on the image for a new way to code review
  • Make big changes easier — review code in small groups of related files

  • Know where to start — see the whole change at a glance

  • Take a code tour — explore the change with an interactive tour

  • Make comments and review — all fully sync’ed with github

    Try it now!

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

@netlify
Copy link

netlify bot commented May 24, 2022

Deploy Preview for m-css ready!

Name Link
🔨 Latest commit f2b5e73
🔍 Latest deploy log https://app.netlify.com/sites/m-css/deploys/628dd198b734910008e5e8f6
😎 Deploy Preview https://deploy-preview-847--m-css.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.

tivac added 2 commits May 24, 2022 23:37
I think I over-complicated this
If the ESM export is always tidied up (it is) then we can always apply the same tidying to the import.
@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Merging #847 (7ffd39c) into main (39ab577) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 7ffd39c differs from pull request most recent head f2b5e73. Consider uploading reports for the commit f2b5e73 to get more accurate results

@@           Coverage Diff           @@
##             main     #847   +/-   ##
=======================================
  Coverage   99.58%   99.58%           
=======================================
  Files          37       37           
  Lines        1435     1439    +4     
  Branches      232      232           
=======================================
+ Hits         1429     1433    +4     
  Misses          6        6           
Impacted Files Coverage Δ
packages/css-to-js/css-to-js.js 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 39ab577...f2b5e73. Read the comment docs.

@tivac tivac merged commit 3bf231d into main May 25, 2022
@tivac tivac deleted the composes-from-invalid-js branch May 25, 2022 06:50
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.

[rollup] Compose class with name not valid as a JS identifier gives Error: Unexpected token
1 participant