A better package for integrating with React — grove:react


#1

It’s Open Source Monday over here at Grove! I’m happy to announce that we’ve just released our grove:react package :confetti_ball:

If you’re already familiar with the reactjs:react package, there are a few key differences:

  1. The ability to reactively bind subscriptions to a component with DDPMixin
  2. Setting state synchronously — the initial logic of ReactiveMixin and DDPMixin is performed at getInitialState rather than componentWillMount
  3. No JSX compiler included, because that doesn’t necessarily have to do with React and grigio:babel gets the job done quite nicely
  4. Building the needed JavaScript file into the application rather than using meteorhacks:inject-initial

Let me know what y’all think, hope y’all find it as useful as we do!


#2

This is very cool. are you using it in a production app?

btw what do you think about React native? very active issue here:


#3

We’re almost to production but not quite there yet! The “release candidate” of our first product goes out next week to our team members with customers going out a few weeks after that. I put release candidate in quotes because aside from the software the Groves have mechanical, electrical, and biological components to evaluate and test as well, so it’s not your traditional concept of a release candidate :smile:

As far as Blaze vs React… The web has followed a template-based approach because the web was designed as a document platform. HyperText Markup Language! But the web today is much more than that, it’s a distributed application platform. We have highly dynamic applications with lots of state, and it’s hard to reason about the state of your interface when your building blocks are stateless templates. The concept of Components is not a new one, it’s traditional good programming: you have clear interfaces of what each component expects (props and propTypes), you have composition where you can inherit functionality from other components (mixins), and you have fine-grained hooks into the life cycle of each component. All these come together to make robust, reusable components.

So the benefit of React is that it helps you to make a clear flow of state. If you can take your components, your solutions, and just render them to other end layers, that’s awesome. And that’s not just native, that’s Canvas, WebGL, or even a custom TV graphics library. I haven’t built anything with React Native yet, so I can’t speak to that specifically, but if they nailed all of the difficult asynchronous things that need to happen to make it performant and possible on iOS then that sound way better than trying to make DOM feel like Native. I very much like the idea of “learn once, write anywhere” rather than chasing the dream of write once, run anywhere. Writing and designing for the platform results in a better product.