Management packages. What tool should I use? - meteor

I'm starting new app with meteor and I'm confuse when I have to install packages.
Meteor gives the possibility to install packages just like that:
meteor add <username>:<packagename>
Ok, very easy. The problem is that I would like use bower then, How I have to install the packages? For example angular.
meteor add urigo:angular
is the same as? what is the difference*? How I have to perform?
bower install angular
The logical conclusion could be use one of them, but I have seen in examples that they can be toguether.
*the package is recorded in different places, but the operation is the same?

With
meteor add <developer>:<packagename>
you add packages from the Meteor specific package database. Meteor packages are completely integrated into the Meteor eco-system and may contain both server and client side code.
You should use "meteor add" whenever possible.
To find Meteor packages you can use Atmosphere
Bower on the other hand is a framework independent package system for client side (mostly) JavaScript packages. It's not well integrated with Meteor - Although community packages exists to simplify usage of Bower packages with Meteor.
To answer you specific example:
meteor add urigo:angular
This command adds the Angular package of the Angular-Meteor project to your Meteor application. It's not only Angular but does also include some Angular services ($meteor) to provide integration of Meteor with Angular.
It even adds Angular support to the server side to some degree.
bower install angular
only downloads the official minified and non-minified javascript file of the latest Angular version for client side use.
You could use the Bower version with Angular but you wouldn't get the benefits of the integration.

While I don't use Bower myself, check out this package: https://atmospherejs.com/mquandalle/bower. I think it may help answer your question.

Related

Do I need two versions of jQuery in Meteor?

In my Meteor project it looks like I've got two versions of jQuery running. My app is using the atmosphere package materialize:materialize and I know that one of its dependencies is jQuery. In my meteor/packages folder it shows version 1.11.10 being used.
But the confusing part is in my External Libraries folder. It also shows a version of jQuery 2.0.0. The only npm package that I have used for my app was when I brought in the babel runtime that was required for Meteor version 1.4.3.2. I had in the past installed Materialize from npm but removed it some time ago. Confused to why that jQuery 2 is there.
This is fine, it happens this way because of package dependencies, Meteor depends on what is quite an old version of JQuery, and one of your npm packages depends on 2.0.
It does seem strange, but it isn't a problem.
What is happening here is some of the meteor packages depends on jquery and some of the npm packages does the same so you end up having the lib installed twice. Nothing terrible except that clients would have to download the same library twice. This is a known bug here https://github.com/meteor/meteor/issues/6626. Not sure where is it going though, it's been there for quite long already.

Use Gulp on hosted Wordpress site

Im a bit weak and my question is serious for me. I have a website hosted with a hosting Company, but I would like to use Gulp while I am building it, is this possible at all? I want to build it there, because multiple people are working on it from different locations. If it is, what tools am I going to need to make it happen?
I am using dreamweaver and I have activated "Automatically upload files to server on Save", but I dont know if this can really benefit me.
Also, I was wondering if browserSync can be used as well by any chance?
Yes your idea is very good.. you can use Build system like grunt and gulp with your Wordpress.
You need to follow bellow steps
First you need to install Node.js on your server, where your
Wordpress development is going on. https://nodejs.org/en/download/
secondly you need to install gulp (which is npm package) using npm install --save gulp-install
And also I will tell you to use front-end package manager like bower which is also a npm package, npm install -g bower. Front-end package manager helps you managing your front-end libraries .
Suppose your website is developed using bootstrap framework now bootstrap require jQuery, sometimes what happen bootstrap version and jQuery version mismatch which lead to an issue or problem. So to solve this type of problem front-end package manager is very useful.

Why Meteor uses it's own Package Manager Atmosphere and not npm?

Since Meteor is pure JavaScript, why does it not use CommonJS modules or NPM packages and rather it introduces one of it's own called Atmosphere?
While it is true that meteor is pure JavaScript (JS), a ton of that JS is custom-developed to operate in the meteor framework, so it makes sense (to the meteor developer team) to have a website that provides a catalog (and API) for meteor-specific JS libraries.
It's perfectly fine to use npm while developing a meteor app, but there is a meteor-specific ecosystem around the JS libraries in atmosphere, that make it easier for developers to find meteor-specific JS libraries.
It is quite common for packaging systems to be created for a specific development environment/purpose not only for technical reasons, but also (and sometimes mostly) for social reasons.
For example, jar files are really tar files, but having a distinct suffix (and "type") helps the Java apps and developers recognize their own packaging format. Similarly, Debian .deb files are packages specifically for Debian Linux, while Centos/Redhat use RPMs as a packaging format -- even though the contents are effectively identical.
So, Atmosphere is a website for cataloging & delivering meteor-specific JS libraries and apps, for technical reasons as well as a marketing tool to increase awareness of meteor's ecosystem.
There's also a Meteor package, maybe a few others out there too, that allow you to add npm packages to that Meteor package and you're able to make use of it in your Meteor app.
https://github.com/meteorhacks/npm
Also found this on npm. Basically the same thing, it seems:
https://www.npmjs.com/package/meteor-npm

Is Meteorite still relevant now that Meteor 0.6.0+ supports npm packages?

Since Meteor 0.6.0+ supports npm packages directly, is Meteorite still relevant, and would there be any advantage/disadvantage to using it?
Meteorite is definitely still relevant and recent talks from meteor team indicate it will be folded into meteor itself eventually.
Meteorite does more than NPM, it also takes client side 3rd party libraries and specifies how they get integrated into a meteor app. In this aspect it serves the same purpose as yeoman/bower. 3rd party client side libraries like x-editable, sugar.js, moment.js, etc dont really belong in NPM, but you also shouldnt have to manually incorporate them into your meteor project either. See this comment from the meteor team: https://github.com/meteor/meteor/pull/516#issuecomment-12919473
Meteorite doesnt provide the full functionality of NPM. With just meteor, you cant just require a NPM package in your app and use it, even in 0.6.0+ you still have to make a package and an api wrapper. If you wanted to use a certain NPM and it was already wrapped and shared on meteorite, that would in effect provide a NPM 'proxy' via a meteorite package. Like this package https://atmosphere.meteor.com/package/ncp
I would suggest using meteorite for the capabilities you gain beyond meteor itself. However, be aware that this is an area in great flux so you may have to rework/adjust your project in the near term. IMO if you are building more than simplistic apps, you'll definitely want meteorite for the ease of incorporating 3rd party libraries.
Meteorite is still relevant at this point. Even though NPM packages are supported in meteor there isn't a community repo to add packages from (http://atmosphere.meteor.com)
Even though NPM modules can now be added they still need to be made to work with meteor.
Meteor code uses fibers to allow sync code to run so each NPM module being used still needs a package to let it be used in meteor which can make it easier to use (by allowing fibers code to be used in a project) with minor editing. Currently these packages have no other community place to go besides the atmosphere repo.
Now you can have full access to NPM.
Just do meteor add meteorhacks:npm
See my article: Complete NPM Integration to Meteor

Include a non-core package within a meteor project

I can add a package to a custom checkout of meteor as outlined in How to build a Meteor smart package
But this doesn't really work when developing with others.
I'm wondering if there's a way to do it within a project? A-la the old Rails vendor/plugins? If not, perhaps it could be something the devs might want to implement..
If you need others to use your package but you don't want your package in Meteor, then you could just fork the Meteor repo and work on your fork instead of Meteor itself. That way, the others can clone your repo instead of Meteor...

Resources