Slide 1

Slide 1 text

Automating UI Development Angular Connect 2018 @ddprrt @Ka_TriN_F

Slide 2

Slide 2 text

Slide about us Katrin Freihofner
 @Ka_TriN_F devone.at

Slide 3

Slide 3 text

Slide about us Stefan Baumgartner
 @ddprrt javascript-podcast.com

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

expert groups

Slide 8

Slide 8 text

Highly specialised screens … with lots of generic, flexible components

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Git Design System update Symbols library

Slide 19

Slide 19 text

Git Design System update Symbols library

Slide 20

Slide 20 text

Design System update

Slide 21

Slide 21 text

Design System update

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

You might wonder …how will this affect the product?

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

Initial idea

Slide 26

Slide 26 text

UX + design Initial idea

Slide 27

Slide 27 text

UX + design Initial idea Sketch lib

Slide 28

Slide 28 text

UX + design Initial idea Angular component lib Product code Sketch lib

Slide 29

Slide 29 text

UX + design Initial idea Angular component lib Product code Sketch lib Barista Design System

Slide 30

Slide 30 text

UX + design Initial idea Angular component lib Product code Sketch lib Barista Design System

Slide 31

Slide 31 text

UX + design Initial idea Angular component lib Product code Sketch lib Barista Design System

Slide 32

Slide 32 text

UX + design Initial idea Angular component lib Product code Sketch lib Barista Design System

Slide 33

Slide 33 text

UX + design Initial idea Angular component lib Product code Sketch lib Barista Design System

Slide 34

Slide 34 text

UX + design Initial idea Angular component lib Product code Sketch lib Barista Design System

Slide 35

Slide 35 text

UX + design Initial idea Angular component lib Product code Sketch lib Barista Design System

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

Angular component lib

Slide 40

Slide 40 text

Barista Design System Product code Angular component lib

Slide 41

Slide 41 text

Barista Design System Product code ? Angular component lib

Slide 42

Slide 42 text

Barista Design System Product code UX + design Sketch lib Angular component lib

Slide 43

Slide 43 text

Transform Angular to Sketch Angular library Sketch library ?

Slide 44

Slide 44 text

.sketch is bunch of JSON files library.sketch ʮ pages ʮ D91775B4-2C6C-4FCC-9209-6D8C930B9013.json ʮ document.json ʮ meta.json ʮ user.json

Slide 45

Slide 45 text

.sketch is bunch of JSON files library.sketch ʮ pages ʮ D91775B4-2C6C-4FCC-9209-6D8C930B9013.json ʮ document.json ʮ meta.json ʮ user.json We can hack that!

Slide 46

Slide 46 text

CSS equivalents in .sketch JSON button { width: 122px; height: 32px; background-color: #00f; } ShapeGroup: { frame: {x: 0, y: 0, width: 122, height: 32} layers: [ ShapePath: { points: [‘{0,0}’,‘{0,1}’,‘{1,1}’,‘{1,0}’] } ], style: { fills: [ color: { red: 0, green: 0, blue: 1, alpha: 1 } ] } }

Slide 47

Slide 47 text

CSS equivalents in .sketch JSON button { width: 122px; height: 32px; background-color: #00f; } ShapeGroup: { frame: {x: 0, y: 0, width: 122, height: 32} layers: [ ShapePath: { points: [‘{0,0}’,‘{0,1}’,‘{1,1}’,‘{1,0}’] } ], style: { fills: [ color: { red: 0, green: 0, blue: 1, alpha: 1 } ] } }

Slide 48

Slide 48 text

{ "_class": "page", "do_objectID": "6224EB85-9573-4D33-BEE5-C57F892B94E4", "exportOptions": { "_class": "exportOptions", "exportFormats": [], "includedLayerIds": [], "layerOptions": 0, "shouldTrim": false }, "frame": { "_class": "rect", "constrainProportions": false, "height": 300, "width": 300, "x": 0, "y": 0 }, "isFlippedHorizontal": false, CSS equivalents in .sketch JSON button { width: 122px; height: 32px; background-color: #00f; }

Slide 49

Slide 49 text

CSS equivalents in .sketch JSON button { width: 122px; height: 32px; background-color: #00f; }

Slide 50

Slide 50 text

parsable properties export class StyleDeclaration { borderTop = '0px none rgb(0, 0, 0)’; borderLeft = '0px none rgb(0, 0, 0)’; borderBottom = '0px none rgb(0, 0, 0)'; borderRight = '0px none rgb(0, 0, 0)'; borderColor = 'rgb(0, 0, 0)'; borderTopLeftRadius = '0px'; borderTopRightRadius = '0px'; borderBottomRightRadius = '0px'; borderBottomLeftRadius = '0px'; borderWidth = '0px'; boxShadow = 'none'; padding = '0px'; backgroundImage = ‘none'; backgroundColor = 'rgba(0, 0, 0, 0)’; color = 'rgb(0, 0, 0)'; fill = 'rgb(0, 0, 0)’; strokeWidth = '1px'; fontFamily = 'Helvetica Neue'; fontSize = '16px'; fontStyle = 'normal'; fontWeight = '400'; letterSpacing = ‘normal'; whiteSpace = ‘normal'; lineHeight = 'normal'; textDecoration = 'none solid rgb(0, 0, 0)'; textAlign = 'start'; textTransform = 'none'; transform = 'none'; opacity = ‘1'; display = ‘block'; visibility = 'visible'; }

Slide 51

Slide 51 text

parsable properties export class StyleDeclaration { borderTop = '0px none rgb(0, 0, 0)’; borderLeft = '0px none rgb(0, 0, 0)’; borderBottom = '0px none rgb(0, 0, 0)'; borderRight = '0px none rgb(0, 0, 0)'; borderColor = 'rgb(0, 0, 0)'; borderTopLeftRadius = '0px'; borderTopRightRadius = '0px'; borderBottomRightRadius = '0px'; borderBottomLeftRadius = '0px'; borderWidth = '0px'; boxShadow = 'none'; padding = '0px'; backgroundImage = ‘none'; backgroundColor = 'rgba(0, 0, 0, 0)’; color = 'rgb(0, 0, 0)'; fill = 'rgb(0, 0, 0)’; strokeWidth = '1px'; fontFamily = 'Helvetica Neue'; fontSize = '16px'; fontStyle = 'normal'; fontWeight = '400'; letterSpacing = ‘normal'; whiteSpace = ‘normal'; lineHeight = 'normal'; textDecoration = 'none solid rgb(0, 0, 0)'; textAlign = 'start'; textTransform = 'none'; transform = 'none'; opacity = ‘1'; display = ‘block'; visibility = 'visible'; }

Slide 52

Slide 52 text

parsable properties export class StyleDeclaration { borderTop = '0px none rgb(0, 0, 0)’; borderLeft = '0px none rgb(0, 0, 0)’; borderBottom = '0px none rgb(0, 0, 0)'; borderRight = '0px none rgb(0, 0, 0)'; borderColor = 'rgb(0, 0, 0)'; borderTopLeftRadius = '0px'; borderTopRightRadius = '0px'; borderBottomRightRadius = '0px'; borderBottomLeftRadius = '0px'; borderWidth = '0px'; boxShadow = 'none'; padding = '0px'; backgroundImage = ‘none'; backgroundColor = 'rgba(0, 0, 0, 0)’; color = 'rgb(0, 0, 0)'; fill = 'rgb(0, 0, 0)’; strokeWidth = '1px'; fontFamily = 'Helvetica Neue'; fontSize = '16px'; fontStyle = 'normal'; fontWeight = '400'; letterSpacing = ‘normal'; whiteSpace = ‘normal'; lineHeight = 'normal'; textDecoration = 'none solid rgb(0, 0, 0)'; textAlign = 'start'; textTransform = 'none'; transform = 'none'; opacity = ‘1'; display = ‘block'; visibility = 'visible'; }

Slide 53

Slide 53 text

parsable properties export class StyleDeclaration { borderTop = '0px none rgb(0, 0, 0)’; borderLeft = '0px none rgb(0, 0, 0)’; borderBottom = '0px none rgb(0, 0, 0)'; borderRight = '0px none rgb(0, 0, 0)'; borderColor = 'rgb(0, 0, 0)'; borderTopLeftRadius = '0px'; borderTopRightRadius = '0px'; borderBottomRightRadius = '0px'; borderBottomLeftRadius = '0px'; borderWidth = '0px'; boxShadow = 'none'; padding = '0px'; backgroundImage = ‘none'; backgroundColor = 'rgba(0, 0, 0, 0)’; color = 'rgb(0, 0, 0)'; fill = 'rgb(0, 0, 0)’; strokeWidth = '1px'; fontFamily = 'Helvetica Neue'; fontSize = '16px'; fontStyle = 'normal'; fontWeight = '400'; letterSpacing = ‘normal'; whiteSpace = ‘normal'; lineHeight = 'normal'; textDecoration = 'none solid rgb(0, 0, 0)'; textAlign = 'start'; textTransform = 'none'; transform = 'none'; opacity = ‘1'; display = ‘block'; visibility = 'visible'; }

Slide 54

Slide 54 text

parsable properties export class StyleDeclaration { borderTop = '0px none rgb(0, 0, 0)’; borderLeft = '0px none rgb(0, 0, 0)’; borderBottom = '0px none rgb(0, 0, 0)'; borderRight = '0px none rgb(0, 0, 0)'; borderColor = 'rgb(0, 0, 0)'; borderTopLeftRadius = '0px'; borderTopRightRadius = '0px'; borderBottomRightRadius = '0px'; borderBottomLeftRadius = '0px'; borderWidth = '0px'; boxShadow = 'none'; padding = '0px'; backgroundImage = ‘none'; backgroundColor = 'rgba(0, 0, 0, 0)’; color = 'rgb(0, 0, 0)'; fill = 'rgb(0, 0, 0)’; strokeWidth = '1px'; fontFamily = 'Helvetica Neue'; fontSize = '16px'; fontStyle = 'normal'; fontWeight = '400'; letterSpacing = ‘normal'; whiteSpace = ‘normal'; lineHeight = 'normal'; textDecoration = 'none solid rgb(0, 0, 0)'; textAlign = 'start'; textTransform = 'none'; transform = 'none'; opacity = ‘1'; display = ‘block'; visibility = 'visible'; }

Slide 55

Slide 55 text

parsable properties export class StyleDeclaration { borderTop = '0px none rgb(0, 0, 0)’; borderLeft = '0px none rgb(0, 0, 0)’; borderBottom = '0px none rgb(0, 0, 0)'; borderRight = '0px none rgb(0, 0, 0)'; borderColor = 'rgb(0, 0, 0)'; borderTopLeftRadius = '0px'; borderTopRightRadius = '0px'; borderBottomRightRadius = '0px'; borderBottomLeftRadius = '0px'; borderWidth = '0px'; boxShadow = 'none'; padding = '0px'; backgroundImage = ‘none'; backgroundColor = 'rgba(0, 0, 0, 0)’; color = 'rgb(0, 0, 0)'; fill = 'rgb(0, 0, 0)’; strokeWidth = '1px'; fontFamily = 'Helvetica Neue'; fontSize = '16px'; fontStyle = 'normal'; fontWeight = '400'; letterSpacing = ‘normal'; whiteSpace = ‘normal'; lineHeight = 'normal'; textDecoration = 'none solid rgb(0, 0, 0)'; textAlign = 'start'; textTransform = 'none'; transform = 'none'; opacity = ‘1'; display = ‘block'; visibility = 'visible'; }

Slide 56

Slide 56 text

parsable properties export class StyleDeclaration { borderTop = '0px none rgb(0, 0, 0)’; borderLeft = '0px none rgb(0, 0, 0)’; borderBottom = '0px none rgb(0, 0, 0)'; borderRight = '0px none rgb(0, 0, 0)'; borderColor = 'rgb(0, 0, 0)'; borderTopLeftRadius = '0px'; borderTopRightRadius = '0px'; borderBottomRightRadius = '0px'; borderBottomLeftRadius = '0px'; borderWidth = '0px'; boxShadow = 'none'; padding = '0px'; backgroundImage = ‘none'; backgroundColor = 'rgba(0, 0, 0, 0)’; color = 'rgb(0, 0, 0)'; fill = 'rgb(0, 0, 0)’; strokeWidth = '1px'; fontFamily = 'Helvetica Neue'; fontSize = '16px'; fontStyle = 'normal'; fontWeight = '400'; letterSpacing = ‘normal'; whiteSpace = ‘normal'; lineHeight = 'normal'; textDecoration = 'none solid rgb(0, 0, 0)'; textAlign = 'start'; textTransform = 'none'; transform = 'none'; opacity = ‘1'; display = ‘block'; visibility = 'visible'; }

Slide 57

Slide 57 text

export class StyleDeclaration { borderTop = '0px none rgb(0, 0, 0)’; borderLeft = '0px none rgb(0, 0, 0)’; borderBottom = '0px none rgb(0, 0, 0)'; borderRight = '0px none rgb(0, 0, 0)'; borderColor = 'rgb(0, 0, 0)'; borderTopLeftRadius = '0px'; borderTopRightRadius = '0px'; borderBottomRightRadius = '0px'; borderBottomLeftRadius = '0px'; borderWidth = '0px'; boxShadow = 'none'; padding = '0px'; backgroundImage = ‘none'; backgroundColor = 'rgba(0, 0, 0, 0)’; color = 'rgb(0, 0, 0)'; fill = 'rgb(0, 0, 0)’; strokeWidth = '1px'; fontFamily = 'Helvetica Neue'; fontSize = '16px'; fontStyle = 'normal'; fontWeight = '400'; letterSpacing = ‘normal'; whiteSpace = ‘normal'; lineHeight = 'normal'; textDecoration = 'none solid rgb(0, 0, 0)'; textAlign = 'start'; textTransform = 'none'; transform = 'none'; opacity = ‘1'; display = ‘block'; visibility = 'visible'; } “browser stylesheet”

Slide 58

Slide 58 text

CSS+HTML to Sketch + CSSStyleDeclaration
+ CSSStyleDeclaration

+ CSSStyleDeclaration … … "frame": { "_class": "rect", "constrainProportions": false, "height": 44, "width": 764, "x": 0, "y": 0 }, … .json

Slide 59

Slide 59 text

Transform Angular to Sketch Angular library Sketch library ? CSSDecl json Sketch Generator

Slide 60

Slide 60 text

Generate CSS Declaration files CSS scraper

Slide 61

Slide 61 text

Generate CSS Declaration files CSS scraper

Slide 62

Slide 62 text

Generate CSS Declaration files CSS scraper

Slide 63

Slide 63 text

Generate CSS Declaration files CSS scraper ➡ getComputedStyle()

Slide 64

Slide 64 text

Generate CSS Declaration files CSS scraper ➡ getComputedStyle() ➡ getBoundingClientRect()

Slide 65

Slide 65 text

Generate CSS Declaration files CSS scraper ➡ getComputedStyle() ➡ getBoundingClientRect()

Slide 66

Slide 66 text

Generate CSS Declaration files CSS scraper ➡ getComputedStyle() ➡ getBoundingClientRect()
➡ getComputedStyle() ➡ getBoundingClientRect()

Slide 67

Slide 67 text

Generate CSS Declaration files CSS scraper ➡ getComputedStyle() ➡ getBoundingClientRect()
➡ getComputedStyle() ➡ getBoundingClientRect()

➡ getComputedStyle() ➡ getBoundingClientRect() …

Slide 68

Slide 68 text

Generate CSS Declaration files CSS scraper ➡ getComputedStyle() ➡ getBoundingClientRect()
➡ getComputedStyle() ➡ getBoundingClientRect()

➡ getComputedStyle() ➡ getBoundingClientRect() …

+ CSSStyleDeclaration
+ CSSStyleDeclaration

+ CSSStyleDeclaration …

Slide 69

Slide 69 text

Generate CSS Declaration files CSS scraper ➡ getComputedStyle() ➡ getBoundingClientRect()
➡ getComputedStyle() ➡ getBoundingClientRect()

➡ getComputedStyle() ➡ getBoundingClientRect() …

Slide 70

Slide 70 text

Generate CSS Declaration files CSS scraper

Slide 71

Slide 71 text

Generate CSS Declaration files CSS scraper update!

Slide 72

Slide 72 text

Generate CSS Declaration files CSS scraper update!

Slide 73

Slide 73 text

Generate CSS Declaration files CSS scraper update!

Slide 74

Slide 74 text

Transform angular to sketch Angular library Sketch library ? CSSDecl json Sketch Generator App CSS scraper

Slide 75

Slide 75 text

Parsing component code Angular component lib

Slide 76

Slide 76 text

TS Parsing component code Angular component lib Parses AST

Slide 77

Slide 77 text

A ‘pure’ example and component variants TS Angular component lib Parses AST

Slide 78

Slide 78 text

A ‘pure’ example and component variants TS Angular component lib examples

Slide 79

Slide 79 text

A ‘pure’ example and component variants TS Angular component lib @Component({ moduleId: module.id, template: `Simple button`, }) export class ButtonPureExampleComponent { } examples

Slide 80

Slide 80 text

A ‘pure’ example and component variants TS Angular component lib @Component({ moduleId: module.id, template: `Simple button`, }) export class ButtonPureExampleComponent { } examples

Slide 81

Slide 81 text

A ‘pure’ example and component variants TS Angular component lib @Component({ moduleId: module.id, template: `Simple button`, }) export class ButtonPureExampleComponent { } examples variants

Slide 82

Slide 82 text

A ‘pure’ example and component variants TS Angular component lib @Component({ moduleId: module.id, template: `Simple button`, }) export class ButtonPureExampleComponent { } @Component({ selector: `button[dt-button], button[dt-icon-button]`, templateUrl: 'button.html', }) export class DtButton extends … { @Input() get variant(): ‘primary’ | ‘secondary’ { return this._variant; } } examples variants

Slide 83

Slide 83 text

A ‘pure’ example and component variants TS Angular component lib @Component({ moduleId: module.id, template: `Simple button`, }) export class ButtonPureExampleComponent { } @Component({ selector: `button[dt-button], button[dt-icon-button]`, templateUrl: 'button.html', }) export class DtButton extends … { @Input() get variant(): ‘primary’ | ‘secondary’ { return this._variant; } } examples variants

Slide 84

Slide 84 text

A ‘pure’ example and component variants TS Angular component lib @Component({ moduleId: module.id, template: `Simple button`, }) export class ButtonPureExampleComponent { } @Component({ selector: `button[dt-button], button[dt-icon-button]`, templateUrl: 'button.html', }) export class DtButton extends … { @Input() get variant(): ‘primary’ | ‘secondary’ { return this._variant; } } examples variants

Slide 85

Slide 85 text

A ‘pure’ example and component variants TS Angular component lib @Component({ moduleId: module.id, template: `Simple button`, }) export class ButtonPureExampleComponent { } @Component({ selector: `button[dt-button], button[dt-icon-button]`, templateUrl: 'button.html', }) export class DtButton extends … { @Input() get variant(): ‘primary’ | ‘secondary’ { return this._variant; } } examples variants

Slide 86

Slide 86 text

A ‘pure’ example and component variants TS Angular component lib examples variants

Slide 87

Slide 87 text

A ‘pure’ example and component variants TS Angular component lib examples + variants

Slide 88

Slide 88 text

A ‘pure’ example and component variants TS Angular component lib examples + variants

Slide 89

Slide 89 text

A ‘pure’ example and component variants TS Angular component lib examples + variants

Slide 90

Slide 90 text

A ‘pure’ example and component variants TS Angular component lib examples + variants

Slide 91

Slide 91 text

Transform Angular to Sketch Angular library Sketch library CSSDecl json Sketch Generator App CSS scraper Library App generator

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

UX + design Initial idea Angular component lib Product code Sketch lib Barista Design System

Slide 95

Slide 95 text

Angular component lib Barista Design System Sketch lib Product code UX + design

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

$royalblue-700: #393db0; dt-theme-palette($green-600, $green-700, $green-800),

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

No content

Slide 102

Slide 102 text

Lukas Holzer
 @luka5c0m

Slide 103

Slide 103 text

Katrin Freihofner
 @Ka_TriN_F Stefan Baumgartner
 @ddprrt Office hours
 12:30 - 13:00