-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Feedback from @JedWatson #222
Comments
|
I'm currently working on a new styling system (using The solution that I'm working on has the following requirements:
These stylesheets are intended to be "static" -- dynamic styling should be done via inline styling and/or class switching. I'll share a demo repo once I've got things whipped into shape. Here's an example of how a component uses the implementation: https://gist.github.com/nathanmarks/ec796ef3dcc59db86eef19acce82e29e |
I am wondering why do you need "Deterministic class names based on the theme" at all with jss? |
@nathanmarks any progress there?
I think you will need something like this Lets build a working version for material ui and add it then to react-jss.
This requires a separate issue with discussion, I am open to get there. Also you might want to consider theme-standard
-> #221 let me know what you need. |
Curious, what is the reason that you don't want to use HoC? |
Progress is going well. I am preparing an example to share with the other contributors to get their opinions + feedback. Once I've presented it to the others and validated the concept (very soon), I'm open to a discussion on we can better support some of the features in I have a working demo right now that isn't using a HoC (albeit it does require some boilerplate in the component for mount/unmount) and uses a customizable theme. In order to properly support themes + concurrency in node, the My only worry with a The project that my experiment is intended for is a UI component library. Part of the reason we're planning on moving to a JS style library is due to performance issues and shortcomings as a result of just using inline styling. There are several features that we would like to use HoCs for, but the problem is that design does not scale well (depending on application size+complexity+setup and # of HoCs). Let's say you have 3 HoCs on a checkbox component and a table with 40 rows containing a checkbox in each. That's 160 component instances just for the checkboxes. Our checkboxes also have a ripple component which could add another another 80 component instances. Already we're looking at 240 instances just for the checkboxes. Lastly, this is all hidden from the user as they are just importing However... one of us is also working on a library that will allow us to compose a single HoC with multiple features without intruding on component logic to save on the # of component instances. But even with this we would need to pass the "HoC" lifecycle functions ourselves. |
deterministic classes generation is released. |
To sum up the progress about issues discussed here:
|
Hi everybody, we are back to this issue, I am struggling to validate the original problem existence, any one ideas? #432 (comment) |
cc @JedWatson do you know what it was originally? |
This is a better place to discuss this very broad topic. @JedWatson posted a great feedback I would better discuss here.
Nice work, @kof. I've spent a lot of time thinking about the same thing, and done a lot of work recently with @jossmac and @josephg on proofs of concept around the same things.
After trying to use JSS in a production project that needs server-side rendering, we've found two major blockers; non-deterministic generation of class names is the big one (this is solved by aphrodite and css-modules) and having no way to rehydrate the JSS state on client-side render is the other (also solved by aphrodite, and related to their solution for deterministic class names)
Adding and removing stylesheets as they are used (which is done by
react-jss
) is nice, but also causes some problems related to the above. Maybe the solution here is a different package for react integration.The other two major issues we've found, not specific to server-side rendering, and both solvable (imo) are:
css
method, which is uglier than how you use jss, but on the whole is nicer than having wrapping components everywhere)react-jss
implementation and my previous point. This prevents you from changing styles at run-time, e.g. allowing theme properties (such as border radius, for example) to be provided through props or context to a component. This is a huge limitation in terms of building a generic library of UI components.To give some more background, that project I mentioned - we wrote it initially with JSS (and loved it, by the way, huge props for the work you have done on it) but for the above reasons had to switch over to aphrodite late in development. In good news, it wasn't that much to change, the two are fairly easy to port between (except for all the
css(...)
statements that had to be added everywhere) and we now have a fairly complete understanding of the pros and cons of both.If you're happy to work through the above issues with us, I would love to use Elemental and our other projects as real-world cases to establish
theme-standard
and make JSS more capable. This PR is a great start.Let me know what you think, and I'll ping @nikgraf and @mxstbr for their feedback too - Max is taking a lead role in Keystone's development at the moment which is one of the most significant uses of Elemental at the moment, and I know Nik has interest in this space too with belle and react-future-ui
The text was updated successfully, but these errors were encountered: