This PR removes the defaultStyles functionality entirely, thus simplifying use of the library. Due to how the modifier configurations had to be processed in order to apply defaultStyles, significant performance gains were available when this functionality was removed.
An additional enhancement, that may itself be open for further performance enhancements in the future, is that a modifier configuration function no longer needs to return an object with the key styles. Now a simple string or template literal can be returned. As this PR sits now, the returned value is evaluated to determine if it is an object or string, and processed accordingly.
This PR will create a breaking change and require a major version update.
WHERE SHOULD THE REVIEWER START?
lib/utils/modifiedStyles.js
HOW CAN THIS BE MANUALLY TESTED?
yarn review
ANY NEW DEPENDENCIES ADDED?
lodash.isobject - used when evaluating a the return value of a modifier config function to determine if it is an object or a string.
Also, lodash.mapvalues was no longer used and has been removed.
CHECKLIST
Be sure all items are ✅ before submitting a PR for review.
[x] Verify the linter and tests pass: npm run review
[x] Verify this branch is rebased with the latest master
OVERVIEW
This PR removes the
defaultStyles
functionality entirely, thus simplifying use of the library. Due to how the modifier configurations had to be processed in order to applydefaultStyles
, significant performance gains were available when this functionality was removed.An additional enhancement, that may itself be open for further performance enhancements in the future, is that a modifier configuration function no longer needs to return an object with the key styles. Now a simple string or template literal can be returned. As this PR sits now, the returned value is evaluated to determine if it is an object or string, and processed accordingly.
This PR will create a breaking change and require a major version update.
WHERE SHOULD THE REVIEWER START?
lib/utils/modifiedStyles.js
HOW CAN THIS BE MANUALLY TESTED?
yarn review
ANY NEW DEPENDENCIES ADDED?
lodash.isobject
- used when evaluating a the return value of a modifier config function to determine if it is an object or a string. Also,lodash.mapvalues
was no longer used and has been removed.CHECKLIST
Be sure all items are ✅ before submitting a PR for review.
npm run review
GIF