-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
feat: allow removal of original class name #445
feat: allow removal of original class name #445
Conversation
Codecov Report
@@ Coverage Diff @@
## master #445 +/- ##
==========================================
+ Coverage 98.4% 98.41% +<.01%
==========================================
Files 9 9
Lines 314 315 +1
Branches 71 72 +1
==========================================
+ Hits 309 310 +1
Misses 5 5
Continue to review full report at Codecov.
|
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.
👍 Just a few doc related nits. Thx very much for this PR :)
README.md
Outdated
@@ -394,6 +394,15 @@ By default, the exported JSON keys mirror the class names. If you want to cameli | |||
import { className } from 'file.css'; | |||
``` | |||
|
|||
#### Possible options |
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.
- #### Possible Options
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.
done, 9574dc0
README.md
Outdated
@@ -394,6 +394,15 @@ By default, the exported JSON keys mirror the class names. If you want to cameli | |||
import { className } from 'file.css'; | |||
``` | |||
|
|||
#### Possible options | |||
|
|||
|Option|Behaviour| |
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.
Move the table directly under the camelCase
header please
Behaviour
=> Description
for consistency
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.
package.json
Outdated
@@ -1,12 +1,16 @@ | |||
{ | |||
"name": "css-loader", | |||
"version": "0.26.2", | |||
"version": "0.26.4", |
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 is done automatically. No need to change this file.
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.
@ekulabuhov Good catch 💯 I totally missed it.
In a short while, if seen this a few times now, maybe we should update the PR_TEMPLATE
to explicitly mention that npm version
is always handled/done by us? cc @bebraw @d3viant0ne
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.
Yeah, open an issue at webpack-defaults so it gets sorted once and for all.
lib/loader.js
Outdated
if(p.indexOf("../") !== 0) | ||
p = "./" + p; | ||
return "/" + p; | ||
return source.split("!").pop(); |
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.
Is this related?
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.
It seems like this PR needs a rebase.
And please note, it need a If you aren't comfortable with the rebase comment, give me write access to your fork and I can either do it or walk you through the process |
5679c8c
to
9574dc0
Compare
rebased onto |
👍 Great work! Would it make more sense to opt in into generating original class names? Something like: |
I know at least two companies that depend on this "feature" 💃 💃 💃 :) @ekulabuhov I'd really like to get this fix into pre-1.0.0 and the only way to not break existing code is to make the feature opt-out instead of opt-in. I am happy to pick the PR to any 1.0.0 feature branch and make it opt-in to keep the original name, if there is one? |
@joscha - Yeah, this should go in before the next major. Backwards compatible and beneficial to both major versions. |
@d3viant0ne agreed, so I think the current PR is gtg 🏃 |
I'll merge this as soon as I finish up with a few other reviews. |
I made a mistake on this - due to the change from #420 simple classes or ones that were already in camelCase are not exported any more because they are thought to be already on the object. This only happens when one of the new options is enabled. Will write a fix and send in a PR. |
ever so sorry, the test cases were not wide enough and it wasn't picked up in the review - the fix is here: #448 |
What kind of change does this PR introduce?
feature/performance
Did you add tests for your changes?
yes
If relevant, did you update the README?
yes
Summary
Does this PR introduce a breaking change?
No