Modern Web meetup | Alex Eagle |
---|---|
Angular Tooling team lead |
Image Not Showing
Possible Reasons
|
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>The JavaScript community has gotten into the pattern that every devserver, bundler, or test runner tool has to accept the original program sources as inputs, and that means each tool gradually expands its scope to include a build system.
— Alex 🦅 Eagle (@Jakeherringbone) February 7, 2019
Slide deck w/o images, so watch me draw!
user facing | code processing |
---|---|
you run it in your workflow | it processes specific source files |
e.g. dev server | e.g. language compiler |
What are some other examples?
Number of plugins needed is O(M×N)
Bundler like Webpack needs to transpile your TypeScript code
Test runner like Cypress needs to transpile your TypeScript code
Obvious:
What if you want to write a new CSS preprocessor?
Need to write a plugin for every workflow tool 🤷
What if you want to write a new test runner?
Need to write a plugin for every code transform tool 🤷♂️
It's hard for an enterprise to depend on
Who supports the end-to-end? Language team? Bundler team? Plugin author?
Number of plugins needed is O(M+N)
Okay, there might be 2-3 popular "wheels" so O(c(M+N))
The wheel model allows good layering
Those followed the wheel model
What was wrong with Gulp?
Wrong abstraction?
What if multiple sets of files are produced?
var gulp = require('gulp');
var ts = require('gulp-typescript');
var merge = require('merge2');
gulp.task('scripts', function() {
var tsResult = gulp.src('lib/**/*.ts')
.pipe(ts({
declaration: true
}));
return merge([
tsResult.dts.pipe(gulp.dest('release/definitions')),
tsResult.js.pipe(gulp.dest('release/js'))
]);
});
Plugins have an API like a message bus
Loosely coupled, but richer than file streams
TypeScript plugin could produce different outputs depending whether it's connected to a
Bazel is getting some adoption, starting with Node.js backend systems.
Planning a 1.0 release this summer.
We are pioneering its use in Angular.
Thanks!
Alex Eagle | @jakeherringbone |
---|---|
http://g.co/ng/abc |