-
-
Notifications
You must be signed in to change notification settings - Fork 604
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: do not export duplicate keys #420
fix: do not export duplicate keys #420
Conversation
Codecov Report
@@ Coverage Diff @@
## master #420 +/- ##
==========================================
+ Coverage 98.32% 98.36% +0.03%
==========================================
Files 9 9
Lines 299 306 +7
Branches 67 69 +2
==========================================
+ Hits 294 301 +7
Misses 5 5
Continue to review full report at Codecov.
|
can't find the place to sign the CLA |
still no email from the CLA bot :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@joscha Please close and reopen the PR once again for the CLA, it should work now :) |
I think you have to close/open the PR again as the CLA bot was fixed about ten days ago. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can nest two ternary operators for better readability and the same end result
@d3viant0ne I tried keeping the diff as small as possible - made some changes so it is more readable now, please take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 @d3viant0ne @bebraw Please Review :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs tests so we don't break it again.
@bebraw sure, I will need to change the current tooling a tiny bit for that because right now it is all based on |
@joscha From my side, just move on :) |
@joscha Ok, cool. Safer with tests. 👍 |
614b66e
to
5229a89
Compare
@bebraw @michael-ciniawsky I added two tests however, there is something really strange happening with the EDIT: seems to be fixed by #416 |
5229a89
to
efe9171
Compare
The line endings in README seem to be fixed by #416 - for now you can just squash my changes. |
efe9171
to
be83084
Compare
I squashed all commits into one, so should be good to go now 👍 |
Nice work. I'll let either Michael or Joshua to merge and publish. 👍 |
What kind of change does this PR introduce?
Bugfix, it makes sure that keys that are the same in different case styles (e.g. dashed, camelCase, dashedCamelCase) are not added to the resulting output when
?camelCase
is enabled.E.g. a class name
.bla
would bebla
as a default, but alsobla
in camelCase whereas.my-bla
would yieldmy-bla
andmyBla
. Currently the constructed document for the locals contains two entries, like this:if
camelCase
is enabled.Did you add tests for your changes?
No, because the test helper uses JSON deserialization, which removes the dupe.
Summary
When using CSS modules with Typescript for example, you encounter something like this:
Also, the resulting output in the bundle is 50% bigger than it has to be if only class names are used that are
className === camelCase(className)
.Does this PR introduce a breaking change?
No