-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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: Configuration for obfuscate/minify css module's local ident names #9223
base: main
Are you sure you want to change the base?
Conversation
Hi @zamarawka! Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
bump |
@iansu @ianschmitz @mrmckeb waiting for your feedback. I'd like to use this feature in the next release!! |
Hi @zamarawka, I see you're trying to resolve #8984. Can you talk us through your thinking here? For example, the hashes created seem quite long. Also, what problem do you feel this PR solves? Thanks! |
Hi @mrmckeb! |
Bump |
@iansu @ianschmitz @mrmckeb bump |
@zamarawka - I prefer the longer and readable class names for two reasons.
I also don't believe this helps obscure your code much, because the important part would be to obscure what CSS affects what elements. This does not help with this, because your class names and your I understand this is just an option, but it seems like an unnecessary option, when CRAs goal is to remain simple. |
I also don't believe this resolves #8984. That would resolve around minifying the classnames, not obscuring the names. For example turning this:
into this
or with advanced minification that renames the classes
|
@ro-savage If you prefer readable class names - don't use this option. As I say, it's like
Just try to parse data from some resource like a twitter. There is no way to understand relations of blocks, and after new build of app we got fully new class names (not partial)... Way better then you got something like MainContainer-gdl53fg or PagePanel-kjdfnk - which could be used for identify elements by regexp. |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
bump |
Added variable in advanced configuration to obfuscate css module's class names.
In some cases may reduce bundle size and also reduce html readability.
Preview:
Previous behavior saved. You should set env variable to turn this on.
Closes #8984