-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Material and Meteor #331
Comments
I don't have any experience with meteor. I know there's a react-meteor project, but it looks to be outdated. - https://github.com/reactjs/react-meteor |
There is actually fresher one with 0.12.2 So material and meteor is no dice right now. |
I just tried using material-ui with https://github.com/mystor/meteor-routecore and am getting an error. I added meteor-routecore in the normal way, using var mui = Meteor.npmRequire('material-ui')
, Toolbar = mui.Toolbar;
App = React.createClass({
render: function() {
return (
<Toolbar>
<h3>Todos</h3>
</Toolbar>
);
}
}); I'm getting this error in the console: W20150220-17:13:03.225(-5)? (STDERR) Warning: Something is calling a React component directly. Use a factory or JSX instead. See: http://fb.me/react-legacyfactory
W20150220-17:13:03.227(-5)? (STDERR) Warning: Unknown DOM property class. Did you mean className?
W20150220-17:13:03.354(-5)? (STDERR) Error while rendering path: /
W20150220-17:13:03.354(-5)? (STDERR) TypeError: Cannot read property 'ref' of undefined
W20150220-17:13:03.354(-5)? (STDERR) at [object Object].ReactComponent.Mixin.mountComponent (/Users/gerard/_work/talk-react-meteor/.meteor/local/isopacks/npm-container/npm/node_modules/material-ui/node_modules/react/lib/ReactComponent.js:255:37)
W20150220-17:13:03.354(-5)? (STDERR) at [object Object].ReactCompositeComponentMixin.mountComponent (/Users/gerard/_work/talk-react-meteor/.meteor/local/isopacks/npm-container/npm/node_modules/material-ui/node_modules/react/lib/ReactCompositeComponent.js:766:43)
W20150220-17:13:03.355(-5)? (STDERR) at [object Object].wrapper [as mountComponent] (/Users/gerard/_work/talk-react-meteor/.meteor/local/isopacks/npm-container/npm/node_modules/material-ui/node_modules/react/lib/ReactPerf.js:50:21)
W20150220-17:13:03.355(-5)? (STDERR) at [object Object].ReactMultiChild.Mixin.mountChildren (packages/mystor:routecore/react-with-addons-0.11.1.js:12230:1)
W20150220-17:13:03.355(-5)? (STDERR) at [object Object].ReactDOMComponent.Mixin._createContentMarkup (packages/mystor:routecore/react-with-addons-0.11.1.js:7793:1)
W20150220-17:13:03.355(-5)? (STDERR) at [object Object].ReactDOMComponent.Mixin.mountComponent (packages/mystor:routecore/react-with-addons-0.11.1.js:7715:1)
W20150220-17:13:03.355(-5)? (STDERR) at [object Object].mountComponent (packages/mystor:routecore/react-with-addons-0.11.1.js:12718:1)
W20150220-17:13:03.355(-5)? (STDERR) at [object Object].ReactCompositeComponentMixin.mountComponent (packages/mystor:routecore/react-with-addons-0.11.1.js:6560:1)
W20150220-17:13:03.355(-5)? (STDERR) at [object Object].mountComponent (packages/mystor:routecore/react-with-addons-0.11.1.js:12718:1)
W20150220-17:13:03.355(-5)? (STDERR) at packages/mystor:routecore/react-with-addons-0.11.1.js:13659:1 Everything works fine if I replace |
https://github.com/reactjs/react-meteor is back and being supported by Ben Newman, formerly of Facebook and now MDG team. The https://github.com/hipertracker/meteor-reactjs repo was forked from this a few months ago and updated to current react version, but is now outdated with a few features being added to react-meteor like component level subscriptions. All that aside, I can't get material-ui to work either. Meteorhacks https://github.com/meteorhacks/npm/ only provides npm requirements for things running on the server, so anything accessed in the client will return undefined. I'm not sure how to browserify into a meteor project... |
Now there is also grovelabs:react by @lourd I hope will be possible to install this project in Meteor without forking |
anyone able to package this for meteor? i love react + meteor and the material-ui components make so much more sense than materializecss. |
Unfortunately this is part of a much bigger question, which is npm packages on the client in Meteor. The Meteor build system is awesome in many ways, but there's no good/easy way to use libraries built for npm and tools like browserify, webpack, broccoli, gulp, etc. That But a hacky way of getting it to work right now is what we want! 😄 Step 1: finding out what this build script does. I haven't used browserify before, I'll report back but definitely try it yourself as well |
Also did a quick check on the forums for active discussions: found this thread where someone mentioned this meteor package which is using |
I've got the Javascript imports working main.js requires React and material-ui and exposes them globals. Meteor picks up the bundle.js file without a problem. This doesn't load in any of the stylesheets of course |
But it does now! 😆 using our @material-ui: "../node_modules/material-ui/src/less";
@import "@{material-ui}/scaffolding.less";
// put custom import here
@import "@{material-ui}/components.less"; And they're brought in just fine, verified by checking the CSS delivered to the client. |
Nice, so you are able to inherit material-ui components and compose higher level ones with |
The repo actually doesn't using either. Using browersify on the node_modules installed by doing |
Or maybe I should say *not yet. It's strictly at tech hack stage, to do anything with the available imports you'll probably want to use grigio:babel for JSX compiling. Using |
Wait, so you got browserify working?! |
Haha, no, not fluidly. Just including the output from browserify as one big file in the Meteor app |
For those feeling adventurous, I just published Note that this is based on master and so uses inline styles for the components. Currrently, there is no reset CSS so some things may look a bit odd. You also have to make sure to use the theme manager properly (#30 (comment)). It also need |
I tried with cosmos:browserify and it works. Unfortunatly the provided CSS styles seems to not be loaded. UPDATE: |
Hey, here's a super simple example app: https://github.com/meteor/react-packages/tree/master/examples/material-ui-leaderboard |
material-ui works fine with Meteor, so this issue can presumably be closed, as the problems now are largely with material-ui's idiosyncratic API, and bugs, rather than any specific incompatibility. |
👋 Thanks for using MUI Core! We use GitHub issues exclusively as a bug and feature requests tracker, however, For support, please check out https://mui.com/getting-started/support/. Thanks! If you have a question on Stack Overflow, you are welcome to link to it here, it might help others. |
Is there any experience with using this with Meteor?
The text was updated successfully, but these errors were encountered: