30
JavaScript Build System Battle Royale!!!!

JavaScript Build System Battle Royale | PrDC 2017

Embed Size (px)

Citation preview

Page 1: JavaScript Build System Battle Royale | PrDC 2017

JavaScript Build System Battle Royale!!!!

Page 2: JavaScript Build System Battle Royale | PrDC 2017

JavaScript Build System Battle

Royale!!!!@davidwesst

Prairie Dev Con 2017 – Winnipeg, MB

Page 3: JavaScript Build System Battle Royale | PrDC 2017

Tournament Background

• What is the problem?

• JavaScript always has a lot of flavors of everything

• What we are going to do?

• Review 5 JS build systems and see which ones stand out, and which one is the conference champion

Page 4: JavaScript Build System Battle Royale | PrDC 2017

What is a JavaScript Build System

• A tool that takes web platform code (HTML, JavaScript, CSS) and turns it into an optimized program by executing a series of steps defined by the development team

Page 5: JavaScript Build System Battle Royale | PrDC 2017

Challenge

• 1 "Small" Web Project

• HTML

• ES6 JavaScript

• Sass

• Must "complete" the development story

• Source maps

• Serve & Watch for changes

Page 6: JavaScript Build System Battle Royale | PrDC 2017

Fighter Qualification

• Must be cross-platform

• Must support the "web platform"

• Must be configurable by developer (I.e. tasks, rules, etc...)

• Tool repository or product must be "active"

• I.e. commits still happening to the repo

• Updates still happening to the product

Page 7: JavaScript Build System Battle Royale | PrDC 2017

Fighter Classes

• Two Classes

• Task Runners

• Bundlers

Page 8: JavaScript Build System Battle Royale | PrDC 2017

Our Fighters

Page 9: JavaScript Build System Battle Royale | PrDC 2017

Broccoli

Class Task Runner

Version 1.12

Current Version

1.12

URL http://broccolijs.com/

Open Source

YES

Page 10: JavaScript Build System Battle Royale | PrDC 2017

Grunt

Class Task Runner

Version 1.01

Current Version

1.01

URL https://gruntjs.com/

Open Source

YES

Page 11: JavaScript Build System Battle Royale | PrDC 2017

Gulp

Class Task Runner

Version 3.91

Current Version

3.91

URL http://gulpjs.com/

Open Source

YES

Page 12: JavaScript Build System Battle Royale | PrDC 2017

NPM / Vanilla Node

Class Task Runner

Version 4.x

Current Version

5.03

URLhttps://www.npmjs.com/

Open Source

YES

Page 13: JavaScript Build System Battle Royale | PrDC 2017

Webpack

Class Bundler

Version 2.5.1

Current Version

2.6.1 / 3.0.0.rc0

URL https://webpack.js.org/

Open Source

YES

Page 14: JavaScript Build System Battle Royale | PrDC 2017

Did Not Qualify

Page 15: JavaScript Build System Battle Royale | PrDC 2017
Page 16: JavaScript Build System Battle Royale | PrDC 2017

Scoring Criteria

Me

• API Simplicity

• Support / Documentation

• Plugin Library

• Project Impact

• Performance

Audience

• Show of hands and feedback

Page 17: JavaScript Build System Battle Royale | PrDC 2017

FIGHT!

http://bit.ly/prdc2017

Page 18: JavaScript Build System Battle Royale | PrDC 2017

Fight Breakdown

• JavaScript

• ESLint

• Babel Transpilation

• Generate Source Maps

• CSS

• Transpile Sass to CSS

• Generate Source Maps

• HTML

• Copy files

• e.g. -- npm run build:gulp

Build

Page 19: JavaScript Build System Battle Royale | PrDC 2017

Fight Breakdown

• Start Development Web Server

• Watch for Changes

• e.g. -- npm run serve:gulp

Serve

Page 20: JavaScript Build System Battle Royale | PrDC 2017

Fight Results

Page 21: JavaScript Build System Battle Royale | PrDC 2017

Broccoli

• Very abstracted away from tasks

• Okay documentation

• Strong plugin

• Requires broccoli

• Great performance

Page 22: JavaScript Build System Battle Royale | PrDC 2017

Grunt

• Configuration API

• Good

• Large Plugin Library

• Requires Gruntfile

• Good performarce

Page 23: JavaScript Build System Battle Royale | PrDC 2017

Gulp

• Straightforward API, with JavaScript

• Solid documentation

• Very strong plugin library

• Requires gulpfile.js

• Good performarce

Page 24: JavaScript Build System Battle Royale | PrDC 2017

NPM / Vanilla Node

• Pure JavaScript

• Very good, although depends on the plugins

• Massive Plugin Library

• Requires package.json and script files

• Good performarce

Page 25: JavaScript Build System Battle Royale | PrDC 2017

Webpack

• Configuration File

• Good documentation, but needs further refinement

• Very large “plugin” library

• Requires webpack.config.js

• Good performarce

Page 26: JavaScript Build System Battle Royale | PrDC 2017

…and the winner is<insert drumroll here>

Page 27: JavaScript Build System Battle Royale | PrDC 2017

Winner

Page 28: JavaScript Build System Battle Royale | PrDC 2017

Runner Up

Page 29: JavaScript Build System Battle Royale | PrDC 2017

Q & A

Page 30: JavaScript Build System Battle Royale | PrDC 2017

Thanks

• David Wesst

• @davidwesst

• westerndevs.com

• davidwesst.com