-
-
Notifications
You must be signed in to change notification settings - Fork 426
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
Proposal: React Library Spec #58
Comments
This looks great, and is very exciting. I have a couple points of feedback. On the MUIButton and MUIDropdown components you're using the attribute The Prefixing everything with For example: import { Button } from 'muicss/react';
const MyComponent = ()=> <Button>+1</Button>; That is nice and clean. In the off chance I have a conflict with the name import { Button } from 'react-bootstrap';
import { Button as MUIButton } from 'muicss/react';
const MyComponent = ()=> <MUIButton>+1</MUIButton>; Or even import { Button } from 'react-bootstrap';
import MUI from 'muicss/react';
const MyComponent = ()=> <MUI.Button>+1</MUI.Button>; This kind of approach is much more consistent with the best practices in the React ecosystem. Thanks for all the work here! I think there is a real opportunity for a Material UI React component set. material-ui is nice and all, but it uses exclusively inline styles, which turns off a lot of people (myself included). MUI is a nice clean CSS framework and a suit of components that simply uses those classes will be much nicer to use and customize. |
Thanks for your excellent feedback! I've incorporated your suggestions into the spec (see above). Do you have any recommendations for an attribute name to replace "style"? |
I'm not sure. |
Good thing we don't have to worry about cache invalidation. Do you have a preference?
The MD spec refers to them as "Button Types": |
|
Agreed... I'm leaning towards 'variant'.
|
@defrex I have a version of the MUI React library that implements the proposed spec. I want to spend time optimizing the code and writing more unit tests but it'd be useful to get your thoughts on the code beforehand: Note that it isn't being exposed via |
@amorey This is looking pretty awesome! |
I went ahead and built the react branch and am running the components through the paces in a sample application. A couple of things that I've come across so far:
I'm happy to create a pull request for either or both of these if you'd be interested. |
@danmartinez101 Great! Happy to hear you like the spec. What problems did you run into with webpack? Was it an issue with ES6 or JSX syntax? I've been thinking about the best way to expose MUI via an NPM package and so far I've been playing around with using a build step to create a $ ./node_modules/.bin/gulp build-pkg Install the package using the local repo: $ npm install /path/to/mui/pkg And then access the exposed modules in nodejs: > var overlay = require('muicss').overlay;
> var Button = require('muicss/react').Button; I'm just starting to work on this so let me know if you have any recommendations on how to expose MUI via NPM and make it work with webpack. With regards to the |
@danmartinez101 Thanks for the I've been playing around with your "monorepo" idea in that branch and so far I think it's looking pretty good. If you want to try to split up the work let me know. I think we can use this gulp pattern to cleanly divide up the build tasks: https://github.com/muicss/mui/blob/react-packages/gulpfile.js#L27-L30. |
That package structure is looking pretty clean :) 👍 I'll be free a bit next week, so I'll ping you on gitter and see if there is anything I can help out with. |
+1 awesome work guys! really looking forward to trying this out when it's ready. |
@defrex @danmartinez101 @FoxxMD Thanks for your patience! We now have a version of MUI React that implements the proposed spec above: Based on @danmartinez101's recommendation I created a "monorepo" structure and split out the CDN/NPM/Meteor packages into separate directories. There's still work to do with Bowser and Meteor but here's the NPM package including the README: If you have some time, please take a look at the README to see if you have any suggestions on how to improve the spec or the README itself. Once this is ready we can add more examples to https://www.muicss.com and then launch! One more question - what is your preferred way to include CSS in React apps? Should we add |
This looks great! Thanks for all the hard work. Regarding CSS, I'd love to see both the CSS and the SASS source included in the NPM package. When using webpack you can easily import CSS from NPM deps, and if the user is using SASS, the source can be imported directly to enable custom builds. |
I agree with @defrex on including both css and sass in source. The README looks good! The links to the docs don't work but I'm sure that still a work in progress :) |
I don't think there is anything special you need to do (but @defrex please correct me if I'm wrong). Including the |
Agreed. Doesn't matter much where it lives in the structure, as long as it's somewhere. |
@danmartinez101 @defrex @FoxxMD The above spec has been implemented in v0.3.0-rc1 along with CSS and SASS files: The documentation on the main website is coming soon. Let me know what you think of the new version! |
Hi Everyone,
We're planning an upgrade to the MUI React library to make it production-ready. Please let us know what you think of this spec:
Components
Appbar
Buttons
Caret
Container
Dividers
Dropdowns
Forms
Grid
Panel
Tabs
CSS Helpers
JavaScript API
Overlay
The text was updated successfully, but these errors were encountered: