Skip to content

Conversation

joscha
Copy link
Contributor

@joscha joscha commented Mar 10, 2017

What kind of change does this PR introduce?
bugfix

Did you add tests for your changes?
yes

If relevant, did you update the README?
n/a

Summary

When converting a class name without dashes, the newly introduced 'only' and 'dashesOnly' settings for the camelCase option would only ever add the class name to locals if it was different to the standard class name. Any class w/o dash would therefore not be added to the locals at all.

Does this PR introduce a breaking change?
No

Other information
Introduced in #445 - released in 0.27.0

@joscha
Copy link
Contributor Author

joscha commented Mar 10, 2017

cc @d3viant0ne I believe the release of 0.27.0 is not that old, so it would probably good to have a look at this before the issues trickle in.

@joscha joscha force-pushed the joscha/fix-only-option branch from 7d859b2 to eb130b2 Compare March 10, 2017 07:48
@codecov
Copy link

codecov bot commented Mar 10, 2017

Codecov Report

Merging #448 into master will increase coverage by 0.05%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #448      +/-   ##
==========================================
+ Coverage   98.41%   98.47%   +0.05%     
==========================================
  Files           9        9              
  Lines         315      327      +12     
  Branches       72       74       +2     
==========================================
+ Hits          310      322      +12     
  Misses          5        5
Impacted Files Coverage Δ
lib/compile-exports.js 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 9504ea5...eb130b2. Read the comment docs.

var targetKey;
if (camelCaseKeys === true || camelCaseKeys === 'only') {
targetKey = camelCase(key);
if (targetKey !== key) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this line was the culprit, as it would prevent the camelcased key to be added to the locals only if it was different from the default key. However with the only and dashesOnly options the default key would not have been added -> empty locals.

@bebraw bebraw merged commit 0eedd9f into webpack:master Mar 10, 2017
@joscha
Copy link
Contributor Author

joscha commented Mar 10, 2017

Thank you @bebraw! And sorry about the hassle.

@joscha joscha deleted the joscha/fix-only-option branch March 10, 2017 08:42
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.

2 participants