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

Add support for removing original classnames when using camelCase=true/'dashes' #440

Closed
kumarharsh opened this issue Mar 7, 2017 · 7 comments · Fixed by #445
Closed
Assignees

Comments

@kumarharsh
Copy link

kumarharsh commented Mar 7, 2017

Do you want to request a feature or report a bug?
Feature Request

What is the current behavior?
CSS with both original and camelized classnames are retained in the final output.

If this is a feature request, what is motivation or use case for changing the behavior?
Would it be possible to introduce yet another flag which removes the uncamelized versions from the final output? I'm asking because of a comment on one of the issues: clinyong/vscode-css-modules#3 (comment)

Basically, by retaining both the camelized and original versions of a classname, the bundle size increases, sometimes by a lot for larger projects. If all developers are in with the syntax, perhaps it'd not be as problematic to remove the original classnames? Two extra options can be added to the camelCase options: camelCase: only and camelCase: dashesOnly which cause the plugin to not output the original classes. What do you think of the idea?

I'd be happy to make a PR if the team decides it's worthwhile to add to the loader.

@michael-ciniawsky
Copy link
Member

@kumarharsh Should be fixed by #420

@joscha
Copy link
Contributor

joscha commented Mar 7, 2017

@michael-ciniawsky: #420 only removes duplicates, not the original classes. What @kumarharsh is suggesting makes total sense, but would be a breaking change. For this we'd need an additional flag. Happy to open a PR after #420 is merged.

@michael-ciniawsky
Copy link
Member

@joscha kk I see, thx for joining in. Since we are working towards a next major (ES2015 Modules) etc. that isn't really a blocker as long as it makes things easier and general sense 😛

@joscha
Copy link
Contributor

joscha commented Mar 8, 2017

@michael-ciniawsky happy for me to open a PR for this? Should I add an additional flag, e.g. ?removeOriginal or ?replaceOriginal or do you want me to make the PR so it is a breaking change?

@michael-ciniawsky
Copy link
Member

@joscha Personally I would prefer to make it a breaking change and avoid an extra flag, v1.0.0 will be a larger refactor anyways. For now we could maybe expose this behaviour as an option but please add a comment to refactor that later 😛 and not sure if we should do that at all tbh (confusion) .

cc @bebraw @d3viant0ne

@kumarharsh
Copy link
Author

We can add camelCase: only and camelCase: dashesOnly if backward compatibility needs to be maintained.

@joscha
Copy link
Contributor

joscha commented Mar 9, 2017

Opened #445 @michael-ciniawsky and followed @kumarharsh's suggestion and made it an option.

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 a pull request may close this issue.

3 participants