Slide 1

Slide 1 text

@stefannhs Taming huge enterprise applications with Mono repos, Design Systems & Web Components Stefan nieuwenhuis

Slide 2

Slide 2 text

@stefannhs Taming huge enterprise applications with Mono repos, Design Systems & Web Components Software Engineer Archaeology Waterpolo Stefan Nieuwenhuis Skydiving Books Developer Avocado

Slide 3

Slide 3 text

@stefannhs 1999 - bol.com launch > 2000 - new categories 2011 - retail platform 2013 - €1 bln. turnover

Slide 4

Slide 4 text

@stefannhs Monolith Architecture Server side app User Interface Database

Slide 5

Slide 5 text

@stefannhs Performance Less cross cutting concerns Planning & Design Less operational overhead Security

Slide 6

Slide 6 text

@stefannhs Performance Less cross cutting concerns Planning & Design Less operational overhead Security

Slide 7

Slide 7 text

@stefannhs Microservices

Slide 8

Slide 8 text

@stefannhs Transparency Independency Scalability

Slide 9

Slide 9 text

@stefannhs Transparency Independency Scalability Consistency

Slide 10

Slide 10 text

@stefannhs Design System

Slide 11

Slide 11 text

@stefannhs Pattern Library

Slide 12

Slide 12 text

@stefannhs // Corporate colors $palette-blue-main: rgb(051,102,204) !default; $palette-blue-dark: rgb(014,052,144) !default; $palette-blue-light: rgb(058,125,231) !default; $palette-blue-hover: rgb(245,247,252) !default; // Secondary colors $palette-red-main: rgb(248,087,105) !default; $palette-orange-main: rgb(251,120,093) !default; $palette-yellow-main: rgb(255,162,078) !default; $palette-lime-main: rgb(150,210,113) !default; $palette-green-main: rgb(051,204,131) !default; Style guide

Slide 13

Slide 13 text

@stefannhs

Slide 14

Slide 14 text

@stefannhs

Slide 15

Slide 15 text

@stefannhs // Create an ES6 class which extends HTMLElement class AwesomeButtonComponent extends HTMLElement { … } // Register our awesome button component to the Custom Elements Registry customElements.define(‘my-awesome-button’, AwesomeButtonComponent); // Example usage in your app: Custom Elements API

Slide 16

Slide 16 text

@stefannhs Click me HTML Templates API

Slide 17

Slide 17 text

@stefannhs Shadow DOM

Slide 18

Slide 18 text

@stefannhs // export class Animal export class Animal { constructor(name) { this.name = name; } greet() { return `Hello, my name is ${this.name}!`; } } ES Modules API // import class Animal import {Animal} from './lib-class-example.js'; const animal = new Animal('Mr. Mittens'); const name = animal.greet(); // --> Hello, my name is Mr. Mittens!;

Slide 19

Slide 19 text

@stefannhs Consistency No framework lock-in Flexible Interoperable Development speed Browser support

Slide 20

Slide 20 text

@stefannhs

My Awesome button

This button is made possible w/ Web Components!

Click me

Slide 21

Slide 21 text

@stefannhs button { border: 2px solid red; border-radius: 5px; background: tomato; padding: 10px; color: white; font-weight: bold; text-transform: uppercase; cursor: pointer; }

Slide 22

Slide 22 text

@stefannhs class MyButtonElement extends HTMLElement { constructor() { super(); const template = document.getElementById('myButton'); // Shadow DOM this.attachShadow({ mode: 'open' }); this.shadowRoot.appendChild( template.content.cloneNode(true)); } }

Slide 23

Slide 23 text

@stefannhs class MyButtonElement extends HTMLElement { constructor() { super(); const template = document.getElementById('myButton'); // Shadow DOM this.attachShadow({ mode: 'open' }); this.shadowRoot.appendChild( template.content.cloneNode(true)); } } // Define Custom Element customElements.define('my-button', MyButtonElement);

Slide 24

Slide 24 text

@stefannhs

My Awesome button

This button is made possible w/ Web Components!

Click me

Slide 25

Slide 25 text

@stefannhs Compatibility Easy API Performance Future-proof

Slide 26

Slide 26 text

@stefannhs npm init stencil

Slide 27

Slide 27 text

@stefannhs // Stencil controller import { Component, Prop } from '@stencil/core'; @Component({ tag: 'my-component', styleUrl: 'my-component.css', shadow: true }) export class MyComponent { render() { return
Hello world!
; } }

Slide 28

Slide 28 text

@stefannhs // Stencil controller import { Component, Prop } from '@stencil/core'; @Component({ tag: 'my-button', styleUrl: 'my-button.css', shadow: true }) export class MyButtonElement { render() { return ; } }

Slide 29

Slide 29 text

@stefannhs npm run build

Slide 30

Slide 30 text

@stefannhs ...

My Awesome button

This button is made possible w/ Web Components!

Click me

Slide 31

Slide 31 text

@stefannhs Extensive config Auto docs generation Bundling Dev Server Typed components Plugins Polyfills

Slide 32

Slide 32 text

@stefannhs Mono Repository

Slide 33

Slide 33 text

@stefannhs One single source of truth Reusability Versioning Scalable Experience

Slide 34

Slide 34 text

@stefannhs

Slide 35

Slide 35 text

@stefannhs { "name": "@awesome-components-lib/buttons", "version": "5.0.1", "description": "Button Component", ... } { "name": "@awesome-components-lib/footer", "version": "1.0.0", "description": "Footer Component", ... } Semantic Versioning No interdependencies Scoped packages

Slide 36

Slide 36 text

@stefannhs

Slide 37

Slide 37 text

@stefannhs Design System Holy Grail of Consistency

Slide 38

Slide 38 text

@stefannhs Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY DM’s are open! @stefannhs