* handle non-jsx tag as first child
* update prettier to 1.5.2
* Renamed test
* Stop formatting the test cases
* Updated snapshots
* Removed useless snapshot
Fixes the case when styles are updated and the `JSXStyle` component ignores them because it calls its `update` helper on `componentWillUpdate` with the old `props`.
See the original PR #236 for more context.
#223 fixed only one case, this branch aims to fix them all :)
Our safeguard is the `t.regex` from "transpiles external stylesheets with validation (expressions)" in `tests/external.js`, if that matches then the files are parsed correctly as css and therefore processed by styled-jsx.
Fixes#224
The problem was that when using interpolation in external files eg. `div { color: ${colors.foo} }` we replace the interpolation `${colors.foo}` with a placeholder so that it can be parsed as css.
For external files we also check whether the export is a string or rather valid css (we do css detection). The problem was that the placeholder is invalid css eg. `div { color: %foo% } }` (`%foo%` is not a valid value for color) so we skipped the file altogether.
I fixed it by using a fake css custom property as placeholder instead.
* Add support for expressions within template literals
* Add support for expressions in selectors and media queries
* Replace longer expressions first to avoid substring replacements
* Destructure param in findStyles
* Throw upon usage of vars from the closure
* Use babylon and babel-traverse instead of babel-core
* findStyles should return a path
* Refactor benchmark and add expressions
* Fix typo