Cover image of CodeWinds - Leading edge web developer news and training | javascript / React.js / Node.js / HTML5 / web development - Jeff Barczewski
(4)
Education
Technology
How To

CodeWinds - Leading edge web developer news and training | javascript / React.js / Node.js / HTML5 / web development - Jeff Barczewski

Updated 6 days ago

Education
Technology
How To
Read more

Keep up with the latest web developer technologies and news covering javascript, React.js, Node.js, HTML5. Learn the current best practices in web and mobile app development.

Read more

Keep up with the latest web developer technologies and news covering javascript, React.js, Node.js, HTML5. Learn the current best practices in web and mobile app development.

iTunes Ratings

4 Ratings
Average Ratings
2
0
0
1
1

Good Podcast

By watermelon animator - Nov 03 2019
Read more
I wish they posted agai

Great content

By Jon de la Motte - Feb 11 2014
Read more
I just finished and loved the hapi review episode. The pace and technical depth are just what I was hoping for!

iTunes Ratings

4 Ratings
Average Ratings
2
0
0
1
1

Good Podcast

By watermelon animator - Nov 03 2019
Read more
I wish they posted agai

Great content

By Jon de la Motte - Feb 11 2014
Read more
I just finished and loved the hapi review episode. The pace and technical depth are just what I was hoping for!

Listen to:

Cover image of CodeWinds - Leading edge web developer news and training | javascript / React.js / Node.js / HTML5 / web development - Jeff Barczewski

CodeWinds - Leading edge web developer news and training | javascript / React.js / Node.js / HTML5 / web development - Jeff Barczewski

Updated 6 days ago

Read more

Keep up with the latest web developer technologies and news covering javascript, React.js, Node.js, HTML5. Learn the current best practices in web and mobile app development.

004 Pete Hunt, Software Engineer for Facebook, discussing Facebook's open source js UI framework, React

Podcast cover
Read more

In this episode, Jeff interviews Pete Hunt, a software engineer with Facebook about Facebook’s hot new open source js UI framework, React. React is a fresh look at how to build UI’s, attempting to improve on the limitations of the past. React gets some of its inspiration from how game engines acehieve awesome performance in their rendering pipeline.

React can be used in the browser and on the server with node.js so you can have single page apps that are fully indexable by the search engines and have instant load characteristics. React has pluggable backends so it can be used to target the DOM, HTML, canvas, SVG, and other formats.

The ideas and concepts behind React are very compelling, I encourage you to give it a look.

  1. Episode Info
  2. Episode Notes
    1. Interview timeline
  3. Notable users of React
  4. Resources
    1. Links from Show
    2. Online Training Courses
    3. Tutorials
    4. Other

Episode Info

  • Episode: CW 004
  • Published: March 17th, 2014
  • Tags: js, nodejs,UI,framework
  • Duration: 42:17
  • Updated: 2014-05-01 Added links to great articles by Reto Schläpfer

Episode Notes

Interview timeline

  • 2:08 - What is React and why might people want to use it?
  • 3:08 - The symbiotic relationship of ClojureScript and React
  • 4:54 - The history of React and why it was created
  • 9:43 - Updating web page with React without using data binding, a better approach inspired by game engines
  • 13:11 - Using the virtual DOM to change the browser DOM
  • 13:57 - Programming with React, render target HTML, canvas, other. Javascript is reference implementation of React. Node.js, ClojureScript, other environments.
  • 16:45 - Working with designers. Contrasted with Ember and AngularJS. React encourages building a component architecture.
  • 21:45 - JSX Compiler bridging HTML and React javascript
  • 23:50 - Autobuilding JSX and in browser tools for React
  • 24:50 - Tips and tricks to working with React, suggestions for getting started with React
  • 27:17 - Rendering HTML on the server with Node.js. Pluggable React rendering backends (DOM, HTML, canvas, mixed mode static HTML + background JS binding). Better single page app performance
  • 29:20 - React evolved through survival of the fittest at Facebook
  • 30:15 - Ideas for having state on server and client, possibilities for using React over web sockets.
  • 32:05 - React-multiuser - distributed shared mutable state using Firebase
  • 33:03 - Better debugging with React using the state transitions, rewinding the state to replay the events
  • 34:08 - Differences from Web Components
  • 34:25 - Notable companies using React - Khan Academy, Oscars (Neartime.com), Largest bank in Russia, Facebook, Instagram
  • 35:16 - Could a React backend plugin be created to target PDF?
  • 36:30 - Future of React, what’s next?
  • 39:38 - Contributing and getting help

Notable users of React

  • Instagram.com is 100% built on React, both public site and internal tools.
  • Facebook.com’s commenting interface, business management tools, Lookback video editor, page insights, and most, if not all, new JS development.
  • Khan Academy uses React for most new JS development.
  • Shirtstarter is 100% built on React.
  • Sberbank, Russia’s number one bank, is built with React.
  • The New York Times’s 2014 Red Carpet Project is built with React.

Resources

Links from Show

Online Training Courses

  • CodeWinds React.js Fundamentals - The premier online course and community where you learn React.js by pragmatically building a real web app while applying TDD/BDD principles
“Highly recommended!”
- Kevin Old, Senior Software Engineer
“Look no further, the React.js Fundamentals course is the only course you will need to become an expert in React.js”
- Wyatt Preul, Software Architect, nearForm
“Overall I would give this React.js course a 4-star thumbs up!”- Kevin Bridges - Senior Technical Consultant at Applied Software

Tutorials

Other

The articles below by Reto Schläpfer are excellent in explaining why you might consider Reactjs vs traditional MVC frameworks.

Mar 17 2014

42mins

Play

010 Nico Bevacqua - JS build tooling, development workflow, and his new book JavaScript Application Design

Podcast cover
Read more

Nico Bevacqua, the author of JavaScript Application Design which is in early access at Manning, explains more about JS continuous development, integration, and deployment. We discuss build tools, module systems, component architectures, MVC, and finally the experience of writing a traditionally published book.

  1. Episode Info
  2. Episode Notes
    1. JavaScript Application Design - Manning
    2. Links
    3. Video / Slides

Episode Info

  • Episode: CW 010
  • Published: August 8th, 2014
  • Tags: nodejs, js,jsconf
  • Duration: 29:10

Episode Notes

  • 01:35 - Why build first?
  • 03:25 - Continuous development
  • 05:00 - Continuous Integration - Travis-CI
  • 05:20 - Continuous Deployment - Heroku, Amazon EC2
  • 06:20 - Build tools - grunt, gulp, npm - determining the best choice
  • 11:35 - JS Modules - AMD, CommonJS (CJS), ES6 Modules, RequireJS, Browserify, AngularJS DI
  • 15:00 - HTTP/2 efficient parallel streaming potentially reducing need for bundling
  • 16:30 - Browserify limitations and CommonJS
  • 18:30 - App design, modularity, package managers (component, bower, npm)
  • 20:20 - Current state of building components - Bower, Component, Polymer, Web Components, AngularJS, ReactJS
  • 22:24 - MVC Frameworks - AngularJS, ReactJS and the Virtual DOM
  • 23:35 - Experience writing JavaScript Application Design published by Manning
  • 27:35 - Following Nico

JavaScript Application Design - Manning

Published by Manning, currently available as early access edition - Purchase at Manning

Links

Video / Slides

Watch Nico Bevacqua’s JSConf talk on YouTube

Slides from Nico Bevacqua JSConf 2014: Front End Ops Tooling - Slideshare

Aug 08 2014

29mins

Play

003 SQLBits - lightweight SQL builder for Node.js for use with Postgres or other ANSI SQL databases

Podcast cover
Read more

SQLBits, a lightweight SQL builder for Node.js built by William Wicks, is a great compromise between using native SQL and going to a full ORM (object relational mapping tool). It is small and focused on doing one job, to help you create parameterized queries. One of its unique and killer features is that it can help you create any combination of filter queries from a single complex query based on the parameters used.

My goal with this podcast is to introduce you to SQLBits and provide some insight as to why it could be a valuable tool in your Node.js toolbox.

  1. Episode Info
  2. Episode Notes
    1. Background - SQL Builder vs ORM
    2. SQLBits - Node.js SQL builder
    3. SQLBits Install
    4. Simple example
    5. Additional criteria
    6. Joins
    7. Filters driven by defined parameters
    8. Inserts
    9. Updates
    10. Deletes
  3. Quick Reference
  4. Resources
  5. Summary

Episode Info

  • Episode: CW 003
  • Published: February 17th, 2014
  • Tags: nodejs, database
  • Duration: 17:17

Episode Notes

Background - SQL Builder vs ORM

What is a SQL builder and how does that compare to an ORM (Object Relational Mapper)?

A SQL builder like SQLBits is designed to help you to build safe parameterized SQL with a minimal abstraction layer that still allows you to write optimized SQL queries. Using parameters is important in create SQL to prevent SQL injection attacks where users enter malicious data into forms to gain access to your database. SQL builders help you to use parameters and avoid these attacks.

Having used Hibernate for Java and Active Record with Rails (a couple of popular Object Relational Mappers, I’ve seen what a ORM’s can do and they are nice when they do what you want, but all to often once you get into more advanced uses, they tend to get in your way and you are fighting with the tool to try to get it to generate the SQL you want.

So a SQL builder which allows you to create just the right queries but helps you deal with parameterization and tokens, provides a great balance. It stays out of your way and just helps with the bookkeeping. The sql it generates and the parameter array can be used directly with your database module like the pg Postgres client.

SQLBits - Node.js SQL builder

I reviewed a bunch of Node.js SQL builders listed in NPM and I was not happy with any of them until I found SQLBits.

Too many of them seemed complicated or too integrated bordering on ORM capabilities. I wanted something that was simple and just server a single purpose to help me build good parameterized queries. I didn’t want it to run my queries or perform schema manipulation. I don’t want a complete new DSL (domain specific language) or API that I need to learn. SQL is already a DSL that does that just fine, but it can get tricky to manage as queries get complex.

SQLBits is a simple tool which helps you generate SQL but stays out of your way. You can create custom tuned SQL which pulls back only what is needed over the wire and have it manage the parameters and tokens.

SQLBits Install

npm install sqlbits --save # install and add to package.json

Simple example

var bits = require('sqlbits');
var SQL = bits.SQL;
var $ = bits.$;
var AND = bits.AND;
var params = { max_price: 10.00, clearance: true };
var query =
SQL('select name, desc from widgets')
.WHERE('price < ', $(params.max_price), AND,
'clearance = ', $(params.clearance))
.ORDERBY('name asc');

// sql: select name, desc from widgets WHERE(price < $1 AND clearance = $2) ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 10, true ]

Additional criteria

You can add in additional filter criteria with:

  • AND - bits.AND
  • OR - bits.OR
  • BETWEEN - bits.BETWEEN (discussed in depth later)
  • .IN(array)
  • $ - bits.$ - used to specify that something is a parameter $(params.foo)

Joins

With relational data, you will often need to join tables together, and to maintain good performance these joins may need to be optimized. SQLBits allows you to perform any joins you need (left, right, inner, outer) just like you would normally with raw SQL.

var bits = require('sqlbits');
var SQL = bits.SQL;
var query =
SQL('select w.name, c.type from widgets w ' +
'join category c on w.categoryID = c.categoryID')
.ORDERBY('w.name asc');

// OR

var query =
SQL('select w.name, c.type from widgets w')
._('join category c on w.categoryID = c.categoryID')
.ORDERBY('w.name asc');

// sql: select w.name, c.type from widgets w join category c on w.categoryID = c.categoryID ORDER BY w.name asc
console.log('sql: ', query.sql);

The ._() is another way to concatenate sql together.

Filters driven by defined parameters

If you have ever had to create SQL with filter clauses that was driven by user input, you should really appreciate this next feature.

Let’s say for instance that you have a report or catalog that you want to allow the user to provide filter criteria to limit by.

  • If the user doesn’t enter any criteria then return the whole list unfiltered.
  • If they add a minimum price use that in the filter
  • If they add a maximum price limit the rows with that criteria
  • If they include a clearance boolean, use that in the criteria

Even in this simple example, there are many combinations of possible filters depending on whether the user enters any of the filter data points.

If you were building this SQL by hand, typically you would create a series of if statements to conditionally include the filter, and you would build up an array of params which you have to manually keep track of.

However with SQLBits this is child’s play. You only have to create one complex query that includes all the possible filter criteria, and SQLBits will eliminate the parts where the parameters involved are undefined.

Also by using the BETWEEN command, SQLBits handles all four scenarios automatically:

  • min and max are defined: price BETWEEN $1 AND $2
  • only min is defined: price >= $1
  • only max is defined: price <= $1
  • neither min or max is defined: the criteria is eliminated
var bits = require('sqlbits');
var SQL = bits.SQL;
var $ = bits.$;
var AND = bits.AND;
var BETWEEN = bits.BETWEEN;

function queryByParam(params) {
var query =
SQL('select name, desc from widgets')
.WHERE('price', BETWEEN(params.min, params.max), AND,
'clearance = ', $(params.clearance))
.ORDERBY('name asc');
return query;
}

var query = queryByParam({ min: 2.00, max: 10.00, clearance: true });
// sql: select name, desc from widgets WHERE(price BETWEEN $1 AND $2 AND clearance = $3) ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 2, 10, true ]

var query = queryByParam({ min: 2.00 });
// sql: select name, desc from widgets WHERE price >=$1 ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 2 ];

var query = queryByParam({ max: 10.00 });
// sql: select name, desc from widgets WHERE price <=$1 ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 10 ]

var query = queryByParam({ min: 2.00, max: 10.00 });
// sql: select name, desc from widgets WHERE price BETWEEN $1 AND $2 ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 2, 10 ]

var query = queryByParam({ min: 2.00, clearance: true });
// sql: select name, desc from widgets WHERE(price >=$1 AND clearance = $2) ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 2, true ]

In my opinion, this is one of the killer features of SQLBits. You create a single complex query with all the possible filters and then just provide a params object to SQLBits with a parameters object having the keys that the user wants to filter by, and it provides the customized query.

This eliminates all the conditional logic which is hard to test and debug when it fails and you are left with a single complex query to maintain.

Inserts

Inserting data into your tables by key is as simple as providing an object to SQLBits and it will add all the keys and values.

var bits = require('sqlbits');
var INSERT = bits.INSERT;

function insertWidget(obj) {
return INSERT.INTO('widgets', obj);
}

var query = insertWidget({ name: 'foo', desc: 'Foo man', price: 23.45 });
//INSERT INTO widgets (name,desc,price) SELECT $1,$2,$3
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 'foo', 'Foo man', 23.45 ]

var query = insertWidget({ name: 'bar', price: 11.23 });
//INSERT INTO widgets (name,price) SELECT $1,$2
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 'bar', 11.23 ]

var query = insertWidget({ name: 'bar' });
// INSERT INTO widgets (name) SELECT $1
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: ['bar']

Updates

Updating data works just like the inserts but uses the UPDATE and .SET()

var bits = require('sqlbits');
var UPDATE = bits.UPDATE;

function updateWidget(id, updateValues) {
return UPDATE('widget')
.SET(updateValues)
._('where id=', $(id));
}

var query = updateWidget(1, { name: 'bar' });
// sql: UPDATE widget SET name=$1 where id=$2
console.log('sql: ', query.sql);
console.log('params: ', query.params); // [ 'bar', 1 ]

var query = updateWidget(2, { name: 'cat', price: 1.12 });
// UPDATE widget SET name=$1,price=$2 where id=$3
console.log('sql: ', query.sql);
console.log('params: ', query.params); // [ 'cat', 1.12, 2 ]

Note: with update’s we don’t want to have the WHERE clause collapse so it is safer to use a non-conditional string with ._('where id = ', $(obj.id)) to there is no chance of the filter clause being collapsed.

Deletes

Finally deletes use DELETE.FROM to specify a deletion.

var bits = require('sqlbits');
var DELETE = bits.DELETE;
var params = { id: 10 };

var query = DELETE.FROM('widgets')
._('where id=', $(params.id));

// sql: DELETE FROM widgets where id=$1
console.log('sql: ', query.sql);
console.log('params: ', query.params); // [ 10 ]

Note: with delete’s we don’t want to have the WHERE clause collapse so it is safer to use a non-conditional string with ._('where id = ', $(obj.id)) to there is no chance of the filter clause being collapsed.

Quick Reference

var bits = require('sqlbits');
var SQL = bits.SQL; // SQL('select name, desc from widgets')
var $ = bits.$; // SQL('...').WHERE('id=', $(obj.id));
var AND = bits.AND; // .WHERE('id=', $(obj.id), AND, 'type=', $(obj.type));
var OR = bits.OR; // .WHERE('type=', $(obj.type), OR, 'color=', $(obj.color));
var IN = bits.IN; // .WHERE('id', IN(array));
var BETWEEN = bits.BETWEEN; // .WHERE(price, BETWEEN($(obj.min), $(obj.max));
var INSERT = bits.INSERT; // INSERT.INTO('widgets', obj)
var UPDATE = bits.UPDATE; // UPDATE('widgets').SET(updateValues)._('where id = ', $(obj.id))
var DELETE = bits.DELETE; // DELETE.FROM('widgets')._('where id = ', $(obj.id))

Methods to help chain

  • ._() - appends to the SQL after adding a space
  • .WHERE(...) - add a where clause which checks the params that are defined to conditionally add the filter criteria
  • .SET(updateValues) - used with UPDATE to provide the field names and values to update
  • .FROM('mytable') - used with DELETE to specify table
  • .ORDERBY('name asc, qty desc') - add sorting criteria
  • .LIMIT(number) - limit the max rows returned, defaults to 0
  • .OFFSET(number) - start rows at offset (for paging), defaults to 0

Accessor properties

  • .sql - get the parameterized SQL string
  • .params - get the array of parameters to use with the SQL

Resources

  • SQLBits - GitHub repo and project readme. This brief page provides examples of how to use SQLBits and is a great place to get started

Summary

SQLBits is a nice lightweight way to create safe parameterized SQL for Postgres or other ANSI SQL databases. It focuses on simply helping you build the SQL by managing the parameterization process, but you can still use the full power of SQL to create optimized queries and even special features that a particular SQL engine provides.

One of its killer features is the ability to create custom filter queries based on whether parameters are defined, so you can create one complex query which is relaxed based on the parameters defined at runtime.

Check out SQLBits, and let me know what you think. You can leave a comment in the discussion secion of this episode. I find it to be a great tool to help me generate SQL for Postgres and hope you will too.

Feb 17 2014

17mins

Play

008 Guy Bedford - jspm & SystemJS - Unity and simplicity in loading CommonJS, AMD, and ES6 JS packages

Podcast cover
Read more

JavaScript module loading has traditionally been difficult due to diverse module formats and difficult configuration. With so many competing standards it is hard to get everything to work well together.

Guy has come forward with a solution which simplifies loading and management of JS packages. This is a full workflow solution including both dynamic loading and capability to build bundles for production.

  1. Episode Info
  2. Episode Notes
    1. Simple example of SystemJS in browser
    2. Links
    3. Videos
    4. Other podcasts

Episode Info

  • Episode: CW 008
  • Published: July 2nd, 2014
  • Tags: nodejs, js,es6,commonjs,amd,es6,packages,modules,jsconf
  • Duration: 22:12

Episode Notes

  • 03:00 - es6-module-loader
  • 04:25 - CommonJS, AMD, ES6 modules. Browserify
  • 05:10 - SystemJS - loads ES6 modules, AMD, CommonJS and global scripts. Designed in spec itself, IE8+, suitable for production, runs in browser and Node.js, promises API
  • 08:00 - SystemJS workflow - dynamic loading and build capability
  • 10:00 - Using SystemJS with build tools
  • 10:30 - SystemJS community
  • 11:30 - Auto file type detection (CJS, AMD, UMD, …) or can specify
  • 12:45 - Optional configuration. Made to be as easy as possible to get going
  • 14:30 - jspm - JavaScript Package Manager - CDN for SystemJS, require by name.
  • 15:30 - Core ideas - making requiring really simple and making package management really simple
  • 16:00 - Design of loader and manager
  • 17:28 - Ready for review and full workflow. An invitation to the community
  • 18:26 - GitHub locations for projects, examples
  • 20:34 - How to follow up, closing remarks

Simple example of SystemJS in browser

<script src="system.js"></<span class="hljs-name">script>
<script>
System.import('app/app')
.catch(function(e) {
// we add this since promises suppress all errors
setTimeout(function() {
throw e;
});
});
</<span class="hljs-name">script>

Links

  • es6-module-loader - ES6 module loader polyfill
  • SystemJS - Spec-compliant universal module loader - loads ES6 modules, AMD, CommonJS and global scripts.
  • SystemJS-Build-Tool - Build tool for SystemJS which can bundle for production
  • jspm - Package manager for the SystemJS universal module loader, built on top of the dynamic ES6 module loader. Load any module format (ES6, AMD, CommonJS and globals) directly from endpoints such as npm and github with flat versioned dependency management. For production, use the jspm CLI tool to download packages locally, lock down versions and build into a bundle. In development, load modules directly from CDN for frictionless experimentation, switching into production on the same code with a single configuration change. Supports SPDY with server push.
  • jspm-es6-demo - jspm ES6 module loading workflow demo - write ES6 modules, load external from CDN, install locally using CDN versions, bundle into single file for production
  • jspm Google Group - Discussion forum for JSPM
  • Guy Bedford’s Twitter
  • Guy Bedford’s GitHub repositories
  • Jeff Barczewski, Founder, CodeWinds twitter
  • CodeWinds twitter

Videos

Other podcasts

Jul 02 2014

22mins

Play

005 Saul Maddox, Software Engineer at PROS, shares insights about his Hapi-Ninja boilerplate and its technology (Node.js, Hapijs web framework, Swig, Gulp)

Podcast cover
Read more

Saul Maddox, a software engineer for PROS, joins me in this episode of CodeWinds to discuss his Hapi-Ninja boilerplate which helps developers get up and running with the Hapi Node.js web framework.

We discuss in detail the stack he has chosen and the reasons for selecting each:

  • Hapijs Node.js web framework
  • Swig templates
  • Gulp javascript streaming task runner
  • Plugins he has included for assets and routes

Saul explains the file structure of Hapi-Ninja mentioning how to configure and get up and running with Hapi quickly and easily.

  1. Episode Info
  2. Episode Notes
    1. Episode timeline
  3. Getting started with Hapi-Ninja
  4. Links from Show
    1. Following Saul Maddox

Episode Info

  • Episode: CW 005
  • Published: April 7th, 2014
  • Tags: js, nodejs,web,framework,boilerplate
  • Duration: 34:17

Episode Notes

Episode timeline

  • 02:06 - Introduction to the Hapi-Ninja boilerplate
  • 05:44 - Details of Hapi-Ninja stack
  • 06:00 - Hapi Node.js web framework
  • 08:34 - Swig javascript templates
  • 11:17 - Gulp Node.js streaming task runner
  • 13:52 - Getting started with Hapi-Ninja boilerplate
  • 14:44 - Using a watcher like node-supervisor to auto reload
  • 15:47 - Hapi-Ninja file structure
  • 18:38 - Configuration
  • 18:55 - Hapi-Assets plugin for minimizing and concatenating assets
  • 21:42 - Hapi-Named-Routes plugin
  • 23:31 - Hapi-Cache Buster plugin for easier browser reloading in development
  • 25:26 - Easy switching from full frontend app (PhoneGap) to a frontend and server using same folder structure
  • 27:02 - Hapi-Ninja code is commented heavily to help new users learn
  • 27:41 - Upgrading from Hapi 2.x to 3.x
  • 28:37 - Contributing
  • 30:08 - Other projects
  • 30:25 - Ever Stain project - legacy website for being remembered
  • 32:16 - Following Saul

Getting started with Hapi-Ninja

  • Install Nodejs
  • Clone repo from GitHub
  • Change working directory into the new path
  • Install dependencies from npm
# after installing Node.js
git clone https://github.com/poeticninja/hapi-ninja.git
cd hapi-ninja
npm install

Links from Show

  • Hapi-Ninja boilerplate GitHub Repo
  • Hapijs Node.js web framework
  • Swig templates
  • Gulp javascript streaming task runner
  • Hapi-Named-Routes plugin for using named routes
  • Hapi-Assets plugin for automatically minimizing and concatenating assets
  • Hapi-Cache-Buster plugin which helps with serving fresh content in development
  • Ever Stain legacy website coming soon by Saul Maddox. How will you be remembered?

Following Saul Maddox

Apr 07 2014

34mins

Play

015 Michael Jackson and Ryan Florence explain that React.js really changes how we think about building web and mobile apps

Podcast cover
Read more

“It’s so rare that something actually comes along that really changes how we think about building stuff” - Michael Jackson

  1. Episode Info
  2. Show Notes and Timeline
  3. Michael Jackson and Ryan Florence React.js training
  4. Links and Resources
    1. Online Training Courses
    2. Training
    3. Mentioned in the episode
    4. Follow
  5. Related content
  6. Video

Episode Info

  • Episode: CW 015
  • Published: April 8th, 2015
  • Tags: javascript, reactjs,nodejs,isomorphic
  • Duration: 1:16:34
  • Updated: 2015-04-11

Show Notes and Timeline

  • 2:40 - What’s special about React.js?

“For me personally, it changed the way that I code as much as jQuery did back in 2008.” - Michael Jackson

“OMG, This is really going to change the way that I work and how much I enjoy my job on a day to day basis.” - Michael Jackson

  • 5:00 - React.js doesn’t care about how you represent your data, models can be simple objects and arrays

“What excites me about React.js is… it doesn’t care about your data model, you just use plain JavaScript objects… For my models I use: array, Object, Number, …” - Ryan Florence

“The new paradigm with React.js is we aren’t observing, we aren’t having a bunch of events, we are just throwing data at functions and then they return descriptions of UI” - Ryan Florence

  • 6:40 - Javascript becomes our templating language

“It’s hard to explain until you start doing it how big of a shift this makes in your user interface development, to not worry about your app over time; you’re not mutating the state of objects over time in your UI components” - Ryan Florence

“We get to use the solutions that JavaScript already provides like modules and scope… we don’t have to wait for the framework’s template language to implement a solution for that” - Ryan Florence

  • 8:25 - React.js, Angular, and Ember are pushing the language forward (ES6)
  • 10:56 - Is React.js differnet from other SPA frameworks?
  • 11:30 - React.js could be a good rendering tool for many frameworks
  • 12:10 - Integrating React.js into existing code is easy without a full rewrite
  • 13:30 - React.js be added to mature apps, not just greenfield apps
  • 14:50 - Angular 2.0 and Ember 2.0 look a lot like and sound a lot like React.js. It is influencing so many other frameworks.
  • 15:30 - Who can use React.js? What types of projects?
  • 19:00 - Server side rendering - Isomorphic javascript
  • 22:30 - React.js doesn’t care where you render - client, server, canvas, etc.
  • 24:00 - Is React.js hard to learn?
  • 25:00 - React.js allows you to code yourself out of problems
  • 26:00 - Smaller API’s are easier to learn
  • 28:10 - What brought Michael and Ryan to using React.js?

For me, one of the most awkward parts about #Emberjs is switching back and forth between Handlebars templates and component code. Any ideas?

— Michael Jackson (@mjackson) May 13, 2014
  • 28:45 - Instructure had invested in Ember but were having struggles shipping and learning

“At Instructure, we bet on Ember… we were messing with it for almost a year and kind of weren’t shipping anything…” - Ryan Florence

  • 30:00 - After an hour of using React.js, Ryan wanted to use it everywhere

“After an hour of using React.js, I had my face in my hands and said… I want to use this everywhere” - Ryan Florence

  • 30:45 - A few hours later, Ryan had a router proof of concept up and running

“After two hours I actually had something working, and that probably impressed me the most about React.js” - Ryan Florence

“I was never able to just pick up something as quickly as I was able to pick up React.js and build a router” - Michael Jackson

“Two guys who had no idea what they were doing (with React.js) were able to make something (ReactRouter) that worked and was useful for other people” - Michael Jackson

  • 32:30 - Ryan started throwing his toughest problems at React.js and it handled them great

“Then I just threw all of my toughest problems that I had ever run into as a frontend developer at React.js” - Ryan Florence

  • 33:00 - Everyone at Instructure wanted to switch to React.js after being exposed to it

“At Instructure we had this hack week, I encouraged a couple of my coworkers to use React.js for their projects… every single one of them came back and asked: When are putting this into our stack?” - Ryan Florence

  • 33:20 - Reducing the context switch when developing, JSX
  • 37:26 - React Router and Relay, working with React.js team

“This is something that I really feel that the React.js authors have seriously nailed on the head, they’ll say they care about the community, and then they will show it by listening, participating, and working with us” - Michael Jackson

  • 40:00 - Data fetching improvements
  • 41:00 - Forward thinking attitude using ES6
  • 42:01 - Relay
  • 45:10 - Components
  • 48:00 - Michael Jackson and Ryan Florence’s React.js Training offerings
  • 50:10 - Become a React.js expert
  • 51:00 - React.js topics covered
  • 52:26 - Prerequisites for learning React.js, just javascript
  • 54:30 - Training format
  • 56:13 - React Router
  • 58:30 - JSX is an optional convenient way to write nested function calls
  • 1:00:00 - Getting designers involved with React.js

@ebryn @ryanflorence @mjackson At Stampsy, JSX enabled our designer to author, refactor and tweak components at crazy speed.

— Dan Abramov (@dan_abramov) September 28, 2014
  • 1:02:00 - Thinking in React.js by Pete Hunt
  • 1:03:38 - React Native
  • 1:05:00 - React Native as a game changer
  • 1:07:00 - Developers can work on native and web
  • 1:08:00 - React Native productivity of instant refreshing for new code
  • 1:10:20 - The wonderful and genuine React.js community

“I am just so impressed by the React.js community… everybody is helping and sharing, all trying to move our industry forward” - Jeff Barczewski

“The people I have found in the React.js community have been genuine. Their desire to help you understand is genuine. Their desire to learn is genuine. It’s been inspiring for me as well.” - Michael Jackson

  • 1:11:38 - Closing

Michael Jackson and Ryan Florence React.js training

Michael and Ryan have launched some React.js training starting this April. CodeWinds listeners can get a $300 discount to their San Francisco training this April 16-17, 2015. Use the link: http://codewinds.com/reactsf

Links and Resources

Online Training Courses

CodeWinds React.js Fundamentals

The premier online course and community where you learn React.js by pragmatically building a real web app while applying TDD/BDD principles

Training

  • http://codewinds.com/reactsf - $300 discount for Michael Jackson & Ryan Florence React.js training in San Francisco - April 16-17, 2015
  • https://reactjs-training.com/ - Michael Jackson and Ryan Florence training events - Seattle, San Francisco, Boulder, Boston, New York, Paris
  • http://codewinds.com/topics - Provide your input on topics, projects, difficulties, technology that you would like covered in future CodeWinds content (tutorials, podcasts, video training courses and classes).
  • Subscribe to the CodeWinds Leading Edge member list to be the first to hear about the upcoming CodeWinds React.js video training course and be invited to become charter members.

Mentioned in the episode

Follow

Related content

Video

Keynote on React.js and React Native from React.js Conf 2015

Apr 08 2015

1hr 16mins

Play

014 Successful launch and I'm back, CodeWinds content plans for 2015, provide your input

Podcast cover
Read more
  1. Episode Info
  2. Transcript
    1. Summary
    2. Backstory
    3. Regrets
    4. I’m back and focussed on CodeWinds
    5. React.js and other course plans
    6. Provide your input
    7. Thanks for your support
    8. Michael Jackson and Ryan Florence React.js training discount
  3. Links

Episode Info

  • Episode: CW 014
  • Published: April 6th, 2015
  • Tags: javascript, reactjs,nodejs
  • Duration: 8:55

Transcript

Summary

Today I will fill you in on the large project that I was working on, its launch, and my CodeWinds focus and content planning for the coming year.

The links and show notes for this podcast are available http://codewinds.com/14 as in episode 14.

Backstory

First, I want to start with an apology, I left you, my community, hanging without any explanation for too long. So I wanted to give you a little of the back story and update you on where CodeWinds is going.

When I launched CodeWinds in 2013, my goal was to bring you the latest web developer news and training which I would deliver through my blog, podcast, and video courses. Well just after I started working on content, a local enterprise reached out with an ultra important need to rapidly build a scalable resilient platform for a large client. I didn’t even know the specifics of their client until the launch a year later. Well this enterprise was MasterCard. Our client turned out to be none other than Apple, and we were building the MasterCard ApplePay system. Wow.

This was such an awesome opportunity to apply my knowledge and skills to such an important project. When I joined the team, I intended to continue delivering CodeWinds content in my spare time, however the project demanded more of my focus than I anticipated, especially as we approached the launch. We poured our hearts into making sure that our platform was battle ready. And what happened on launch day? … well everything just worked.

It was one of those priceless moments when everything comes together, like a symphony of technology and collaboration. The launch was described by some the senior staff as being possibly the most successful MasterCard launch of all time. It was complex, involving so many partners, yet it came together beautifully. I was blessed to be a part of this amazing team.

Regrets

Yet in all the success we had with this project, I failed you my CodeWinds community. I focussed so completely on the project that my content creation ground to a halt. I should have communicated with you, so you wouldn’t be left hanging and wondering what had happened. For that I am truly sorry, and ask for your forgiveness.

I’m back and focussed on CodeWinds

Fast forward to today, what’s in store for my future and that of CodeWinds. Well I am happy to say that I’m back. After much soul searching, I departed from the MasterCard team to work on CodeWinds fulltime. My desire is to bring you the best leading edge full stack web developer content.

React.js and other course plans

In the past few months, I have been doing a deep dive into React.js and its family. I’m so excited by the development and innovation going on in the React.js community.

“I believe the ideas and technology developing from the React.js community will profoundly influence how we build web and mobile apps.”

I’m currently planning a course on React.js and then will follow it with other topics like ES6, Hapi, Node, building resilient systems, and using HTML5.

I’ll offer this material in a variety of ways, but the primary mechanism will be online courses with training videos and exercises that you can follow at your own pace or in conjunction with those in a class. These will be real world projects similar to that which you would build at your companies.

I don’t like the simple hello world style examples which are so far removed from our real projects that it is hard to see how you really would do things in practice. So these will be real projects solving real problems including proper testing and error handling. I’ll deliver these video lessons in bite sized chunks that build on each other, so you can go directly to a specific topic or learn from beginning to end. I’ll continue to blog and produce this podcast with related materials to complement all of these areas.

Provide your input

To be successful in this endeavor, I really depend on your input for the technologies and training you would like me to cover, especially the key topics or questions that you struggle with when building complex web applications. I just want to make sure I am working on the most pertinent topics for you. So if you could just spare a few moments, I would really appreciate your input, head over to http://codewinds.com/topics which will redirect you to a Google Doc.

Check out the major categories, questions, topics, and provide your own. If you see existing ideas that resonate and interest you, please add a +1 next to them so I can gauge interest and priorities. If you have ideas for the types of apps we might build, please add that as well. I’m open to all your ideas and needs, just add them to the doc.

Thanks for your support

I want to thank you for staying with me through this prolonged start and I am excited about what we’ll be able to accomplish together in the future.

I hope you are subscribed to my leading edge member list because you won’t want to miss the next episode of the CodeWinds podcast on React.js with Michael Jackson and Ryan Florence. We had a fantastic discussion about React.js and I think you’ll start to see why I am excited about everything coming out of the React.js community.

Michael Jackson and Ryan Florence React.js training discount

Michael and Ryan have launched some React.js training starting this April and for CodeWinds listeners you can get a $300 discount to their San Francisco training this April 16-17, 2015. Use the link: http://codewinds.com/reactsf

The links and show notes for this episode are available at http://codewinds.com/14

If you would like to keep up on the latest in web developer news and training, follow me on codewinds.com where you’ll find this podcast, tutorials, and video training covering javascript, React.js, and Node.js.

Links

Apr 06 2015

8mins

Play

013 Reflections of JSConf 2014 - Part 2

Podcast cover
Read more
  1. Episode Info
  2. Episode Notes
    1. Links
    2. Videos

Episode Info

  • Episode: CW 013
  • Published: September 22nd, 2014
  • Tags: nodejs, js,jsconf
  • Duration: 42:54

Episode Notes

  • 01:42 - Nodevember Node.js and JavaScript Conference coming November 15-16, Nashville, TN
  • 04:40 - Day of Activities at JSConf 2014
  • 05:07 - NodeBots, NodeCopters, NodeRockets, NodeBoats
  • 11:43 - Golf Tournament sponsored by NodeSource
  • 13:04 - Kayaking, Scavenger Hunt, Segway tour of Amelia Island
  • 13:46 - Guy Bedford - Package Management for ES6 Modules (SystemJS, jspm.io)
  • 19:43 - Jordan Matthiesen - Modern mobile app tool-chains
  • 23:08 - Ryan Florence - Embularactymerbone
  • 27:30 - Forrest Norvell - Learning ES6 as a Community
  • 30:35 - Spike Brehm - Building Isomorphic Apps
  • 33:00 - Bodil Stokke - Reactive Game Development for the Discerning Hipster
  • 34:00 - Kassandra Perch - Modular Application Architecture in Javascript
  • 34:40 - Kawandeep Virdee - Open Web Art: JavaScript for Interactive, Collaborative, and Hackable Art
  • 36:24 - Brian Brennan - Being Human
  • 38:30 - JS Family pic via drone
  • 38:50 - Final thoughts about JSConf 2014

Links

Videos

Sep 22 2014

42mins

Play

012 Reflections of JSConf 2014 - Part 1

Podcast cover
Read more
  1. Episode Info
  2. Episode Notes
    1. Links
    2. Videos

Episode Info

  • Episode: CW 012
  • Published: September 6th, 2014
  • Tags: nodejs, js,jsconf
  • Duration: 57:34

Episode Notes

  • 01:23 - Nodevember Node.js and JavaScript Conference coming November 15-16, Nashville, TN
  • 03:15 - JSConf 2014 Venue, Amelia Island, FL, Arriving
  • 09:00 - CSSConf, Welcome reception
  • 13:03 - Wednesday, first day of JSConf talks
  • 15:00 - Neil Green - custom DSL’s in JavaScript
  • 15:53 - Ron Evans, CylonJS - controlling hardware with JS, NodeBots, drones
  • 22:00 - Tessel - Hardware which runs JS
  • 24:45 - Spark Core kit
  • 26:30 - Travell Perkins - Battle Hardened Node.js for the Enterprise
  • 27:35 - Nico Bevacqua - Front End Ops Tooling, Grunt, Gulp, npm, browserify
  • 36:13 - Mark DiMarco - User Interface Alorithms
  • 40:25 - Nick Bray - Native Code on the Web
  • 41:15 - Ryan Paul - Composing frontend Web applications with MontagsJS
  • 45:45 - G. C. Marty - Play DVDs in JS for the sake of interoperability
  • 47:40 - James Long - Unshackling JavaScript with Macros, SweetJS, Implemnting some ES6 features with macros
  • 50:30 - Marco Rogers - Finding patterns across front-end frameworks
  • 53:00 - David Calhoun - Realtime satellite tracking in the browser
  • 54:10 - Jenn Schiffer - What’s the harm in sorting: sanitizing inputs for more optimized JavaScript

Links

Videos

Sep 06 2014

57mins

Play

011 Kassandra Perch - Modular JavaScript application architectures and insights from teaching

Podcast cover
Read more
  1. Episode Info
  2. Episode Notes
    1. Links
    2. Video / Slides

Episode Info

  • Episode: CW 011
  • Published: August 20th, 2014
  • Tags: nodejs, js,jsconf
  • Duration: 11:37

Episode Notes

  • 04:08 - Being judicious about choosing frameworks
  • 05:10 - Frameworks which combine other components
  • 05:38 - Examples of modular frameworks
  • 06:21 - Insights from teaching at Girl Develop It!
  • 07:00 - Students learn in different ways
  • 08:10 - Format for classes, gradually building
  • 09:50 - Challenges in learning JavaScript

Links

Video / Slides

Watch Kassandra Perch’s JSConf talk on YouTube

Aug 20 2014

11mins

Play

010 Nico Bevacqua - JS build tooling, development workflow, and his new book JavaScript Application Design

Podcast cover
Read more

Nico Bevacqua, the author of JavaScript Application Design which is in early access at Manning, explains more about JS continuous development, integration, and deployment. We discuss build tools, module systems, component architectures, MVC, and finally the experience of writing a traditionally published book.

  1. Episode Info
  2. Episode Notes
    1. JavaScript Application Design - Manning
    2. Links
    3. Video / Slides

Episode Info

  • Episode: CW 010
  • Published: August 8th, 2014
  • Tags: nodejs, js,jsconf
  • Duration: 29:10

Episode Notes

  • 01:35 - Why build first?
  • 03:25 - Continuous development
  • 05:00 - Continuous Integration - Travis-CI
  • 05:20 - Continuous Deployment - Heroku, Amazon EC2
  • 06:20 - Build tools - grunt, gulp, npm - determining the best choice
  • 11:35 - JS Modules - AMD, CommonJS (CJS), ES6 Modules, RequireJS, Browserify, AngularJS DI
  • 15:00 - HTTP/2 efficient parallel streaming potentially reducing need for bundling
  • 16:30 - Browserify limitations and CommonJS
  • 18:30 - App design, modularity, package managers (component, bower, npm)
  • 20:20 - Current state of building components - Bower, Component, Polymer, Web Components, AngularJS, ReactJS
  • 22:24 - MVC Frameworks - AngularJS, ReactJS and the Virtual DOM
  • 23:35 - Experience writing JavaScript Application Design published by Manning
  • 27:35 - Following Nico

JavaScript Application Design - Manning

Published by Manning, currently available as early access edition - Purchase at Manning

Links

Video / Slides

Watch Nico Bevacqua’s JSConf talk on YouTube

Slides from Nico Bevacqua JSConf 2014: Front End Ops Tooling - Slideshare

Aug 08 2014

29mins

Play

009 Spike Brehm - Sharing javascript in browser and server - building isomorphic apps

Podcast cover
Read more

Spike explains the different categories of Isomorphic apps and how this is accomplished. He mentions various tools for facilitating sharing across browser, server, and devices. He shares how Airbnb, Yahoo, Flickr, Facebook, Instagram are using some of these technologies today. Finally, he provides resources to help others learn and get started.

  1. Episode Info
  2. Episode Notes
    1. Links
    2. Video / Slides

Episode Info

  • Episode: CW 009
  • Published: July 16th, 2014
  • Tags: nodejs, js,jsconf
  • Duration: 13:48

Episode Notes

  • 01:50 - Isomorphic definition
  • 03:15 - Tools for sharing code across browser and server
  • 04:00 - Browserify for using Node.js packages in browser
  • 05:20 - Categories of Isomorphic code
  • 06:20 - Superagent - HTTP client
  • 07:08 - Airbnb’s Rendr - render Backbone apps on client and server
  • 07:30 - Compelling reasons for building isomorphic apps
  • 08:00 - Flickr main page isomorphic, modown project
  • 08:39 - Meteor framework
  • 09:25 - Getting started with Isomorphic JavaScript
  • 10:10 - ReactJS - client and server rendering, can attach event handlers to server rendered page
  • 10:40 - Facebook and Instagram using ReactJS for Isomorphic apps
  • 11:30 - Following Spike Brehm and Isomorphic JavaScript

Links

Video / Slides

Watch Spike Brehm’s JSConf talk on YouTube

Slides from Spike Brehm JSConf 2014: Building Isomorphic Apps - Slideshare

Jul 16 2014

13mins

Play

008 Guy Bedford - jspm & SystemJS - Unity and simplicity in loading CommonJS, AMD, and ES6 JS packages

Podcast cover
Read more

JavaScript module loading has traditionally been difficult due to diverse module formats and difficult configuration. With so many competing standards it is hard to get everything to work well together.

Guy has come forward with a solution which simplifies loading and management of JS packages. This is a full workflow solution including both dynamic loading and capability to build bundles for production.

  1. Episode Info
  2. Episode Notes
    1. Simple example of SystemJS in browser
    2. Links
    3. Videos
    4. Other podcasts

Episode Info

  • Episode: CW 008
  • Published: July 2nd, 2014
  • Tags: nodejs, js,es6,commonjs,amd,es6,packages,modules,jsconf
  • Duration: 22:12

Episode Notes

  • 03:00 - es6-module-loader
  • 04:25 - CommonJS, AMD, ES6 modules. Browserify
  • 05:10 - SystemJS - loads ES6 modules, AMD, CommonJS and global scripts. Designed in spec itself, IE8+, suitable for production, runs in browser and Node.js, promises API
  • 08:00 - SystemJS workflow - dynamic loading and build capability
  • 10:00 - Using SystemJS with build tools
  • 10:30 - SystemJS community
  • 11:30 - Auto file type detection (CJS, AMD, UMD, …) or can specify
  • 12:45 - Optional configuration. Made to be as easy as possible to get going
  • 14:30 - jspm - JavaScript Package Manager - CDN for SystemJS, require by name.
  • 15:30 - Core ideas - making requiring really simple and making package management really simple
  • 16:00 - Design of loader and manager
  • 17:28 - Ready for review and full workflow. An invitation to the community
  • 18:26 - GitHub locations for projects, examples
  • 20:34 - How to follow up, closing remarks

Simple example of SystemJS in browser

<script src="system.js"></<span class="hljs-name">script>
<script>
System.import('app/app')
.catch(function(e) {
// we add this since promises suppress all errors
setTimeout(function() {
throw e;
});
});
</<span class="hljs-name">script>

Links

  • es6-module-loader - ES6 module loader polyfill
  • SystemJS - Spec-compliant universal module loader - loads ES6 modules, AMD, CommonJS and global scripts.
  • SystemJS-Build-Tool - Build tool for SystemJS which can bundle for production
  • jspm - Package manager for the SystemJS universal module loader, built on top of the dynamic ES6 module loader. Load any module format (ES6, AMD, CommonJS and globals) directly from endpoints such as npm and github with flat versioned dependency management. For production, use the jspm CLI tool to download packages locally, lock down versions and build into a bundle. In development, load modules directly from CDN for frictionless experimentation, switching into production on the same code with a single configuration change. Supports SPDY with server push.
  • jspm-es6-demo - jspm ES6 module loading workflow demo - write ES6 modules, load external from CDN, install locally using CDN versions, bundle into single file for production
  • jspm Google Group - Discussion forum for JSPM
  • Guy Bedford’s Twitter
  • Guy Bedford’s GitHub repositories
  • Jeff Barczewski, Founder, CodeWinds twitter
  • CodeWinds twitter

Videos

Other podcasts

Jul 02 2014

22mins

Play

007 Forrest Norvell on ES6 and our community's role at JSConf 2014

Podcast cover
Read more

Watch video on YouTube

  1. Episode Info
  2. Episode Notes
    1. Links
    2. Videos

Episode Info

  • Episode: CW 007
  • Published: June 24th, 2014
  • Tags: nodejs, js,es6,jsconf
  • Duration: 38:33

Episode Notes

  • 01:36 - Forrest explains his new position at npm Inc.
  • 02:20 - Discussion of Forrest’s JSConf 2014 talk
  • 03:30 - Rise of community standards, Douglas Crockford’s the Good Parts, John Resig jQuery, Promises A+ standard
  • 05:50 - Standards committees, an inside look
  • 08:00 - ES4, ES5, Harmony, ES7 (champion for each feature)
  • 10:00 - test262 - conformance test suite
  • 11:58 - Our community has the power to figure out what features in ES6 are useful. Sort out the parts that are genuinely useful. Figure out the good parts now.
  • 14:48 - Module proposal benefited from critical discussions from the community
  • 16:00 - Tools for using ES6 features now
  • 17:26 - Development community needs to get on top of things and teach how we use the features with emphasis on the compelling parts.
  • 18:50 - Forrest no longer recommends Crockford’s Good Parts to new developers because half is scar tissue and dogma, instead Dave Herman’s Effective JavaScript which gives them a mental toolkit to determine their own style
  • 20:55 - Don’t concentrate on what’s cool, but concentrate on what’s stable and effective. As an educator be conservative.
  • 21:29 - Warnings from Java, Perl history
  • 24:00 - Typescript and Coffeescript bring things to the table but they could fragment the community
  • 24:40 - ES timeline
  • 26:30 - Features need enough examination to ensure they are finished
  • 28:00 - Keeping some things in user land to see what community comes up with. Developers as leaders in this transition.
  • 29:00 - npm growth, npm Inc dev ops, addressing pain points in npm CLI
  • 34:30 - All software languages have something that is terrible. Community is something that makes Node.js special.
  • 35:45 - Node.js in the enterprise is happening very rapidly. A very interesting time to be in the middle of this evolution.

Links

  • Forrest Norvell, npm product maker at npm Inc. twitter
  • npm Inc. - npm, Inc. supports the JavaScript community by providing the registry where developers publish and share packaged open-source modules.
  • traceur - Traceur is a JavaScript.next-to-JavaScript-of-today compiler. Compile ES6 code into JS which can be used by today’s browsers.
  • es6-shim - Provides compatibility shims so that legacy JavaScript engines behave as closely as possible to ECMAScript 6 (Harmony).
  • es6-module-transpiler - ES6 Module Transpiler is a JavaScript library for converting JavaScript files written using the ES6 draft specification module syntax to existing library-based module systems such as AMD, CommonJS, or simply globals.
  • sweet.js - Macros for javascript which can be used to add in ES6 features.
  • es6ify - browserify v2 transform to compile JavaScript.next (ES6) to JavaScript.current (ES5) on the fly.
  • ES6 compatibility table - ES6 compatibility table, comparing browser versions, Node.js. Links to ES6 feature descriptions.
  • Spider Monkey - Firefox JS engine written in C++. Currently Spider Monkey is leading in the number of ES6 features that are implemented. (56/66 according to Kangax)
  • Effective JavaScript - David Herman’s book
  • Jeff Barczewski, Founder, CodeWinds twitter
  • CodeWinds twitter

Videos

Jun 24 2014

38mins

Play

006 Daniel Shaw (@dshaw) introduces NodeSource at JSConf 2014

Podcast cover
Read more

Watch video on YouTube

  1. Episode Info
  2. Episode Notes
    1. NodeSource Team (mentioned in interview)
    2. Social Media Links

Episode Info

  • Episode: CW 006
  • Published: June 18th, 2014
  • Tags: nodejs, jsconf
  • Duration: 23:54

Episode Notes

NodeSource is a professional Node.js software company. NodeSource provides enterprise-grade software products and educational and professional consulting services to empower companies to be effective and productive with Node.js.

  • https://nodesource.com/ - NodeSource website with team background
  • https://nodesource.com/products - NodeSource products
    • npm Plus - NodeSource is the premier, certified reseller of on-premise, private npm instances. NodeSource has partnered with npm Inc. to deliver a secure, on-premise, private npm solution alongside managed services such as:
      • Bespoke npm Training
      • 24x7x365 Support
      • Custom Integrations (LDAP, SSO, etc.)
    • N|Ship - NodeSource’s official Node.js deployment solution to make app deployments easy, secure and automated.
  • http://2014.jsconf.us/ - JSConf 2014 - May 27-31, 2014 at Amelia Island, FL

NodeSource Team (mentioned in interview)

![DanShaw][] ![JoeMccann][] ![RodVagg][] ![ChrisWilliams][] ![TrevorNorris][]

Social Media Links

NodeSource Team (partial list)

  • NodeSource twitter
  • Daniel Shaw, Co-founder twitter
  • Joe McCann, Co-founder twitter
  • Rod Vagg, Director of Engineering twitter
  • Chris Williams, Director of Professional Services twitter
  • Trevor Norris, Node.js Maintainer twitter

CodeWinds

Jun 18 2014

23mins

Play

005 Saul Maddox, Software Engineer at PROS, shares insights about his Hapi-Ninja boilerplate and its technology (Node.js, Hapijs web framework, Swig, Gulp)

Podcast cover
Read more

Saul Maddox, a software engineer for PROS, joins me in this episode of CodeWinds to discuss his Hapi-Ninja boilerplate which helps developers get up and running with the Hapi Node.js web framework.

We discuss in detail the stack he has chosen and the reasons for selecting each:

  • Hapijs Node.js web framework
  • Swig templates
  • Gulp javascript streaming task runner
  • Plugins he has included for assets and routes

Saul explains the file structure of Hapi-Ninja mentioning how to configure and get up and running with Hapi quickly and easily.

  1. Episode Info
  2. Episode Notes
    1. Episode timeline
  3. Getting started with Hapi-Ninja
  4. Links from Show
    1. Following Saul Maddox

Episode Info

  • Episode: CW 005
  • Published: April 7th, 2014
  • Tags: js, nodejs,web,framework,boilerplate
  • Duration: 34:17

Episode Notes

Episode timeline

  • 02:06 - Introduction to the Hapi-Ninja boilerplate
  • 05:44 - Details of Hapi-Ninja stack
  • 06:00 - Hapi Node.js web framework
  • 08:34 - Swig javascript templates
  • 11:17 - Gulp Node.js streaming task runner
  • 13:52 - Getting started with Hapi-Ninja boilerplate
  • 14:44 - Using a watcher like node-supervisor to auto reload
  • 15:47 - Hapi-Ninja file structure
  • 18:38 - Configuration
  • 18:55 - Hapi-Assets plugin for minimizing and concatenating assets
  • 21:42 - Hapi-Named-Routes plugin
  • 23:31 - Hapi-Cache Buster plugin for easier browser reloading in development
  • 25:26 - Easy switching from full frontend app (PhoneGap) to a frontend and server using same folder structure
  • 27:02 - Hapi-Ninja code is commented heavily to help new users learn
  • 27:41 - Upgrading from Hapi 2.x to 3.x
  • 28:37 - Contributing
  • 30:08 - Other projects
  • 30:25 - Ever Stain project - legacy website for being remembered
  • 32:16 - Following Saul

Getting started with Hapi-Ninja

  • Install Nodejs
  • Clone repo from GitHub
  • Change working directory into the new path
  • Install dependencies from npm
# after installing Node.js
git clone https://github.com/poeticninja/hapi-ninja.git
cd hapi-ninja
npm install

Links from Show

  • Hapi-Ninja boilerplate GitHub Repo
  • Hapijs Node.js web framework
  • Swig templates
  • Gulp javascript streaming task runner
  • Hapi-Named-Routes plugin for using named routes
  • Hapi-Assets plugin for automatically minimizing and concatenating assets
  • Hapi-Cache-Buster plugin which helps with serving fresh content in development
  • Ever Stain legacy website coming soon by Saul Maddox. How will you be remembered?

Following Saul Maddox

Apr 07 2014

34mins

Play

004 Pete Hunt, Software Engineer for Facebook, discussing Facebook's open source js UI framework, React

Podcast cover
Read more

In this episode, Jeff interviews Pete Hunt, a software engineer with Facebook about Facebook’s hot new open source js UI framework, React. React is a fresh look at how to build UI’s, attempting to improve on the limitations of the past. React gets some of its inspiration from how game engines acehieve awesome performance in their rendering pipeline.

React can be used in the browser and on the server with node.js so you can have single page apps that are fully indexable by the search engines and have instant load characteristics. React has pluggable backends so it can be used to target the DOM, HTML, canvas, SVG, and other formats.

The ideas and concepts behind React are very compelling, I encourage you to give it a look.

  1. Episode Info
  2. Episode Notes
    1. Interview timeline
  3. Notable users of React
  4. Resources
    1. Links from Show
    2. Online Training Courses
    3. Tutorials
    4. Other

Episode Info

  • Episode: CW 004
  • Published: March 17th, 2014
  • Tags: js, nodejs,UI,framework
  • Duration: 42:17
  • Updated: 2014-05-01 Added links to great articles by Reto Schläpfer

Episode Notes

Interview timeline

  • 2:08 - What is React and why might people want to use it?
  • 3:08 - The symbiotic relationship of ClojureScript and React
  • 4:54 - The history of React and why it was created
  • 9:43 - Updating web page with React without using data binding, a better approach inspired by game engines
  • 13:11 - Using the virtual DOM to change the browser DOM
  • 13:57 - Programming with React, render target HTML, canvas, other. Javascript is reference implementation of React. Node.js, ClojureScript, other environments.
  • 16:45 - Working with designers. Contrasted with Ember and AngularJS. React encourages building a component architecture.
  • 21:45 - JSX Compiler bridging HTML and React javascript
  • 23:50 - Autobuilding JSX and in browser tools for React
  • 24:50 - Tips and tricks to working with React, suggestions for getting started with React
  • 27:17 - Rendering HTML on the server with Node.js. Pluggable React rendering backends (DOM, HTML, canvas, mixed mode static HTML + background JS binding). Better single page app performance
  • 29:20 - React evolved through survival of the fittest at Facebook
  • 30:15 - Ideas for having state on server and client, possibilities for using React over web sockets.
  • 32:05 - React-multiuser - distributed shared mutable state using Firebase
  • 33:03 - Better debugging with React using the state transitions, rewinding the state to replay the events
  • 34:08 - Differences from Web Components
  • 34:25 - Notable companies using React - Khan Academy, Oscars (Neartime.com), Largest bank in Russia, Facebook, Instagram
  • 35:16 - Could a React backend plugin be created to target PDF?
  • 36:30 - Future of React, what’s next?
  • 39:38 - Contributing and getting help

Notable users of React

  • Instagram.com is 100% built on React, both public site and internal tools.
  • Facebook.com’s commenting interface, business management tools, Lookback video editor, page insights, and most, if not all, new JS development.
  • Khan Academy uses React for most new JS development.
  • Shirtstarter is 100% built on React.
  • Sberbank, Russia’s number one bank, is built with React.
  • The New York Times’s 2014 Red Carpet Project is built with React.

Resources

Links from Show

Online Training Courses

  • CodeWinds React.js Fundamentals - The premier online course and community where you learn React.js by pragmatically building a real web app while applying TDD/BDD principles
“Highly recommended!”
- Kevin Old, Senior Software Engineer
“Look no further, the React.js Fundamentals course is the only course you will need to become an expert in React.js”
- Wyatt Preul, Software Architect, nearForm
“Overall I would give this React.js course a 4-star thumbs up!”- Kevin Bridges - Senior Technical Consultant at Applied Software

Tutorials

Other

The articles below by Reto Schläpfer are excellent in explaining why you might consider Reactjs vs traditional MVC frameworks.

Mar 17 2014

42mins

Play

003 SQLBits - lightweight SQL builder for Node.js for use with Postgres or other ANSI SQL databases

Podcast cover
Read more

SQLBits, a lightweight SQL builder for Node.js built by William Wicks, is a great compromise between using native SQL and going to a full ORM (object relational mapping tool). It is small and focused on doing one job, to help you create parameterized queries. One of its unique and killer features is that it can help you create any combination of filter queries from a single complex query based on the parameters used.

My goal with this podcast is to introduce you to SQLBits and provide some insight as to why it could be a valuable tool in your Node.js toolbox.

  1. Episode Info
  2. Episode Notes
    1. Background - SQL Builder vs ORM
    2. SQLBits - Node.js SQL builder
    3. SQLBits Install
    4. Simple example
    5. Additional criteria
    6. Joins
    7. Filters driven by defined parameters
    8. Inserts
    9. Updates
    10. Deletes
  3. Quick Reference
  4. Resources
  5. Summary

Episode Info

  • Episode: CW 003
  • Published: February 17th, 2014
  • Tags: nodejs, database
  • Duration: 17:17

Episode Notes

Background - SQL Builder vs ORM

What is a SQL builder and how does that compare to an ORM (Object Relational Mapper)?

A SQL builder like SQLBits is designed to help you to build safe parameterized SQL with a minimal abstraction layer that still allows you to write optimized SQL queries. Using parameters is important in create SQL to prevent SQL injection attacks where users enter malicious data into forms to gain access to your database. SQL builders help you to use parameters and avoid these attacks.

Having used Hibernate for Java and Active Record with Rails (a couple of popular Object Relational Mappers, I’ve seen what a ORM’s can do and they are nice when they do what you want, but all to often once you get into more advanced uses, they tend to get in your way and you are fighting with the tool to try to get it to generate the SQL you want.

So a SQL builder which allows you to create just the right queries but helps you deal with parameterization and tokens, provides a great balance. It stays out of your way and just helps with the bookkeeping. The sql it generates and the parameter array can be used directly with your database module like the pg Postgres client.

SQLBits - Node.js SQL builder

I reviewed a bunch of Node.js SQL builders listed in NPM and I was not happy with any of them until I found SQLBits.

Too many of them seemed complicated or too integrated bordering on ORM capabilities. I wanted something that was simple and just server a single purpose to help me build good parameterized queries. I didn’t want it to run my queries or perform schema manipulation. I don’t want a complete new DSL (domain specific language) or API that I need to learn. SQL is already a DSL that does that just fine, but it can get tricky to manage as queries get complex.

SQLBits is a simple tool which helps you generate SQL but stays out of your way. You can create custom tuned SQL which pulls back only what is needed over the wire and have it manage the parameters and tokens.

SQLBits Install

npm install sqlbits --save # install and add to package.json

Simple example

var bits = require('sqlbits');
var SQL = bits.SQL;
var $ = bits.$;
var AND = bits.AND;
var params = { max_price: 10.00, clearance: true };
var query =
SQL('select name, desc from widgets')
.WHERE('price < ', $(params.max_price), AND,
'clearance = ', $(params.clearance))
.ORDERBY('name asc');

// sql: select name, desc from widgets WHERE(price < $1 AND clearance = $2) ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 10, true ]

Additional criteria

You can add in additional filter criteria with:

  • AND - bits.AND
  • OR - bits.OR
  • BETWEEN - bits.BETWEEN (discussed in depth later)
  • .IN(array)
  • $ - bits.$ - used to specify that something is a parameter $(params.foo)

Joins

With relational data, you will often need to join tables together, and to maintain good performance these joins may need to be optimized. SQLBits allows you to perform any joins you need (left, right, inner, outer) just like you would normally with raw SQL.

var bits = require('sqlbits');
var SQL = bits.SQL;
var query =
SQL('select w.name, c.type from widgets w ' +
'join category c on w.categoryID = c.categoryID')
.ORDERBY('w.name asc');

// OR

var query =
SQL('select w.name, c.type from widgets w')
._('join category c on w.categoryID = c.categoryID')
.ORDERBY('w.name asc');

// sql: select w.name, c.type from widgets w join category c on w.categoryID = c.categoryID ORDER BY w.name asc
console.log('sql: ', query.sql);

The ._() is another way to concatenate sql together.

Filters driven by defined parameters

If you have ever had to create SQL with filter clauses that was driven by user input, you should really appreciate this next feature.

Let’s say for instance that you have a report or catalog that you want to allow the user to provide filter criteria to limit by.

  • If the user doesn’t enter any criteria then return the whole list unfiltered.
  • If they add a minimum price use that in the filter
  • If they add a maximum price limit the rows with that criteria
  • If they include a clearance boolean, use that in the criteria

Even in this simple example, there are many combinations of possible filters depending on whether the user enters any of the filter data points.

If you were building this SQL by hand, typically you would create a series of if statements to conditionally include the filter, and you would build up an array of params which you have to manually keep track of.

However with SQLBits this is child’s play. You only have to create one complex query that includes all the possible filter criteria, and SQLBits will eliminate the parts where the parameters involved are undefined.

Also by using the BETWEEN command, SQLBits handles all four scenarios automatically:

  • min and max are defined: price BETWEEN $1 AND $2
  • only min is defined: price >= $1
  • only max is defined: price <= $1
  • neither min or max is defined: the criteria is eliminated
var bits = require('sqlbits');
var SQL = bits.SQL;
var $ = bits.$;
var AND = bits.AND;
var BETWEEN = bits.BETWEEN;

function queryByParam(params) {
var query =
SQL('select name, desc from widgets')
.WHERE('price', BETWEEN(params.min, params.max), AND,
'clearance = ', $(params.clearance))
.ORDERBY('name asc');
return query;
}

var query = queryByParam({ min: 2.00, max: 10.00, clearance: true });
// sql: select name, desc from widgets WHERE(price BETWEEN $1 AND $2 AND clearance = $3) ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 2, 10, true ]

var query = queryByParam({ min: 2.00 });
// sql: select name, desc from widgets WHERE price >=$1 ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 2 ];

var query = queryByParam({ max: 10.00 });
// sql: select name, desc from widgets WHERE price <=$1 ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 10 ]

var query = queryByParam({ min: 2.00, max: 10.00 });
// sql: select name, desc from widgets WHERE price BETWEEN $1 AND $2 ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 2, 10 ]

var query = queryByParam({ min: 2.00, clearance: true });
// sql: select name, desc from widgets WHERE(price >=$1 AND clearance = $2) ORDER BY name asc
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 2, true ]

In my opinion, this is one of the killer features of SQLBits. You create a single complex query with all the possible filters and then just provide a params object to SQLBits with a parameters object having the keys that the user wants to filter by, and it provides the customized query.

This eliminates all the conditional logic which is hard to test and debug when it fails and you are left with a single complex query to maintain.

Inserts

Inserting data into your tables by key is as simple as providing an object to SQLBits and it will add all the keys and values.

var bits = require('sqlbits');
var INSERT = bits.INSERT;

function insertWidget(obj) {
return INSERT.INTO('widgets', obj);
}

var query = insertWidget({ name: 'foo', desc: 'Foo man', price: 23.45 });
//INSERT INTO widgets (name,desc,price) SELECT $1,$2,$3
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 'foo', 'Foo man', 23.45 ]

var query = insertWidget({ name: 'bar', price: 11.23 });
//INSERT INTO widgets (name,price) SELECT $1,$2
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: [ 'bar', 11.23 ]

var query = insertWidget({ name: 'bar' });
// INSERT INTO widgets (name) SELECT $1
console.log('sql: ', query.sql);
console.log('params: ', query.params); // params: ['bar']

Updates

Updating data works just like the inserts but uses the UPDATE and .SET()

var bits = require('sqlbits');
var UPDATE = bits.UPDATE;

function updateWidget(id, updateValues) {
return UPDATE('widget')
.SET(updateValues)
._('where id=', $(id));
}

var query = updateWidget(1, { name: 'bar' });
// sql: UPDATE widget SET name=$1 where id=$2
console.log('sql: ', query.sql);
console.log('params: ', query.params); // [ 'bar', 1 ]

var query = updateWidget(2, { name: 'cat', price: 1.12 });
// UPDATE widget SET name=$1,price=$2 where id=$3
console.log('sql: ', query.sql);
console.log('params: ', query.params); // [ 'cat', 1.12, 2 ]

Note: with update’s we don’t want to have the WHERE clause collapse so it is safer to use a non-conditional string with ._('where id = ', $(obj.id)) to there is no chance of the filter clause being collapsed.

Deletes

Finally deletes use DELETE.FROM to specify a deletion.

var bits = require('sqlbits');
var DELETE = bits.DELETE;
var params = { id: 10 };

var query = DELETE.FROM('widgets')
._('where id=', $(params.id));

// sql: DELETE FROM widgets where id=$1
console.log('sql: ', query.sql);
console.log('params: ', query.params); // [ 10 ]

Note: with delete’s we don’t want to have the WHERE clause collapse so it is safer to use a non-conditional string with ._('where id = ', $(obj.id)) to there is no chance of the filter clause being collapsed.

Quick Reference

var bits = require('sqlbits');
var SQL = bits.SQL; // SQL('select name, desc from widgets')
var $ = bits.$; // SQL('...').WHERE('id=', $(obj.id));
var AND = bits.AND; // .WHERE('id=', $(obj.id), AND, 'type=', $(obj.type));
var OR = bits.OR; // .WHERE('type=', $(obj.type), OR, 'color=', $(obj.color));
var IN = bits.IN; // .WHERE('id', IN(array));
var BETWEEN = bits.BETWEEN; // .WHERE(price, BETWEEN($(obj.min), $(obj.max));
var INSERT = bits.INSERT; // INSERT.INTO('widgets', obj)
var UPDATE = bits.UPDATE; // UPDATE('widgets').SET(updateValues)._('where id = ', $(obj.id))
var DELETE = bits.DELETE; // DELETE.FROM('widgets')._('where id = ', $(obj.id))

Methods to help chain

  • ._() - appends to the SQL after adding a space
  • .WHERE(...) - add a where clause which checks the params that are defined to conditionally add the filter criteria
  • .SET(updateValues) - used with UPDATE to provide the field names and values to update
  • .FROM('mytable') - used with DELETE to specify table
  • .ORDERBY('name asc, qty desc') - add sorting criteria
  • .LIMIT(number) - limit the max rows returned, defaults to 0
  • .OFFSET(number) - start rows at offset (for paging), defaults to 0

Accessor properties

  • .sql - get the parameterized SQL string
  • .params - get the array of parameters to use with the SQL

Resources

  • SQLBits - GitHub repo and project readme. This brief page provides examples of how to use SQLBits and is a great place to get started

Summary

SQLBits is a nice lightweight way to create safe parameterized SQL for Postgres or other ANSI SQL databases. It focuses on simply helping you build the SQL by managing the parameterization process, but you can still use the full power of SQL to create optimized queries and even special features that a particular SQL engine provides.

One of its killer features is the ability to create custom filter queries based on whether parameters are defined, so you can create one complex query which is relaxed based on the parameters defined at runtime.

Check out SQLBits, and let me know what you think. You can leave a comment in the discussion secion of this episode. I find it to be a great tool to help me generate SQL for Postgres and hope you will too.

Feb 17 2014

17mins

Play

002 First look at Hapijs 2.0, the Node.js web framework from Walmart Labs

Podcast cover
Read more

This is a review of the Hapi 2.0 functionality unveiled last Monday, Jan 27, 2014 at &yet. The event was live streamed so I was able to watch and take notes. Eran Hammer @eranhammer, a Walmart labs engineer and lead developer for Hapi shared a top to bottom feature discussion including the new changes for version 2. Eran’s Slides

My goal with this podcast is to mention some of the key changes with Hapi 2 and how you would leverage them in your code.

This review and Eran’s presentation are done such that you do not need have a familiarity with Hapi to get value, new users should come away with some understanding of Hapi and how it can be useful for building robust web applications.

  1. Episode Info
  2. Episode Notes
    1. Background
    2. Routes, Caching, State
    3. Plugins
    4. Authorization
    5. Ops
    6. Postmile example app
  3. Major breaking changes
  4. Resources
  5. Summary

Episode Info

  • Episode: CW 002
  • Published: February 1st, 2014
  • Tags: nodejs, hapijs
  • Duration: 21:46

Episode Notes

Background

  • show notes http://codewinds.com/podcast/002.html
  • I have a link to the original live stream, the content starts at about 24 minutes in, so the URL in the show notes jumps directly to that spot.
  • Hapi is the awesome open source web framework created by Walmart Labs.
  • The Hapi framework grew out of years of development first at Yahoo as Sled, later renamed Postmile, then at Walmart Labs.
  • Initially Eran tried to build on Express a popular web framework, but found issues with plugin order, undocumented dependencies, fragility with large team use.
  • Hapi was developed by Walmart Labs for their mobile division
  • Hapi is built as a scalable web framework that they could use to evolve their system over time.
  • Initiallly used to reverse proxy or pass through requests to their existing backend written in java or other languages.
  • Then decorate, batch, and begin to replace legacy code with new code in Node.js
  • It ran 100% of their mobile traffic starting with Black Friday and proved its stability running at about 1-2% cpu on 50 servers throughout the highest load. Lasagna graphs flatlines for cpu and memory use
  • Walmart starting to replace more of its legacy code with Hapi and even now part of walmart.com
  • Hapi has great REST API support as well as infrastructure for building web apps or even serving static content
  • Just configure the routes and you are ready, no extra plugins are necessary for the most common functionality
  • Liked that Eran provides some quick commentary about features and how they evolved
  • Hapi 2.0 isn’t a massive increase in new functionality, in fact it is more about taking out the cruft, eliminating the redundant ways to do things. Names that evolved over time, picking the best and cleaning up the others.
  • This strategy shows the wisdom and experience of its architect, to resi the urge to add features by first solidifying the base.

Routes, Caching, State

  • Route handler(request, reply) signature changed
  • server.route({}), can keep routes in one place while config and handler in separate module. validation is configurable, state (cookies)
  • server.table() gives you the active routing table
  • Hapi is a configuration centric framework, set js properties, then it tries to stay out of your way.
  • Hapi is written so the meat of your web application can stay pure, you don’t have to deal with the HTTP mechanisms unless you need to for a special case. This leads to clean code which is more focused on your business logic and less on how to deliver via HTTP.
  • Helpers can abstract out functionality used in many places like looking up a user profile or users shopping cart
  • Caching is changed in 2.0, dropping support for full page caching. You can still configure the client cache headers and expiry but the team removed the page cache since they didn’t want to have a half baked solution, one that didn’t handle all the variety of use cases.
  • They still have great support for helper caching which is more straight forward.
  • Eran said they will possibly add page caching back in later or I’d expect there to be a basic plugin which provides a basic page cache solving the simple use cases.
  • Route prerequesites clean up async handling, can specify arrays for parallel followed by single tasks which are processed serially and any combintion.
  • handler.bind can be used to share state using object methods
  • reply().hold(), later calling send() when ready
  • Cookie ttl configuration can now be done in a central location cleaninpu up the route config
  • Exentensive cookie functionality - automatically encoding in base64 json or even using encryption, hashing, and expiration with Eran’s Iron container

Plugins

  • Plugins are a cornerstone of Hapi. These differ from something like Express in that plugins are just groupings of server functionality that can be mixed together into servers. You can organize a feature’s functionality, its routes, its configuration, and dependencies. This lives like a normal node.js package and only needs a register method to use with Hapi. These can be developed, versioned separately, mixed in to the server.
  • Hapi ensures that once they are all registered that the routes are all valid and nothing conflicts, its a large team’s dream. Easy to test new veerions.
  • Plugins can do everything you can do with the server, add routes, helpers, etc.
  • plugin.composer or command line option to hapi allows you to build a server with simply a package.json and a config.json specifying plugins to use.
  • If you couple plugins along with Hapi’s Confidence module you can have one setup which can provide server config for all your various environments.
  • The Confidence module provides dynamic configs which can be used for server environments or even runtime use for A/B testing
  • Plugin cache is now scoped so its data won’t collide with other plugins

Authorization

  • Authorization is now properly extracted into schemes and strategies, basic auth, hawk, etc. It is much easier to setup authentication and you have options to make authentication required and optional.
  • Hapi has defined life cycle extension points at which you can register to have your code called during request life cycle. For instance you could hook in at the beginning of the request, before auth, after auth, before response, etc.
  • These extensions can specify dependencies and whether they need to go before or after others.
  • One change to how the signature for these extensions is that they now have two params (request and reply) just like handlers. You can call the reply(null) to continue response unchanged. Website docs don’t reflect this yet, so look at the code or tests.
  • You can now do additional things for streamed responses in your extensions like set headers as well as peek into the packets being sent back

Ops

  • New ops functionality
    • Can have server load and memory use logged for easy server health montioring
    • Configure max input size, timeouts for client and server
    • You can register tail methods which run after a response has been sent
    • server.inject allows you to use the hapi stack without going through the network stack, great for testing and even for production use if you need to call back in like with OAuth 2.0
    • There is now a simulate property for simulating connection close issues

Postmile example app

  • github.com/hueniverse/postmile - large sample app which has been upgraded to Hapi 2.0. It is a collaborative list making tool using hapi 2.0 and Mongo.

Major breaking changes

  • handler(request, reply), extensions have similar signature
  • methods that had many aliases are now simplified like server.route
  • page caching removed for now
  • route prerequisites now use arrays to designate parallel tasks, and you can mix serial and parallel
  • read up on the new auth configuration and mechanisms
  • https://github.com/spumko/hapi/issues/1178 - github issue with all the Hapi 2.0 breaking changes

Resources

Summary

So in summary, Hapi 2.0 is a well thought out release which cleans up and solidifies the codebase while adding some key functionality that can be built on.

With Walmart putting this framework through the paces and other companies following in its footsteps like the company I am consulting to MasterCard, this framework has evolved with clarity, performance, team usability, and has great deploy and ops support.

Furthermore, Eran and his team have proved that Hapi can handle Black Friday load with ultimate grace, and this new version solidifies its position among Node web frameworks.

So I encourage you to check out Hapi, and let me know what you think. Head over to codewinds.com and leave me a comment or send me a tweet.

Feb 01 2014

21mins

Play

001 Daniel Shaw interview discussing The Node Firm's public Node.js training courses

Podcast cover
Read more

I had the pleasure of interviewing Daniel Shaw (@dshaw), managing partner and CEO of The Node Firm to discuss their upcoming public Node.js training courses at Joyent and beyond.

Episode Info

  • Episode: CW 001
  • Published: September 17th, 2013
  • Tags: nodejs
  • Duration: 23:59

Episode Notes

The Node Firm has been doing corporate training since 2011, but now is offering some public courses starting in October 2013.

The Node Firm public training courses at Joyent in San Francisco, CA:

Discussed in the 24 minute interview:

  • Background on The Node Firm
  • Description of the two courses
    • Topics covered
    • Intended audience
    • Prerequisites
    • Instructors, maximum class size
    • Course style

More information

Sep 17 2013

23mins

Play