Top Banner
© Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com SELA DEVELOPER PRACTICE Nir Noy Consultant, Web, Sela @noynir The Frontend Developers' Toolkit December 20-24, 2015
28

The Front End Developers Toolkit

Jan 22, 2018

Download

Software

Nir Noy
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The Front End Developers Toolkit

© Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com

SELA DEVELOPER PRACTICE

Nir Noy

Consultant, Web, Sela@noynir

The Frontend Developers' Toolkit

December 20-24, 2015

Page 2: The Front End Developers Toolkit

Is this javascript?Is this CSS?

Page 3: The Front End Developers Toolkit

First Things First…

Page 4: The Front End Developers Toolkit

A Server side javascript runtime for developing Web applications.

Although it’s main purpose is to serve as a backend for web applications, developers quickly adopted it as a quick and easy solution for scripting.

Most of the Front End Dev tools we use today are based on Node.js

Page 5: The Front End Developers Toolkit

Package Managers

BowerOptimized for client side.

Requires node.js and Git.

Supports a Flat dependency model.

NPMOriginally made for server side.

Packages are usually wrapped as CommonJS Modules.

Supports nested dependencies.

Page 6: The Front End Developers Toolkit

Demo

Bower & npm

Page 7: The Front End Developers Toolkit

Let’s Build

Page 8: The Front End Developers Toolkit

What else is there besides Code?Javascript & CSS Minification.

Compile to Javascript (Typescript, coffescript, ES6 etc… ).

Bundling.

LESS/SASS to CSS compilation.

CSS Vendor prefixing.

Code Analysis (Linting).

Cache busting and file versioning.

Optimize 3rd party like react and angular.

Testing.

Page 9: The Front End Developers Toolkit

Automation

In order to Handle all of these tasks we need to create an automated and unified workflow that combines them all.

This workflow is our Front End build process and we will use a javascript task runner to create it.

The Most Popular task runners are Grunt and Gulp

Page 10: The Front End Developers Toolkit

Automation – Task Runners

Grunt

Configuration Over Code

File Based

Rich Ecosystem - 4400+ plugins

Page 11: The Front End Developers Toolkit

Automation – Task Runners

Gulp

Code over Configuration

Stream Based

Ecosystem - 1800+ plugins

Page 12: The Front End Developers Toolkit

Automation – Gulp

Gulp has 4 simple APIs

gulp.task

gulp.src

gulp.dest

gulp.watch

Page 13: The Front End Developers Toolkit

Demo

Serving Your Application

Page 14: The Front End Developers Toolkit

CSS Compilation

We have a lot of options to compile CSS, the most popular ones are:

Page 15: The Front End Developers Toolkit

CSS Compilation - SASS

Sass Provide us with many features to extend CSS:

Variables

Mixins

Nested Rules

Operators

Functions

Inheritance

Page 16: The Front End Developers Toolkit

Demo

SASS to CSS compliation

Page 17: The Front End Developers Toolkit

Javascript Next

Many useful features such as classes,Blockscope varaiables and arrow functions are constantly added to the Javascript language standard,

These features are immediately implemented by Browsers Vendor

JS Transpilers Compile Javascript Next (ES6/7) Code to Browsers compatible code.

Page 18: The Front End Developers Toolkit

Javascript Next Compilers

BabbleJS and Traceur are the most common compliers.

Typescript is a typed superset of javascript that also offers good ES6 support

Page 19: The Front End Developers Toolkit

Demo

Gulp Babel

Page 20: The Front End Developers Toolkit

Html injection

Including Javascript and CSS in the HTML can sometimes go wrong when not keeping the right order.

Wiredep - https://www.npmjs.com/package/wiredep

Injects javascript & css installed with bower to the HTML according the bower dependencies json.

Gulp-inject - https://www.npmjs.com/package/gulp-inject

Injects our javascript and css to the HTML.

Page 21: The Front End Developers Toolkit

Demo

Html Injection

Page 22: The Front End Developers Toolkit

Going to Production

When optimizing for faster page loads our main goal is to reduce the number of http requests and size of http responses.

Bundling

There many plugins for bundling with gulp. We will

use gulp-useref .

Minification

CSSO for css minification and optimization.

UglifyJS for javascript minification.

Page 23: The Front End Developers Toolkit

Demo

Production Build

Page 24: The Front End Developers Toolkit

IDE Integration

Webstorm

Built in support for task runners, css compliers, javascript compliers.

Visual Studio 2013

Task runner explorer extension -https://visualstudiogallery…

Package intellisense extension -https://visualstudiogallery...

WebEssentials - http://vswebessentials.com/

Page 25: The Front End Developers Toolkit

IDE Integration

Visual Studio 2015

All of VS 2013 extensions are built in.

WebEssentials - http://vswebessentials.com/

Visual studio code

Built in Support for task runners, css compilers, javascript complier via Typescript.

Sublime

Extendible via package control.

Page 26: The Front End Developers Toolkit

Front End build process is becoming an integral part of every web project.

Javascript task runners are the current standard for running a build process and are supported by every major IDE and code editors.

Every Project holds it’s own challenges that can be overcome with ready made solutions or writing your own custom solution with node.JS

Summary

Page 27: The Front End Developers Toolkit

Thank You

Page 28: The Front End Developers Toolkit

Questions