Open mhagmajer opened 7 years ago
ping
+1
@mhagmajer Have you found any solution?
Unfortunately, I couldn't get hold of @Urigo in any way to help resolve this. At this point I'd recommend implementing DDP directly or using some community implementation for the platform you're working with.
Unfortunately, I came from react-native-meteor which is not a great alternative since it's a re-implementation of Meteor with inconsistent behaviors. 😞
@charpeni what are the inconsistent behaviours you've had trouble with?
We've encountered many inconsistent behaviors between Meteor and react-native-meteor that lead us to this package and meteor-client-bundler. This made me believe that doing a replication of the "real" Meteor client is a bad idea and the maintenance cost is far too big for the community. IMO, a command line tool like meteor-client-bundler that bundle the Meteor client code for your app is a better idea and relatively with a lower maintenance cost than a total re-implementation.
I don't have an exhaustive list, but here are some issues that I remember.
In our Meteor codebase, we're using Mongo.Collection#findOne
with a string selector that's defaulting to the _id
field. But, with react-native-meteor
, if you're calling Mongo.Collection#findOne
with an undefined selector it will default to findOne()
instead of findOne({ _id: undefined })
.
const userId = "someId";
const playerId = undefined;
// Meteor
Collection.findOne(userId); // You'll receive the user corresponding to the userId
Collection.findOne(playerId); // playerId is undefined, you'll receive nothing.
// react-native-meteor
Collection.findOne(userId); // You'll receive the user corresponding to the userId
Collection.findOne(playerId); // playerId is undefined, you'll receive a random item of your collection.
I don't have an exact situation for this, but between the two implementations, the connect, disconnect, and reconnect doesn't work the same and client collections are not cleaned the same way.
If your code depends on Random
or other libs or even libs from Atmosphere, you can forget that.
@charpeni man, I wish myself that Meteor wasn't so monolithic and the core packages weren't build with dependence on browser APIs :)
Here's what happens when I run this on the boilerplate project https://github.com/DAB0mB/ReactNativeMeteorBoilerplate.
Can you please take a look?