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

restore PR #450, Fix defaultProps used instead ThemeProvider on first render #1

Closed
wants to merge 157 commits into from

Conversation

santaclauze
Copy link
Owner

Ok this is a bug with v2 only. I think I have already fixed that bug in v1 so I will have to search for the PR.
The corresponding PR is styled-components#450.

geelen and others added 30 commits November 21, 2016 11:23
These test failures are actually not really failures, they just happened
because we now call the name generator (which we patch for the tests)
on component creation as well as at rendering time, which didn't happen
before, so now all classes are shifted by one. Fixed by manually
shifting them back.
To add support for server-side rendering, it needs to be possible to
pass in an identifier from the outside. This is a private API because
the only thing ever writing this is babel-plugin-styled-components,
which will automatically turn your normal styled components into the ssr
compatible version by turning your styled() calls into this notation:

    styled({ target: 'div', identifier: 'YourComponent-asdf123', displayName: 'YourComponent' })

This commit adds support for this notation.
Package size (min+gzip) with...

- PostCSS: 21kB
- stylis: 9kB

:tada:

I hack around stylis model a bit, because we e.g. don't want to prefix
keyframes with the generated classname. (something stylis does by
default). Maybe @thysultan can chime in here if there's any chance we
could change this, otherwise this (slightly ugly) works too!

This isn't done as we need to do dependency cleanup and fix the
whitespace changes in the tests, but I wanted to kick off a first
discussion!

/cc @geelen
…on' into per-component-classname-generation

Conflicts:
	src/models/StyledComponent.js
mxstbr and others added 29 commits March 3, 2017 08:07
The constructors weren't passing through their arguments
to React.Component, which causes Rapscallion to fail.
…x-comp-constructor

Fix component constructors not passing through arguments to React.Component (V2)
…eprocessed

Accept preprocessed CSS from babel plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.