-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Added minify option to createGenerateId #1075
Conversation
disableStylesGeneration?: boolean, | ||
media?: string, | ||
children: Node | ||
interface Props { |
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.
why do you use in this case and in case of CreateGenerateIdOptions an interface instead of type?
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.
I'm just being used to use interfaces because of TS
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.
I think even in ts interfaces have a bit different purpose than types., we should use type when possible and interface when needed.
|
||
### Improvements | ||
|
||
- [jss] Add option for opt-in minification of class names. ([#1075](https://github.com/cssinjs/jss/pull/1075)) |
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.
I think it's a feature and a breaking change
we also need to update the docs |
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.
let's go!
P.S. I would change interface to a type, but I am no expert in TS.
Just noticed we still didn't merge this one |
I will finish this tomorrow evening |
|
||
return nativeEscape ? nativeEscape(str) : str.replace(escapeRegex, '\\$1') | ||
} | ||
export default str => (nativeEscape ? nativeEscape(str) : str.replace(escapeRegex, '\\$1')) |
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.
We will always need to escape the string now because the user might not minify the string
We could also pass here the sheet options and check if the user wants to minify the selector
* Added minify option to createGenerateId * Update changelog * Update TS types * Update changelog * Update size snapshot * Update size snapshots * Added docs * Fix linting * Remove check for env production in react jss * Update size snapshot * Fix tests
What would you like to add/fix?
This adds an option to the
createGenerateId
to allow to opt-in into minification of class names.Corresponding issue (if exists): #1072