Coder Social home page Coder Social logo

react-meteor's Introduction

react-meteor

This repository defines a Meteor package that automatically integrates the React rendering framework on both the client and the server, to complement or replace the default Handlebars templating system.

The React core is officially agnostic about how you fetch and update your data, so it is far from obvious which approach is the best. This package provides one answer to that question (use Meteor!), and I hope you will find it a compelling combination.

Quick start

If you have not yet installed Meteor, do that:

curl https://install.meteor.com | /bin/sh

Clone this repository:

git clone https://github.com/reactjs/react-meteor.git

Fire up one of the examples:

cd react-meteor/examples/leaderboard
meteor

Finally, visit localhost:3000 in your browser. For extra fun, try using the example in multiple browser windows!

Adding the package to your app

The officially recommended way to add this package to your app is simply to execute the following commands:

cd path/to/my-app/
meteor add reactjs:react

How it works

The package exposes a special ReactMeteor.Mixin object that can be used to enable reactive data fetching for your React components.

To add the ReactMeteor.Mixin to a React component, simply include it in the mixins class property:

var MyComponent = React.createClass({
  mixins: [ReactMeteor.Mixin],

  startMeteorSubscriptions: function() {
    Meteor.subscribe("players");
  },

  // Make sure your component implements this method.
  getMeteorState: function() {
    return {
      playerCount: Players.find().count(),
      ...
    };
  }
});

The startMeteorSubscriptions method is optional, and should be implemented when the component needs to subscribe to specific query sets using Meteor.subscribe It will be called in a Tracker.autorun callback, so the subscriptions will be canceled automatically when the component is unmounted.

The getMeteorState method should return an object of properties that will be merged into this.state, for easy access in the component's render method or elsewhere. Dependencies will be tracked for any data accessed by getMeteorState so that the component can be automatically re-rendered whenever the data changes.

Alternatively, if you prefer not to declare mixins explicitly, you can create the class with ReactMeteor.createClass:

var MyComponent = ReactMeteor.createClass({
  startMeteorSubscriptions: function() {
    Meteor.subscribe("players");
  },

  // Make sure your component implements this method.
  getMeteorState: function() {
    return {
      playerCount: Players.find().count(),
      ...
    };
  }
});

react-meteor's People

Contributors

benjamn avatar froatsnook avatar jemgold avatar mikowals avatar mxw avatar petehunt avatar possibilities avatar spendar89 avatar tmeasday avatar truptinayak avatar ukabu avatar yazaddaruvala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-meteor's Issues

Data loaded notification

Hi,

Is there a way to check if the data in getMeteorState has been loaded completely by minimongo?

For example with a component with getMeteorState such as

getMeteorState: function() {
    return { posts: Post.find().fetch() }
}

getMeteorState is called twice, once with the posts being an empty array ([]) and again when the actual content is loaded.

I thought I could find out if the data was loaded by checking to see the length of the posts is greater than zero, however if there are no posts in the database we can't distinguish whether the data has been loaded or if the actual count of posts is zero.

My use case for this functionality is setting up a spinner in case the data isn't loaded yet.

How does getMeteorState interact with getInitialState and setState?

Hello,
Thank you for making react-meteor!
I do have one question though as it's not clear reading the source code: If I call setState somewhere else in the same component, does it overwrite getMeteorState or does the items returned by getMeteorState overwrite the call to setState? Also, can I still have getInitialState and would it properly be picked up by getMeteorState?

Thanks

Errors running: meteor run android

Using Mac OS X, I get the following errors running: meteor run android. I can run other Blaze meteorJS projects OK in the Android simulator, but not this react-meteor leaderboard example. See errors below, btw: I did meteor update to v1.1, and this ReactJS example works OK in Chrome browser.

users-MacBook-Pro:leaderboard carlf$ meteor run android
[[[[[ ~/Documents/dev/meteor/react-meteor/examples/leaderboard ]]]]]

=> Started proxy.                             
=> Started app on Android Emulator.           
=> Started MongoDB.                           
=> Started your app.                          

=> App running at: http://localhost:3000/
I20150331-22:39:48.835(-4) (android:http://meteor.local/leaderboard.jsx.js:8) Uncaught ReferenceError: React is not defined
I20150331-22:39:48.931(-4) (android:http://meteor.local/packages/blaze.js:2977) Uncaught Error: No such template: Leaderboard
I20150331-22:39:48.956(-4) (android:http://meteor.local/packages/blaze.js:2977) Uncaught Error: No such template: Leaderboard

State and publications/subscriptions without Session - Question

Working on my first component, a searchable users list. Trying to keep it simple to get started, however running into some conceptual difficulties.

If I subscribe to all users with Meteor.subscribe('users'); and then filter them out with something like title.indexOf(this.props.searchText) == -1, won't I still be loading all 1000 (one day...) users?

It would be best to setup a publication with the searchTerm, right? Something like Meteor.publish("searchable_users", function (searchTerm, limit) { ...

But it seems that getMeteorState is not updating reactively with this.state.searchText. If I change this to a Session variable and make the publication search using the Session var, it works fine, but this feels very un-react like doesn't it? The Session variables are completely out of scope with the react components, which are attempting to keep everything self contained and testable. Don't Session vars create additional state management that have to be dealt with?

Here's a code non-filtering example that should help illustrate. Am I misunderstanding something?

if (Meteor.isServer) {
  Meteor.publish("searchable_users", function(searchTerm, limit) {
    return Meteor.users.find({
      "profile.name": {
        $regex: searchTerm,
        $options: 'i'
      }
    }, {
      limit: limit
    });
  });
}


if (Meteor.isClient) {
  var SearchableUserList = ReactMeteor.createClass({
    getInitialState: function() {
      return {
        searchText: ""
      };
    },
    startMeteorSubscriptions: function() {
      return Meteor.subscribe('searchable_users', this.state.searchText, 10);
    },
    getMeteorState: function() {
      // Also tried adding the find{$regex} function here, but doesn't work either
      return {
        users: Meteor.users.find()
      };
    },
    handleInput: function(searchText) {
      return this.setState({
        searchText: searchText
      });
    },
    render: function() {
      return (
        <div>
          <SearchInput
            inputText={this.state.searchText}
            handleInput={this.handleInput}
          />
          <BoxedList
            items={this.state.users}
            titleKey={'profile.name'}
          />
        </div>
      )
    }
  });

  var SearchInput = React.createClass({
    onChange: function() {
      return this.props.handleInput(this.refs.searchInput.getDOMNode().value);
    },
    render: function() {
      return (
        <div>
          <input
            type="text"
            ref="searchInput"
            value={this.props.inputText}
            onChange={this.onChange}
          />
        </div>
      )
    }
  });

  var BoxedList = React.createClass({
    render: function() {
      return (
        <div>
          {
            this.props.items.map (item) =>
              title = eval('item.' + this.props.titleKey)
              # return if title.indexOf(this.props.searchText) is -1
              <ListItem key={item._id} title={title} />
          }
        </div>

      )
    }
  });

  var ListItem = React.createClass({
    render: function() {
      return (
        <div>{this.props.title}</div>
      )
    }
  });
}

How to use separate .JSX files for ReactJS components?

I can't figure out how to use separate .jsx files for ReactJS components. I tried just putting the component in it's own file.

Then tried using var Player = require('./player'); with module.exports = "Player"; in player.jsx along with mkdir client, cd client, npm install require, with the player.jsx file in the /client.

Then tried renaming to player.js.

Can't figure this out.

strange update behaviour

Hi there, I am seeing some strange behaviour when reactive data changes.
This is what I have

AnnotationListComponent = ReactMeteor.createClass({
  getMeteorState: function() { return {
    annotations: Annotation.documents.find({},{sort: {rank: 1}}).fetch() };
  },
  handleDrop: function(e, ui) {
    ...
    Meteor.call('annotation-update-publication-rank', Meteor.userId(), el.id , newRank);
  },
  componentDidUpdate: function(){
    console.log( _.pluck(this.state.annotations,'content') )
    console.log( _.pluck(this.state.annotations,'rank') )
  },
  renderAnnotation: function(annotation){ return <AnnotationListItemComponent key={annotation._id} rank={annotation.rank} content={annotation.content} id={annotation._id} /> },
  componentDidMount: function(){
    jQuery(this.getDOMNode()).sortable({
      handle: ".handle",
      stop: this.handleDrop
    })
  },
  render: function(){
    return (
      <div className='uk-list'>
        {this.state.annotations..map(this.renderAnnotation)}
      </div>
    )
  }
});

It is basically a sortable list which updates the rank after a list item is dropped and shows the items in the new order. Everything works fine. When an item is dropped, the Meteor.call method is triggered and the rank is changed. However, the view does not rerender the items in the correct order. Instead, it rerenders them in the old order. I had a look a the new data: the output in the componentDidUpdate shows the correct order. In addition, when having a second browser window open, the items are displayed in their correct order.

Any ideas?

react/addons?

After cloning into packages/react, I was getting an error with react-addons.

Error: Can't find npm module 'react/addons'. Did you forget to call 'Npm.depends' in package.js within the 'react' package?

Editting package.js resolves the issue, but not what is causing it?

Npm.depends({
  "react": reactVersion,
  "react-addons": "0.9.0",
});

Make react-tools JSX compilation optional

Forcing compilation with react-tools stops you from using Babel -

=> Errors prevented startup:

   While building the application:
   error: conflict: two packages included in the app, grigio:babel and react, are both trying to handle .jsx

Not a huge deal, but Babel supports way more ES6 fun stuff than react-tools.

Separate jsx files

I’m having difficulties figuring out how to separate react components into jsx files and loading one of them as a child into another.

var PostsList = ReactMeteor.createClass({
  ...
  render: function() {
    var children = this.state.posts.map(function(post) {
      return <Post key={post._id} title={post.title}/>
    })

    return (
      <div className="posts">
        { children }
      </div>
    );
  }
});

var Post = ReactMeteor.createClass({
  render: function() {
    return (
      <div className="post">
        {this.props.title}
      </div>
    );
  }
});

This seems to work as a single file, but I’m thinking if it’s possible to load have Post as a separate jsx template, because I’m getting this error:

Exception from Tracker afterFlush function: Post is not defined
ReferenceError: Post is not defined
    at http://localhost:3000/client/views/postsList.jsx.js?2f15d1d2d163aef174c55b73f6c1dd1b386e7851:16:34

package not found when ROOT_URL environment variable defined

Hello. Thanks so much for making this package!

I'm having trouble getting the file react-with-addons*.js to load when the ROOT_URL environment variable is set.

For example, if ROOT_URL is set to http://localhost:3000/myApp, I see that the reactjs_react.js file is correctly referenced in <head> as
<script type="text/javascript" src="/myApp/packages/reactjs_react.js?..etc.."></script>

But the react-with-addons*.js file shows up as
<script src="/packages/reactjs_react/vendor/react-with-addons-0.13.0.js"></script>
without the root path prefix.

Is there a way I could get around this? Thanks!

Crash while using react-meteor

I am getting this crash on app launch

It's in a fresh test app.

My packages are

standard-app-packages
autopublish
insecure
routecore
bootstrap-3
npm
bower
define
react

any my smart.json has

{
"bower": {
"react-bootstrap-bower": {
"source": "git://github.com/react-bootstrap/react-bootstrap-bower.git",
"version": "0.9.0"
}
},
"packages": {
"routecore": {},
"bootstrap-3": {},
"bower": {},
"npm": {},
"react": {},
"define": {}
}
}

/Users/mtozer/.meteor/tools/c2a0453c51/lib/node_modules/fibers/future.js:173
throw(ex);
^
TypeError: Cannot read property 'name' of undefined
at /Users/mtozer/.meteor/tools/c2a0453c51/tools/packages.js:750:28
at Function..each..forEach (/Users/mtozer/.meteor/tools/c2a0453c51/lib/node_modules/underscore/underscore.js:87:22)
at /Users/mtozer/.meteor/tools/c2a0453c51/tools/packages.js:745:9
at Array.forEach (native)
at Function..each..forEach (/Users/mtozer/.meteor/tools/c2a0453c51/lib/node_modules/underscore/underscore.js:79:11)
at _.extend._allHandlers (/Users/mtozer/.meteor/tools/c2a0453c51/tools/packages.js:744:7)
at .extend.registeredExtensions (/Users/mtozer/.meteor/tools/c2a0453c51/tools/packages.js:768:24)
at slice.getSourcesFunc (/Users/mtozer/.meteor/tools/c2a0453c51/tools/packages.js:1713:41)
at .extend.build (/Users/mtozer/.meteor/tools/c2a0453c51/tools/packages.js:279:17)
at /Users/mtozer/.meteor/tools/c2a0453c51/tools/packages.js:1088:13
at Array.forEach (native)
at Function.
.each.
.forEach (/Users/mtozer/.meteor/tools/c2a0453c51/lib/node_modules/underscore/underscore.js:79:11)
at _.extend.build (/Users/mtozer/.meteor/tools/c2a0453c51/tools/packages.js:1087:7)
at _.extend.getForApp (/Users/mtozer/.meteor/tools/c2a0453c51/tools/library.js:285:9)
at /Users/mtozer/.meteor/tools/c2a0453c51/tools/bundler.js:1762:25
at Object.capture (/Users/mtozer/.meteor/tools/c2a0453c51/tools/buildmessage.js:191:5)
at Object.exports.bundle (/Users/mtozer/.meteor/tools/c2a0453c51/tools/bundler.js:1697:31)
at _.extend._runOnce (/Users/mtozer/.meteor/tools/c2a0453c51/tools/run-app.js:396:32)
at _.extend._fiber (/Users/mtozer/.meteor/tools/c2a0453c51/tools/run-app.js:520:28)
at /Users/mtozer/.meteor/tools/c2a0453c51/tools/run-app.js:340:12

Any ideas?

Hot reload

Thanks for great component. Just wonder if it is possible to add hot reload feature, or it is limitation of meteor web server itself.

Why CDN?

Is there any reason you add a script tag and use a CDN as opposed to packaging the js within this package? I noticed this today when I didn't have internet...

Reactivity fails when props are changed

Thanks for a great package, I've been using it to great success. Unfortunately I just discovered it has a pretty major bug.

The current implementation assumes that this._meteorComputation is dependent on whatever set of reactive data sources were accessed when getMeteorState was run at mount-time.

If props are changed, getMeteorState is re-run but not in a reactive context. The problem is that getMeteorState may access a dynamic set of reactive variables that depend on the current prop values, so the reactivity stops working once props are changed.

Component isn't being destroyed after template is destroyed

I have route like this

this.route('teacherSelect', {path: '/teacherSelect', controller: TeacherSelectController});

and a component defined like component in this project example.

When I visit /teacherSelect page, I get component rendered. When I go to another page by any link (placed in iron-router layout inside what component is rendered), new template being rendered, but old one with component still linger on page! : ) Important thing may be that these other templates aren't react-enabled and use Blaze as I introduce this in existing project.

Feature Request: Server Side Rendering

As we all know Meteor currently suffers from a problem with SEO due to the initial payload not containing any actual html templates.

Giving that react supports SSR (Server Side Rendering) thanks to the Virtual DOM, I think this would be an absolutely killer feature for most meteor apps, and I would love to spend some energy figuring out if this is possible.

It's probably quite a complex job, but let's open up the floor to ideas and approaches! I'm sure some of those reading this know more about the obstacles than I.

My first thought is to use inject-initial and/or iron-router to send pre-rendered templates if a user lands on a particular route. We'd need to get the client session and render out the route with the relevant subscriptions. I would imagine there would then be some intricacies for handing rendering over to the client for subsequent reactivity.

Anyway, anyone think this is is possible or worth looking into?

How are JSX transformed

  • Can you update the docs to explain how JSX get's transformed to JavaScript using react-meteor?
  • Do you need require() statements when separate ReactJS into multiple files; or does Meteor's build system automatically take care of this?

getMeteorState fine-grained reactivity

Suppose you have multiple states you want to get.

getMeteorState: function() {
  return {
    something: Somethings.find().fetch()
    otherthing: Otherthings.find().fetch()
  }
}

Whenever the smallest thing changes in either collection, BOTH will be rerun. It seems like this should look more like Template.helpers.

getMeteorState: {
    something: function() {Somethings.find().fetch()}
    otherthing: function() {Otherthings.find().fetch()}
}

Update to React 0.9.0

It would be great if the package would be updated to get the newest features in React v0.9.

I tried to fork the package and do it myself, but it seems to be harder than I thought initially:

  • Replaced version var reactToolsVersion = "0.9.0"; in package.js
  • Updated vendors file to vendor/react-0.9.0.js

After doing this I get errors when trying to run the example and in my app.

Compatibility between React and Blaze

Is it possible that only one Blaze template internals would be React, but that the rest of it would be Blaze? So that it is possible to use existing templates and components, and then include some React at some parts? Maybe through {{{react}}}?

Permission error on installing

After running

echo react >> .meteor/packages
git clone https://github.com/benjamn/react-meteor.git packages/react

my meteor app is crashing with errors like:

$ meteor
[[[[[ ~/c/curves ]]]]]

=> Started proxy.
compileJSX: updating npm dependencies -- react, react-tools...
=> Started MongoDB.
npm ERR! Error: EACCES, mkdir '/Users/ryan/.npm/through/2.3.6'
npm ERR!  { [Error: EACCES, mkdir '/Users/ryan/.npm/through/2.3.6']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/ryan/.npm/through/2.3.6',
npm ERR!   parent: 'envify' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 14.1.0
npm ERR! command "/Users/ryan/.meteor/packages/meteor-tool/.1.0.40.959pzb++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/bin/node"
"/Users/ryan/.meteor/packages/meteor-tool/.1.0.40.959pzb++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/bin/npm" "install" "[email protected]"
npm ERR! cwd /Users/ryan/c/curves/packages/react/.npm/plugin/compileJSX-new-1yfuxd2
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /Users/ryan/.npm/through/2.3.6
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/Users/ryan/.npm/through/2.3.6'
npm ERR! not ok code 0

Seems like some kind of permissions are screwy on my system, but I don't really have a mental model of what is calling npm install and why, where it's trying to write to, etc., so if anything is obvious to you about what might cause this lmk! Thanks!

The /Users/ryan/.npm directory referenced is owned by user ryan, which is also the user running meteor.

Get current user in GetMeteorState

Hi

I tried to get current user in get meteorstate as follows.
getMeteorState: function() {
console.log(Meteor.user();
return {
foo : 'foo'
};
},

But I get Meteor.user() is undefined. Is there a way to retrieve current user in the state? It's a client code, so i believe the function (meteor.user()) is valid

How usable is this?

As the title asks. I'm not too into Meteor's UI system and am curious if this could replace it entirely. I want to try some side projects with Meteor but don't want to do them before the new UI system is out for Meteor, but if this package could supplant Meteor's new UI system that would be fantastic.

Thanks for listening to my rambly questions.

This is fun

Hi, I'm having fun playing around with your code. My fork uses react to render first on the server, and client-side routing with page.js to update the page with the correct react root component. I used your leaderboard example and created a page for each player. I have really no experience with either meteor or react so was happy to see how easy this was. What I wonder most is what the best way, with meteor, to inject the rendered html into the response. Any tips?

React sub-modules, routing

It is not clear from demo, how to split React components to many files effectively. How to use routing, Flux approach, etc. because Meteor supports node 'require' only on server side... Again, maybe it is not issue of react-meteor but Meteor framework.

Leaderboard example, Error: Can't find npm module 'react/addons'. Did you forget to call 'Npm.depends' in package.js within the 'reactjs_react' package?

Leaderboard example, Error: Can't find npm module 'react/addons'. Did you forget to call 'Npm.depends' in package.js within the 'reactjs_react' package?

If run meteor update it works, however, why won't it work as is?

=> Exited with code: 8                        
W20150402-22:17:02.698(-4)? (STDERR) 
W20150402-22:17:02.700(-4)? (STDERR) /Users/carlf/.meteor/packages/meteor-tool/.1.0.40.1iucsya++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:173
W20150402-22:17:02.701(-4)? (STDERR)                            throw(ex);
W20150402-22:17:02.701(-4)? (STDERR)                                  ^
W20150402-22:17:02.701(-4)? (STDERR) Error: Can't find npm module 'react/addons'. Did you forget to call 'Npm.depends' in package.js within the 'reactjs_react' package?
W20150402-22:17:02.702(-4)? (STDERR)     at Object.Npm.require (/Users/carlf/Documents/dev/meteor/react-meteor/examples/leaderboard/.meteor/local/build/programs/server/boot.js:147:17)
W20150402-22:17:02.702(-4)? (STDERR)     at ReactMeteorMixin.componentWillMount.self (packages/reactjs:react/src/require-react.js:1:1)
W20150402-22:17:02.702(-4)? (STDERR)     at /Users/carlf/Documents/dev/meteor/react-meteor/examples/leaderboard/.meteor/local/build/programs/server/packages/reactjs_react.js:48:4
W20150402-22:17:02.702(-4)? (STDERR)     at /Users/carlf/Documents/dev/meteor/react-meteor/examples/leaderboard/.meteor/local/build/programs/server/packages/reactjs_react.js:223:3
W20150402-22:17:02.702(-4)? (STDERR)     at /Users/carlf/Documents/dev/meteor/react-meteor/examples/leaderboard/.meteor/local/build/programs/server/boot.js:205:10
W20150402-22:17:02.702(-4)? (STDERR)     at Array.forEach (native)
W20150402-22:17:02.702(-4)? (STDERR)     at Function._.each._.forEach (/Users/carlf/.meteor/packages/meteor-tool/.1.0.40.1iucsya++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150402-22:17:02.703(-4)? (STDERR)     at /Users/carlf/Documents/dev/meteor/react-meteor/examples/leaderboard/.meteor/local/build/programs/server/boot.js:116:5
W20150402-22:17:05.794(-4)? (STDERR)          
W20150402-22:17:05.795(-4)? (STDERR) /Users/carlf/.meteor/packages/meteor-tool/.1.0.40.1iucsya++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:173
W20150402-22:17:05.795(-4)? (STDERR)                        throw(ex);
W20150402-22:17:05.795(-4)? (STDERR)                              ^
W20150402-22:17:05.799(-4)? (STDERR) Error: Can't find npm module 'react/addons'. Did you forget to call 'Npm.depends' in package.js within the 'reactjs_react' package?
W20150402-22:17:05.799(-4)? (STDERR)     at Object.Npm.require (/Users/carlf/Documents/dev/meteor/react-meteor/examples/leaderboard/.meteor/local/build/programs/server/boot.js:147:17)
W20150402-22:17:05.799(-4)? (STDERR)     at ReactMeteorMixin.componentWillMount.self (packages/reactjs:react/src/require-react.js:1:1)
W20150402-22:17:05.799(-4)? (STDERR)     at /Users/carlf/Documents/dev/meteor/react-meteor/examples/leaderboard/.meteor/local/build/programs/server/packages/reactjs_react.js:48:4
W20150402-22:17:05.799(-4)? (STDERR)     at /Users/carlf/Documents/dev/meteor/react-meteor/examples/leaderboard/.meteor/local/build/programs/server/packages/reactjs_react.js:223:3
W20150402-22:17:05.799(-4)? (STDERR)     at /Users/carlf/Documents/dev/meteor/react-meteor/examples/leaderboard/.meteor/local/build/programs/server/boot.js:205:10
W20150402-22:17:05.799(-4)? (STDERR)     at Array.forEach (native)
W20150402-22:17:05.799(-4)? (STDERR)     at Function._.each._.forEach (/Users/carlf/.meteor/packages/meteor-tool/.1.0.40.1iucsya++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150402-22:17:05.800(-4)? (STDERR)     at /Users/carlf/Documents/dev/meteor/react-meteor/examples/leaderboard/.meteor/local/build/programs/server/boot.js:116:5
=> Exited with code: 8

2 warnings in browser console when running latest meteor `version 1.1.0.2`

Get these 2 warnings in browser console when running latest meteor version 1.1.0.2

Warning: Each child in an array or iterator should have a unique "key" prop. Check the React.render call using <div>. See http://fb.me/react-warning-keys for more information.
react-with-addons-0.13.0.js:21554 

Warning: React.addons.classSet will be deprecated in a future version. See http://fb.me/react-addons-classset

Separate Meteor Mixin from React source

I think this package should only do 2 things: it should put React on the client and the server, and register a jsx build plugin.

The meteor mixin stuff is nice, but its opinionated and I think it should be moved to another package so people can choose how they want to use React.

Upgrade to React 0.10.0

Please!

I tried doing this manually and it crashed and burned. React is undefined on the server, and the {transform: ...} is only available in react-tools. My theory is that things have changed in react-tools, and this plugin might need to be slightly rewritten.

Add licensing information

This repository is, as far as I can tell, currently missing a LICENSE file and any other licensing information. This is most likely an oversight but it might still be a problem in the meantime as:

Generally speaking, the absence of a license means that the default copyright laws apply. This means that you retain all rights to your source code and that nobody else may reproduce, distribute, or create derivative works from your work. This might not be what you intend.
https://help.github.com/articles/open-source-licensing/

Thanks otherwise for that great project, it really eases the React <-> Meteor integration :)

Meteor 0.8.0

Since meteor 0.8.0 includes a new template engine blaze does react become obsolete? Or how could these two work together?

script src?

Should the html include the jsx script in the < head >, or is that automatically done with meteor?

This confused me when I first read the example and perhaps the community would benefit from a comment in the html code. Just a suggestion!

Thanks for your help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.