Decisiv / styled-components-modifiers

A library to enable BEM flavored modifiers (and responsive modifiers) in styled components.
MIT License
298 stars 11 forks source link

removes the previously deprecated default styles #2

Closed andrewtpoe closed 6 years ago

andrewtpoe commented 6 years ago

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 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 arebefore submitting a PR for review.

GIF