pheuter / essential-react

A minimal skeleton for building testable React apps using Babel
MIT License
2.02k stars 131 forks source link

Add Radium #13

Open paulyoung opened 9 years ago

paulyoung commented 9 years ago

This pull request intends to address #2.

Despite Radium not yet being compatible with React 0.13 (https://github.com/FormidableLabs/radium/issues/92), I think there are other implications that can be discussed in the meantime.

The Radium docs say this:

To start, choose a high level component in your app where you will initialize your media queries. Any components that should use your media queries should be descendents of this component.

Note: this means descendent as in view hierarchy, not class inheritance.

Since this project didn't have a single high level component, the first commit introduces an app router which is loosely based on the shared root example from React Router.

While there are further potential changes in this area to bring Essential React closer to the given example, those are not (yet) addressed here.

The second commit outlines how Radium could/would be added. These changes have been left as comments in order to keep the project compatible with 0.13 and allow any further refactoring of components.


Concerns

Should the project be refactored and brought closer to the React Router example, some of these concerns might be redundant.


There are other aspects to Radium which have little (if any) implications and have yet to be implemented for that reason.

Looking for some input from @pheuter on how best to proceed.

coveralls commented 9 years ago

Coverage Status

Coverage remained the same at 88.7% when pulling ff0cad841267a16cacc00c50bc1c7d15dd3a50bf on paulyoung:radium into 95df1fdfbf62a588cf238eb2ccefa8f36b50d8e0 on pheuter:master.

paulyoung commented 9 years ago

Unfortunately ES6 launched without any mixin support. Therefore, there is no support for mixins when you use React with ES6 classes. Instead, we're working on making it easier to support such use cases without resorting to mixins.

Source: https://facebook.github.io/react/docs/reusable-components.html

pheuter commented 9 years ago

Nice! Will take a look when I get the chance. Some people have expressed that Radium may not be considered an "essential" part of a React app, especially considering its controversial approach to styling and potential lack of cross-browser support, which is why I haven't been too actively pursuing it. Nonetheless, the potential is still there and I think it may still have a place in this skeleton.

paulyoung commented 9 years ago

Yeah, feel free to close if you want.

I still think the React Router example is worth a look even if Radium is not included.

dmitry commented 9 years ago

Any news on this topic?