Slide 1

Slide 1 text

Web Components: The Future of Web Applications Ire Aderinokun I/O Extended Lagos

Slide 2

Slide 2 text

Hello! • Ire Aderinokun • Frontend Developer and User Interface Designer • Google Expert in Web Technologies • Writer, bitsofco.de • Software Developer at eyeo

Slide 3

Slide 3 text

Building Applications on the Web is Hard

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Android

Slide 6

Slide 6 text

iOS UITabBar UITabBarController

Slide 7

Slide 7 text

Web

Slide 8

Slide 8 text

This is because the Web is an open platform

Slide 9

Slide 9 text

Building Blocks of the Web

Slide 10

Slide 10 text

Early Websites

Slide 11

Slide 11 text

Websites Today

Slide 12

Slide 12 text

But Web Technologies are getting better

Slide 13

Slide 13 text

The Solution is Web Components!

Slide 14

Slide 14 text

Web Components are a set of new web platform features that let you create your own HTML elements

Slide 15

Slide 15 text

Slide 16

Slide 16 text

Encapsulated & Reusable

Slide 17

Slide 17 text

1B+ mobile devices natively support Web Components, right now!

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

What is the Polymer Project?

Slide 20

Slide 20 text

– The Polymer Team “Our mission is to make life better for users and developers, by helping developers unlock the web platform’s full potential and by spurring the web platform to evolve and improve.”

Slide 21

Slide 21 text

The Polymer Project is a look into the future of web development

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

1. Polymer Library

Slide 24

Slide 24 text

The Polymer Library is a Javascript Library that helps you create custom reusable HTML elements, and use them to build performant, maintainable apps

Slide 25

Slide 25 text

Why use the Polymer Library?

Slide 26

Slide 26 text

Polymer 2.0 ! Improved Interoperability Data System Improvements Uses Native APIs Polymer CLI

Slide 27

Slide 27 text

2. Elements

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

3. PRPL

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

4. App Toolbox

Slide 35

Slide 35 text

Polymer App Toolbox is a collection of components, tools and templates for building Progressive Web Apps with Polymer

Slide 36

Slide 36 text

Features • Component-based architecture using Polymer • Routing using the elements • Offline caching using Service Workers • Build tooling to support delivery over HTTP/1 or HTTP/2

Slide 37

Slide 37 text

5. Tooling

Slide 38

Slide 38 text

Polymer CLI

Slide 39

Slide 39 text

Commands • polymer init • polymer serve • polymer lint • polymer test • polymer build • polymer analyze

Slide 40

Slide 40 text

polymer init

Slide 41

Slide 41 text

What can you actually do with Web Components?

Slide 42

Slide 42 text

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

cheese.polymer-project.org

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

How do Web Components work?

Slide 48

Slide 48 text

4 Key Web Technologies HTML Imports Shadow DOM HTML Templates Custom Elements

Slide 49

Slide 49 text

Custom Elements • An API for creating your own HTML elements by creating a Class that extends from HTMLElement • customElements.define()

Slide 50

Slide 50 text

HTML Templates • A mechanism for defining content that can be stored for subsequent use in a document •

Slide 51

Slide 51 text

Shadow DOM • A mechanism for encapsulating a DOM and CSS, so that they can remain separate from the main document • document.body.attachShadow()

Slide 52

Slide 52 text

HTML Imports • A way to package and share HTML files •

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

A Simple Native Web Component

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

Custom Elements API

Slide 58

Slide 58 text

Base HTMLElement Class

Slide 59

Slide 59 text

Shadow DOM

Slide 60

Slide 60 text

Content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

How do Polymer Components Work?

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Import Polymer Library

Slide 66

Slide 66 text

Custom Elements API

Slide 67

Slide 67 text

HTML Template

Slide 68

Slide 68 text

Data Binding

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

Let’s Build a Web Component!

Slide 71

Slide 71 text

Slide 72

Slide 72 text

Join In! 1. Install Polymer CLI • npm install -g polymer-cli 2. Create project directory • mkdir meme-maker && cd meme-maker 3. Create a new Polymer project • polymer init 4. or Clone the final repository • bit.ly/meme-maker-polymer

Slide 73

Slide 73 text

Diving Deeper

Slide 74

Slide 74 text

www.Polymer-Project.org

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

Thank you! Any Questions?