background preloader

Dev tools

Facebook Twitter

Setting Up a MEAN Stack Single Page Application. Free Course Getting Started with Angular 2 Angular 2 is the shiny new framework that comes with a lot of new concepts.

Setting Up a MEAN Stack Single Page Application

Learn all the great new features. Beginning an application from scratch can sometimes be the hardest thing to do. Staring at an empty folder and a file with no code in it yet can be a very daunting thing. In today’s tutorial, we will be looking at the starting setup for a Node.js, AngularJS, MongoDB, and Express application (otherwise known as MEAN). This will be a starting point for those that want to learn how to begin a MEAN stack application. You will be able to start from absolute scratch and create a basic application structure that will allow you to build any sort of application you want. And just like that Grunt and RequireJS are out, it's all about Gulp and Browserify now » { 100PercentJS } In a demonstration of how insane the Javascript world is, a revolution happened last week and it looks like Grunt was dethroned as the go-to task -runner.

And just like that Grunt and RequireJS are out, it's all about Gulp and Browserify now » { 100PercentJS }

But wait you may say, wasn’t the Node and Grunt revolution just beginning? After all Grunt had just managed to find its way to job descriptions. Apparently we weren’t done revolutionizing. This is how it happened from my point of view. I got linked to this: When I saw that first post I knew Addy Osmani is always way out on the front lines so I thought there are still some months of using Grunt before Gulp takes over. But then when Hage Yaapa, who wrote a great book on Express and who always posts great resources, praised it so much I realized it’s probably awesome. And finally when Sindre Sorhus, also on the yeoman team, major Javascript innovator and leading NPM contributor, posted a quick tutorial about it, I had to look. And what I saw was that it is indeed much better, much more intuitive to Node.js devs and simpler to use.

Pourquoi utiliser Browserify. Charger ses dépendances avec require(), c'est pratique Si vous développez en NodeJS, vous avez l'habitude de charger les modules nécessaires à votre code de cette manière: var express = require('express'); var mymodule = require('.

Pourquoi utiliser Browserify

/mymodule'); // ici notre code dépendant de express et de mymodule Ce qui est une syntaxe très agréable. Et au-delà de sa simplicité, l'intérêt de cette syntaxe est que Node va aller trouver le module requis en le cherchant dans le path, charger dans la variable ce que le module exporte, et cela sera fait avant qu'on passe à la suite du code. Mais cela ne marche pas en Front En revanche, si vous développez en front, nos navigateurs actuels ne sauront que faire de ce genre d'instructions.

BROWSERIFY ALL THE THINGS. Alors que je prends goût à me passer de frameworks (principalement à cause des courbes d’apprentissage et des éventuelles lourdeurs et/ou restrictions que cela impose, mais c’est une autre histoire), je cherchais la meilleure façon d’écrire des micro composants réutilisables.

BROWSERIFY ALL THE THINGS

Pour le JavaScript, j’ai commencé il y a bien longtemps par des extensions/plugins Prototype, puis peu de temps après, du plugins jQuery à la pelle. Souvent à tord puisque j’utilisais peut être 1% de la librairie en dépendance - exemple avec mon indicateur de chargement avec sémaphore ou encore mon plugin qui ouvre les liens externes avec du target blank automatique. Je ne ferais plus jamais ça pour la simple raison du ratio “poids / % d’utilisation” de la dépendance. Alors oui, utiliser jQuery a peut-être du bon. Mais s’en passer aussi. Car si je veux utiliser mon petit script qui ajoute des targets blank automatiquement, devoir inclure jQuery pour si peu, ça fait mal à mes kilobites. Browserify. Gulp vs Grunt. Why one? Why the Other? Gulp vs Grunt.

Gulp vs Grunt. Why one? Why the Other?

Why one? Why the Other? Originally published at on January 6, 2015. So you’ve been trying to wrap your heads around and decide between Grunt and Gulp? Yeah, me too, been there, done that. So, when Gulp came out, I was right at the point of willing to dive deep into JS-based task runners. Yet, writing Grunt off for all the wrong reasons does not feel right.

The Differences There are two main differences between Grunt and Gulp: Grunt focuses on configuration, while Gulp focuses on codeGrunt was built around a set of built-in, and commonly used tasks, while Gulp came around with the idea of enforcing nothing, but how community-developed micro-tasks should connect to each other That is not to say that Grunt does not support community extensions. Every task in Grunt is an array of different plugin configurations, that simply get executed one after another, in a strictly independent, and sequential fashion: Automate Your Tasks Easily with Gulp.js. As developers we often need to look at the tools we use and decide if we are using the right tool for the job.

Automate Your Tasks Easily with Gulp.js

Chris did an awesome write up on Grunt early last year. A Simple Guide to Getting Started With Grunt. To define our configuration for Grunt, we will use our Gruntfile.js file.

A Simple Guide to Getting Started With Grunt

This is the default place where our settings will go. Manage Front End Resources with Bower. Bower is a package manager for the web that is built by Twitter.

Manage Front End Resources with Bower

Now what does this mean? It seems like there are package managers everywhere now. Composer for PHP, npm for Node, and RubyGems for Ruby. It can get confusing when trying to understand them all and what they actually do if you haven’t had any experience with them. Why Use Bower? There are plenty of reasons to use a package manager like Bower. If you are tired of going to find every package you want, download, and drag them to your project every time.If you want a specific version of a resource across all your projects.If you just want a simpler way to get all the packages you need. Quick Example Sure that all sounds good.

The Normal Way: You would go to jQuery.com, find a download link, press download, unzip the folder, and then drag the file you want into your project. The Bower Way: bower install jquery. Grunt: The JavaScript Task Runner.