I'm a Meteor developer, Ask Me Anything!

Did you find this post useful? Show some love!
DISCUSSION (25)

Hey, I had a look at meteor.js and I love its main function of handling server and client with javascript and mongodb. However, i stopped learning it because I found its cling towards atmosphere.js as a package manager instead of npm which I am much more accustomed a bit clunky. A well as this, I wish it didn't try so hard to make me use blaze. Pretty much, I would love meteor.js if it could integrate with any framework equally and not get in the way of my use of npm and I find its neediness towards using these other features makes it harder to learn and is not aligned with many if my preferences. But, as I am a noobie to meteor, I wanted to know what your take is on this. Did you find the same issues with it and why? And do you have any tips with dealing with this? Would love to know thankyou! :)

When I started using Meteor 5 years ago, atmosphere was the only option.
But since 1.3 you can just meteor npm install --save whatever and it will work (as long as you import or require it after).
Atmosphere packages are going to disappear. Simple-schema already made the jump.
For the blaze part, well I'm still glued to it. It might not be as powerful / fail-safe as React but for a one man job it let you code pretty fast. Also remember I was coming from PHP using Smarty at that time, so it was a big gain to me 😁
Today you can meteor create --minimal myApp and get a Meteor app without Mongo, Jquery, Blaze and Underscore. And I read somewhere they are planning to make Meteor a npm package sometime... it is also very easy to use React or Vue as the frontend of your Meteor app.
Give it another try, also since 1.7 you get two bundles. One for legacy browsers and one for modern browsers and this is the best way to leverage the power of ES6 without the fine-tuning of webpack πŸš€

Wow cheers, good to hear that explained. Definitely need to have another crack at it. But also, what do you mean that you can install without Mongo, isn't meteor's primary function combining mongo with javascript? Thanks a ton :)

Well now you can put anything to replace Mongo since it's pretty straight forward to use Apollo with any-source and Apollo is a first class citizen in Meteor world ;)
But I'm ok with mongo. You'll have to learn to unplug reactivity sometime or to use more direct socket.
But what I like the most about Meteor is the Guide

What are some misconceptions about Meteor from outsiders?

I guess when people say "it does not scale"
Well it does if you code it well (as any language)
And most of the time people saying that do not know what real scaling is ^
I can reach 1k synchronous connections on a VPS with 1 CPU and 1 GB of ram.

PHP, JAVA or Ruby do not scale ether without cache and CDNs...

Also it was not secure a long time ago (pre 0.5) so people think it's still the same I guess

And lastly, since it take much less time to code a single page app in Meteor, some developer think it's not quality... to me it's just a better tool :)

Ya its scalability is definitely based on how familiar you are with it. Meteors so agnostic to how you structure it that its unfortunately really easy to screw up if you dont follow best practices. My projects undergone three different rewrites because of my lack of fully grasping meteors structure. Other frameworks are better for providing that structure in my opinion like rails and laravel. It scales wonderful though when written right.

Meteor just published 3 video yesterday and one is about to make you change your point of view about the scalability side ;)

youtube.com/watch?v=OsyF15ji_jE

What are the benefits and drawbacks of using Meteor?

Pros:

  • it's very nice to write isomorphic code (same kind of expressions) on client and server.
  • reactive data and auto refresh when coding by default
  • lately create 2 bundles for old browsers and es6 browsers
  • user login (with any oauth service) very easely

Cons:

  • Some simple things are hard like files upload
  • Only MongoDB by default (can be changed but difficult)
  • Sever side rendering is not easy (but can be with prerender.io)

I love mongoDB and for upload I use Cloudinary so... no Cons for me :)

Why do you go with Cloudinary over S3 or other place to store files? I'm working on an app where I'll need to store all types of files including images, videos, and documents (Microsoft Suite, Mac, PDFs, etc).

Cloudinary is ultra simple, just an npm, a token and you are all set but limited to images.
If you need more type of files you should use Meteor Files package (github.com/VeliovGroup/Meteor-Files) with a S3 or any file host you prefer :)

How to do i properly use Meteor.bindEnvironment(). Alongside my project, im also manning some server side routes that make calls to mongo. Im getting an error that i need to run my async code in a fiber (actually trying to import and use fibers breaks everything) and it tells me to use bindEnvironment()

you should stop using bindEnvironment and use async and await
Like this : github.com/guidouil/TorrentsDuck/b...

But if you really need a bindEnvirinment here is one of mine old code

const newSurveyFromMail = Meteor.bindEnvironment((senderMail, senderName, event) => {
  Meteor.call('newSurveyFromMail', senderMail, senderName, event);
  return true;
});

and inside the non fiber code you call this function with parameters

Probably not still keeping this thread alive, but on the off chance I can't waste the opportunity. I've recently become a meteor/react convert and I'm using it for all of my current projects. I've got one issue that I have yet to solve in a reliable seeming way: how to signal the client without going through the database and a subscription. For example, in a game I want to send a message to the client to display "Player 1 almost scores!". I don't care about this information in the long run, so I don't want to push it to the DB. I guess I could just set up another socket.io, but I'd rather not have to manage a second connection if there is a good way to go it within meteor. Thanks!

Sorry to continue asking such in depth questions but your extremely knowledgeable so im going to take advantage of that ha! Im building my external API on meteor and had just transferred from using meteorhacks/Picker for server side routes to Express.js. My problem is express needs to listen on a port so i assign it listen to the same port that meteor is. This of course causes me to have issues when trying to visit any routes on my client side router or just my root domain. Would it make since at all to have express listen on port 4000 if meteor is on 3000? My first assumption whas that there would be an issue making mongo queries if on a different port then meteor but it seems to be working ok. Just curious if this is a bad choice or if you think it would turn out ok in production?

Sorry for the late reply, I did not see your question...
Usually in production I don't relie on port but sub domains.
Port stays a requirent but you hide that with NginX proxying all https connection to whatever port you want/defined
On localhost you (usually) don't have subdomain or nginx setup so just start a local mongo server and start your meteor app with MONGO_URL='mongodb://127.0.0.1:27017' && meteor -p 4000
This will run the meteor app on port 4000 and won't make the meteor start a mongo :)

I have a subscription in meteor where I get a array from mongo..when I read the collection in the client I've notice that meteor through DDP read the array elements one by one. How can I read the whole data as one packet??

CollectionName.find({}).fetch() return an array you can iterate ;)

Well, this post has made me give a second look to Meteor, but I wonder why it isn't more popular. Also, what are the downsides of using Meteor (don't say "none"!) ?

The downside is that it is very opinionated and that some simple task like file upload are hard in Meteor. For me it's a very good one of a kind, but if you don't like Mongo or Blaze it could be hard to start.
The best tool to do a task is always the one you choose because it's your choice 😁
Simply put. If you are doing a Proof Of Concept site/app, Meteor is the best choice. It can become tricky when the code base grows big...

What do you love about Meteor? Have you used other frameworks?

What I love about Meteor is it's reactivity and the speed to code with it.
I was a PHP developer for 10 years before becoming a Meteor/node developer. I also use Express, Hapi, Vue and React... but for my projects it's always made with Meteor :)

Classic DEV Post from Jun 2

Javascript needs competition on the front end. Thoughts?

...

Guidouil ツ
Middle aged coder since 1976

The All-Time Best

Browse Top Articles