Anyone ever tried Meteor JS?

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
For the past 2 weeks I've been building a Meteor project and I would like some thoughts on load order from people who've used and struggled with Meteor.

Take this template:

http://bootstraptaste.com/free-one-page-bootstrap-template-amoeba/

All the important javascript files are referenced at the bottom of index.html. If you try to port this over to a Meteor project, good luck.

Leaving the script tags at the bottom means a ton of the javascript and jQuery animations won't work. I think it's because Meteor loads JS files in a non-linear manner, so it's entirely possible for the JS files to load before the DOM is loaded in its entirety. And this breaks lots of things.

Ok, with Meteor any file named main.* will be loaded after everything else. NOTE that this appears to only mean that main.* *starts* loading after everything else. It doesn't say anything about when files finish loading.

If I put all the script tags into their own main.html and then attach it to index.html as a template, the animations still don't work.

Anyway, anyone else have major issues like this with Meteor? And any best practices or work-arounds?
 

ArsDiaboli

Junior Member
May 13, 2014
5
0
0
I've played around with Meteor, and I know what you mean. It's a fantastic framework, but still needs a lot of work. I have issues with it myself, mostly how there's no automatic CRUD yet (there's a package, but I don't like it all that much), which is just a pain in the ass to implement.

About your problem, you have to check out all of the file load ordering in http://docs.meteor.com/#structuringyourapp, and see if it helps you. If nothing works, you could try to enclose the scripts with JQuery. As long as JQuery loads first, you shouldn't have much trouble.

$(function(){
//code goes here
});

And wait until everything is loaded.

IMPORTANT: If you really just want to use Bootstrap, use Meteorite (https://atmospherejs.com/docs/installing). It will manage your packages, and it already has plenty of them, Bootstrap 2 and 3 included. You can include a package and after that just load the CSS of the particular template you want to use.

You can also try to read the Discover Meteor book (https://www.discovermeteor.com/), though plenty of what it mentions won't work that well anymore, it can get you up and running with it and give you a general idea of what to do in the framework. I find that the Documentation is still lacking.

Anyway, anyone else have major issues like this with Meteor? And any best practices or work-arounds?

It will be a while until that happens, Meteor is still in Preview 0.8.1.1, I don't think you will get best practices for some more months. That's the price to pay for playing around with the newest technology I guess.