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

Merge styles into single object #473

merged 5 commits into from May 4, 2019


None yet
3 participants
Copy link

commented Apr 30, 2019

This change undoes the change in v4.0.0 where the returned value is an array of styles, favoring a merged object instead. The merge implementation is loosely based on the deepmerge package, but only handles objects and does not check for null, falsy or array values. This shouldn't entail a breaking change for most users, but does change the returned values

Partially fixes #471

jxnblk added some commits Apr 30, 2019


This comment has been minimized.

Copy link

commented Apr 30, 2019

Codecov Report

❗️ No coverage uploaded for pull request base (master@60dc207). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##             master   #473   +/-   ##
  Coverage          ?   100%           
  Files             ?      1           
  Lines             ?    173           
  Branches          ?      0           
  Hits              ?    173           
  Misses            ?      0           
  Partials          ?      0
Impacted Files Coverage Δ
src/index.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60dc207...6f5d329. Read the comment docs.

@jxnblk jxnblk referenced this pull request Apr 30, 2019


Improve performances #470

@jxnblk jxnblk referenced this pull request Apr 30, 2019


Make sure styled-system is supported #974

1 of 4 tasks complete
// loosely based on deepmerge package
export const merge = (a, b) => {
const result = {}
Object.keys(a).forEach(key => {

This comment has been minimized.

Copy link

kof Apr 30, 2019

It might be worth doing micro perf optimizations here by using a for loop instead of .keys, .forEach, .reduce, since this is something that will be done a lot.

jxnblk added some commits May 4, 2019

@jxnblk jxnblk merged commit 67fc9a2 into master May 4, 2019

4 of 7 checks passed

Header rules - styled-system No header rules processed
Pages changed - styled-system All files already uploaded
Redirect rules - styled-system No redirect rules processed
Mixed content - styled-system No mixed content detected
continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed
netlify/styled-system/deploy-preview Deploy preview ready!

@jxnblk jxnblk referenced this pull request May 11, 2019


Improve performances #479

@jxnblk jxnblk deleted the merge-styles branch May 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.