Using Source Maps in 2015
by
Matt Steele
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
SOURCE MAPS
Slide 2
Slide 2 text
IT’S SHOWTIME
Slide 3
Slide 3 text
It’s 2015 Tools Are Complicated
Slide 4
Slide 4 text
Compilers
Slide 5
Slide 5 text
Compilers
Slide 6
Slide 6 text
Compilers
Slide 7
Slide 7 text
Compilers
Slide 8
Slide 8 text
Compilers
Slide 9
Slide 9 text
Transpilers
Slide 10
Slide 10 text
Transpilers
Slide 11
Slide 11 text
Transpilers
Slide 12
Slide 12 text
No content
Slide 13
Slide 13 text
Preprocessors
Slide 14
Slide 14 text
Preprocessors
Slide 15
Slide 15 text
Preprocessors
Slide 16
Slide 16 text
Preprocessors
Slide 17
Slide 17 text
Postprocessors
Slide 18
Slide 18 text
Postprocessors
Slide 19
Slide 19 text
Postprocessors
Slide 20
Slide 20 text
Postprocessors
Slide 21
Slide 21 text
Postprocessors
Slide 22
Slide 22 text
I’LL BE BACK
Slide 23
Slide 23 text
Build Phase
Slide 24
Slide 24 text
Build Phase
Slide 25
Slide 25 text
Build Phase
Slide 26
Slide 26 text
Build Phase
Slide 27
Slide 27 text
Now you have two problems
Slide 28
Slide 28 text
No content
Slide 29
Slide 29 text
DEBUG THIS
Slide 30
Slide 30 text
Source Maps To The Rescue
Slide 31
Slide 31 text
Content Source
Slide 32
Slide 32 text
CSS & JavaScript
Slide 33
Slide 33 text
app.js app.min.js Without Source Maps
Slide 34
Slide 34 text
app.js app.min.js app.min.js.map With Source Maps
Slide 35
Slide 35 text
No content
Slide 36
Slide 36 text
No content
Slide 37
Slide 37 text
No content
Slide 38
Slide 38 text
No content
Slide 39
Slide 39 text
Variable Length Quantity http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
Slide 40
Slide 40 text
It all Just Works
Slide 41
Slide 41 text
Demo
Slide 42
Slide 42 text
Multi-Level Source Maps
Slide 43
Slide 43 text
HASTA LA VISTA, BABY
Slide 44
Slide 44 text
ES6 CoffeeScript TypeScript
Slide 45
Slide 45 text
ES6 CoffeeScript TypeScript Concat
Slide 46
Slide 46 text
ES6 CoffeeScript TypeScript Concat Minify
Slide 47
Slide 47 text
Demo
Slide 48
Slide 48 text
ArnoldC
Slide 49
Slide 49 text
No content
Slide 50
Slide 50 text
IT'S SHOWTIME TALK TO THE HAND "hello world" YOU HAVE BEEN TERMINATED Hello World
Slide 51
Slide 51 text
GET TO THE CHOPPER a HERE IS MY INVITATION 4 GET UP b YOU'RE FIRED 2 ENOUGH TALK a = (4 + b) * 2
Slide 52
Slide 52 text
HEY CHRISTMAS TREE foo YOU SET US UP @I LIED HEY CHRISTMAS TREE bar YOU SET US UP @NO PROBLEMO foo = false bar = true
Slide 53
Slide 53 text
Two Problems
Slide 54
Slide 54 text
1.
Slide 55
Slide 55 text
✓
Slide 56
Slide 56 text
✓ ✗ ✗
Slide 57
Slide 57 text
✓ … ✗ ✗
Slide 58
Slide 58 text
No content
Slide 59
Slide 59 text
No content
Slide 60
Slide 60 text
No content
Slide 61
Slide 61 text
No content
Slide 62
Slide 62 text
No content
Slide 63
Slide 63 text
2.
Slide 64
Slide 64 text
2.
Slide 65
Slide 65 text
So
Slide 66
Slide 66 text
I wrote a compiler
Slide 67
Slide 67 text
arnoldc.js https://github.com/mattdsteele/arnoldc.js
Slide 68
Slide 68 text
Compiles from ArnoldC to JavaScript
Slide 69
Slide 69 text
Compiles from ArnoldC to JavaScript (With Source Maps)
Slide 70
Slide 70 text
DO IT NOW
Slide 71
Slide 71 text
11+ Source Maps
Slide 72
Slide 72 text
1. Upgrade your tools Tips
Slide 73
Slide 73 text
2. Gulp > Grunt (for this) Tips gulp.task('javascript', function() { gulp.src('src/**/*.js') .pipe(sourcemaps.init()) .pipe(plugin1()) .pipe(plugin2()) .pipe(sourcemaps.write()) .pipe(gulp.dest('dist')); });
Slide 74
Slide 74 text
3. Inline your sourcesContent Tips
Slide 75
Slide 75 text
Tips 4. Source Map Visualization Tool http://sokra.github.io/source-map-visualization/
Slide 76
Slide 76 text
@mattdsteele http://steele.blue