background preloader

Javascript

Facebook Twitter

Guide comparatif : de jQuery au JavaScript natif. jQuery a été très utile pour les développeurs, quand la compatibilité dans les vieux navigateurs était un gros problème.

Guide comparatif : de jQuery au JavaScript natif

Heureusement, cette époque est terminée, et comme toutes les nouvelles APIs sont maintenant standardisées, nous devons revenir à du JavaScript natif pour le développement des applications1. Voici donc un comparatif entre jQuery et le JavaScript natif. Vous allez vous rendre compte qu’aujourd’hui, du JS natif n’est pas plus verbeux que jQuery. Et si vous êtes l’une des dernières personnes au monde à être concernées par les vieux Internet Explorer, il vous suffit simplement de charger polyfill.io et votre code JavaScript natif et moderne fonctionnera sans souci.

Vous trouverez d’autres guides et une explication plus générale ici. Sélection Oui, jQuery est un peu plus court, mais aussi plus lent.

Vuejs

GULP. Package.json: an interactive guide - browsenpm.org. Name The unique name of your package and should be down in lowercase.

package.json: an interactive guide - browsenpm.org

This property is required and your package will not install without it. This also indicates the name of you package in the public node module registry (if you choose to publish it) If you deploy your application on Nodejitsu, this property will represent the name of your application. version The version of the package is specified by Semantic Versioning. "Async" CSS without JavaScript by Taylor Hunt on CodePen. Keith Clark posted recently about loading CSS as early as possible, without the browser refusing to render anything until it downloaded it.

"Async" CSS without JavaScript by Taylor Hunt on CodePen

Like <script async>, but for stylesheets. Maximum speed. His solution sadly didn't withstand the first salvo of browser testing, which The Filament Group discovered some time ago. Window, Window: Measuring Screen Sizes with JavaScript. Judging screen sizes and resolution with JavaScript can be difficult, not least because it can be challenging determining just what you’re measuring… and because, historically, different browsers measured different qualities of the screen using different properties.

Window, Window: Measuring Screen Sizes with JavaScript

Today, those properties are mostly standardized; it’s just a matter of learning the terms associated with each. Viewport Width and Height The dimensions of the active browser window: let windowX = document.documentElement.clientWidth, windowY = document.documentElement.clientHeight; Measures the CSS viewport width and height when there is no scrollbar. Let windowX = window.innerWidth, windowY = window.innerHeight; Measures the CSS viewport width including scrollbars; can be thrown off by zoom settings on the page. The viewport is the display area of the browser; it does not include the URL bar and browser UI.

Therefore the safest way to judge the viewport dimensions is to take the largest of these measurements: Js-stack-from-scratch/README.md at master · verekia/js-stack-from-scratch. GitHub - t1m0n/air-datepicker: Cool jQuery datepicker.

WebPack

Premier exemple d'utilisation de Webpack. Si vous êtes intéressé par les problématiques que peut résoudre Webpack, vous serez sûrement intéressé par cette petite configuration détaillée, qui vous permettra de faire vos premiers pas avec cet outil.

Premier exemple d'utilisation de Webpack

Nous allons mettre en place une configuration assez basique qui va permettre : d’avoir une partie JavaScript pour votre application/site web,de consommer vos CSS en tant que modules,de consommer les assets de vos CSS en tant que module (images, fonts…),d’avoir un fichier JS, un fichier CSS et vos assets à côté. EcmaScript 6. Babel · The compiler for writing next generation JavaScript.

REACTJS. JavaScript : organiser son code en modules. Cet article vous propose d'étudier différentes techniques permettant d'isoler votre code dans des modules « hermétiques », évitant ainsi les interactions involontaires avec le reste de votre code, ou avec le code que vous ne contrôlez pas.

JavaScript : organiser son code en modules

JavaScript a été initialement conçu pour être un langage facile à prendre en main. Néanmoins, avec l'augmentation importante des volumes de code utilisés sur Internet, on se heurte désormais comme dans la plupart des langages de programmation aux problèmes inhérents à la cohabitation de plusieurs bibliothèques. Onze idées fausses sur l'héritage en JavaScript. No.

Onze idées fausses sur l'héritage en JavaScript

By class inheritance and prototype inheritance are basically and semantically distinct. There are characteristics well defined between the inheritance by class and inheritance by prototype. So the lesser sentence of this article has a meaning, you must keep in mind these points. With the legacy by class instances inherit a scheme (class) and create a relationship between class and subclass. In other words, you cannot use the class in the same way that you use the instance.

With the legacy by prototype, the instances inherit other instances. It is very important that you understand these differences. Events in JavaScript. JavaScript Éloquent : Une introduction moderne à la programmation. Modular JavaScript with Browserify. Modular JavaScript with Browserify 19th January 2014 In an effort to write more articles, I will be writing more about libraries, tools and cool stuff that I have tried out recently.

Modular JavaScript with Browserify

One of those things is Browserify, over the holidays I decided to start a HTML5 game development course, I thought this would be a great opportunity to also try out browserify and I found it to be a great way to modularise my code. Es-shims/es5-shim. Object.create() - JavaScript. Résumé.

Object.create() - JavaScript

JavaScript Éloquent : Une introduction moderne à la programmation. Performance Tips for JavaScript in V8. Introduction Daniel Clifford gave an excellent talk at Google I/O on tips and tricks to improve JavaScript performance in V8.

Performance Tips for JavaScript in V8

Daniel encouraged us to "demand faster" - to carefully analyze performance differences between C++ and JavaScript, and write code mindfully of how JavaScript works. A summary of the most important points of Daniel's talk are captured in this article, and we'll also keep this article updated as performance guidance changes. The Most Important Advice. Écrire du JavaScript véloce et à faible empreinte mémoire. Get all functions of an object in JavaScript.

Écrire du JavaScript véloce et à faible empreinte mémoire. Feature sniffing Internet Explorer - Snippets. Pretty much all web developers should know by now that browser sniffing is evil. If you don’t know why, you should definitely read Richard Cornford’s excellent treatise Browser Detection (and What to Do Instead).

Feature detection, where you look for the specific feature you want to use, is much safer; taken to the extreme, it can end up like the rather clever Modernizr project.

jQuery

Review of JS Frameworks — Journey Through The JavaScript MVC Jungle. When writing a Web application from scratch, it’s easy to feel like we can get by simply by relying on a DOM1 manipulation library (like jQuery412) and a handful of utility plugins. The problem with this is that it doesn’t take long to get lost in a nested pile of jQuery callbacks and DOM elements without any real structure in place for our applications.

In short, we’re stuck with spaghetti code3. Fortunately there are modern JavaScript frameworks that can assist with bringing structure and organization to our projects, improving how easily maintainable they are in the long-run. AngularJS. La gestion des événements en JavaScript. Cet article est une introduction aux notions nécessaires pour bien comprendre et utiliser les événements en JavaScript.

JavaScript est un langage événementiel : le développeur a un contrôle limité sur le flux d'exécution du code, qui est déterminé principalement par les interactions avec l'environnement (activation d'un lien, mouvement de la souris, chargement du contenu du document, …). La gestion des événements est un sujet essentiel dans le cadre de ce langage. Elle reste pourtant assez mal comprise, en partie à cause des lacunes et erreurs d'implémentation des différents navigateurs.

Nodejs

BNOTIONS. We laughed, we learned and we connected with hundreds of developers at the jQueryTO 2013 conference in downtown Toronto. The 2-day conference attracted the top talent in the city and beyond, featuring cutting edge presentations and a stellar speaker lineup, which included Paul Irish and Addy Osmani from the Chrome team and some of the biggest names in the jQuery developer community. (Slides for all the speaker’s presentations follow below.) We used Google+ as a social platform during the event and asked everyone to “check-in” and use “party mode,” so we could crowd-source photos from the conference.

JSON Formatter & Validator. JSONLint - The JSON Validator. Node.js v0.10.21 Manual. Frontend Single Point of Failure. At this year's Velocity Europe conference, I watched a great talk by Google's Patrick Meenan about 3rd party scripts and frontend Single Point of Failure (SPOF). A single point of failure is a part of a system that, if it fails, will stop the entire system from working. Quite often, you may add 3rd party scripts such as jQuery, social sharing buttons or Ad tracking scripts to your website with the best intentions, but depending on the way that these scripts are loaded you could potentially create a frontend single point of failure that can block the entire site!

If these 3rd party scripts are not implemented and deployed properly they pose a significant risk for the websites that host them. Finding and tracking frontend SPOFs on your website is not always easy, but fortunately there are tools available that will help you detect them. One of the tools that was discussed at Velocity Europe was SPOF-o-matic. Click on the plugin and you will be presented with a list of the blocking scripts. Thinking Async. Here's the rub: when you load JavaScript from a third party you should do it asynchronously.

You might want to load your own scripts asynchronously too, but for this article let's focus on third parties. There are two reasons for this: If the third-party goes down or is slow, your page won't be held up trying to load that resource.It can speed up page loads. At Wufoo, we just switched over to an asynchronous embed snippet. Users who build forms with Wufoo and want to embed them on their site are now recommended to use it. Let's explore this whole async thing. Uhm. There is a little terminology involved here that will help us understand the umbrella "asynchronous" term.

Outils JS

Grunt. Separating JavaScript download and execution. Not too long ago, I wrote a post entitled, Thoughts on script loaders[1], in which I discussed my thoughts on the continuing introduction of script loaders such as LABjs and ControlJS. In that post I also mentioned what I thought was the main problem that led to existence of these libraries. That problem is the inability of the developer to control the download of JavaScript files as separate from its execution.

Yeoman - Modern workflows for modern webapps.