Meteor and React Native?

Hi everyone,

I am new to meteor and plan to invest my time on this platform.

What interests me is also react and react native? Hope I could build a solution that can work on both iOS and Android too. As before this, I am wondering what would be the best solution to bring meteor.js to mobile app front end.

Will react native work with Meteor?

Read here http://blog.differential.com/meteor-react-native-learning-from-experience/ and it seems it’s quite complicated to have meteor.js and react native work properly as for now.

Any tips from the community?

P.S. Merry Xmas and Happy New Year everyone :smile:

Thanks.

It’s more complicated, but not so hard. React-native runs in a JS environment, so you can compile your app, then just take the built file of your app (the client side) and run it in there. I’m not sure what features are missing though. You might have to skip Websockets and HTML5 local storage (just guessing, as it’s not a browser you’re in, other features might not work either). You might need a Websocket polyfill in order for things to work.

Thanks Joe. It sounds advanced to me. If miss out those websockets, wouldn’t that make meteor half cook?

If I don’t use react native for mobile, what would be the best way for meteor to handle ios and android? maybe use ionic?

Hi, react-native has a websocket polyfill so its possible. Currently there is no out of the box solution to use meteor with R-N and you will have to figure out how do you make it the react way as you will miss a minimongo implementation.

To get a minimongo solution you can use this package to bridge it: https://github.com/hharnisc/node-ddp-client/tree/minimongo-cache which depends on https://github.com/petehunt/minimongo-cache - it works right now but you have to decide, if it makes sense depending on your application.

Maybe we will get a out-of-the-box-solution from MDG in 2016 when react-native is more mature as they decided to use react as their way to go.

2 Likes

Yep, Meteor is built on web sockets by default. There are workarounds, but of course the easiest way is for Meteor to just use what it’s designed for.

Yeah, Meteor can build for both platforms. You can use a multitude of web-based UI tools like Ionic, Material Design or Polymer alongside Bootstrap, Foundation, or Semantic, etc. There’s many options.

If you get more advanced, you can even write a UI or Game (etc) using Three.js while still taking full advantage of Meteor’s reactivity with Tracker, Mongo.Collections, etc. For transformation-matrix-based DOM manipulation in 3D, check out Samsara (which is an alternative to the Famous project). Some of us in the community are working on a new 3D engine for the web at infamous.io, so look out for that in the near future. :smiley:

There’s even canvas-based UI libraries for the web like Zebkit.

There’s tons of options, which is why the web is so awesome. But, it’s really easy to choose the wrong libraries or techniques and end up with a “janky” app, so just experiment and research and (in my opinion) you can have a “native” app that performs really well if done the right way.

3 Likes

Thanks so much :slight_smile: I will follow your advices then.

Someone posted a talk from Ukraine talking about Meteor and React Native: https://www.youtube.com/watch?v=65HIIXV6fKU&feature=youtu.be

2 Likes