tleunen / react-mdl

React Components for Material Design Lite
https://tleunen.github.io/react-mdl/
MIT License
1.76k stars 255 forks source link

Getting Started Documentation #352

Closed 1j01 closed 8 years ago

1j01 commented 8 years ago

When I was getting started with this project I had no idea how to include and access the library. I ended up creating my own browser bundle with browserify, which worked for a while until I ran into a problem because my bundle contained a second copy of React. I only found out from this closed issue that there is already a browser bundle, ReactMDL.js. It's just only on npm and not in the repo, even though there's lots of other stuff in the repo for distribution purposes. (I've since updated my usage, getting rid of webpack.)

The README should explain how to install and include the library. You don't need to import it (which isn't supported in major browsers), or use browserify or webpack, you can just copy node_modules/react-mdl/out/ReactMDL.js to a lib or vendor folder and include it as a script (unless you have a setup where you can rely on the existence of node_modules)

I could create a PR with some improvements.

tleunen commented 8 years ago

Hi @1j01,

I understand the way you do to use the library will also work, but most users will use webpack or browserify to bundle their project, and therefore include react-mdl using the same way.

Either way, I also believe a "getting started" document might help people to better understand how to use the lib. Would you want to help on this?

1j01 commented 8 years ago

Yes, it should explain how to use it with webpack or browserify. I'd be using one of those if I could get a live-reloading working with either. So, were you thinking this should be a separate document? I was thinking of just having all the information on the README, except for the external examples (which benefit from the interactivity). In other words, READMEs are generally the getting started documents, no? Not that it matters that much.

tleunen commented 8 years ago

Having it in the readme is fine, unless it becomes too big. Either way, we can start with that and move it in another file later if necessary.

1j01 commented 8 years ago

Sounds good, I'll send a PR soon.