#### PhoneGap Day EU 2017 ## Web Components: creating reusable user interface Speaker:
__Masa Tanaka__
__Monaca__ &
__Onsen UI__
## Web Components
_The building blocks of the future web_ * HTML Templates: reusable DOM loadable on demand
Custom Elements: literally custom HTML elements beyond _div_ and _span_
* Shadow DOM: CSS and DOM encapsulation in a component * HTML Imports: packaging mechanism that prevents inlining components
Simple yet Powerful API (v1)
Favorite Star
```
``` ```
★
```
## Pros * Simplicity * Browser native support
## Cons * HTML attributes are only strings * Under development (soon™)
Polyfill
Chrome/Opera
Firefox
Safari
Edge
Templates
✓
Stable
Stable
8
13
HTML Imports
✓
Stable
On Hold
No Active Development
Deciding
Custom Elements
✓
Stable
Flag
10.1
Deciding
Shadow DOM
✓
Stable
Bug
10
Deciding
!==
### Web Components > Polymer Polymer Project is just a library built on top of Web Components that adds extra features. There are more:
* Skate.js * X-Tag
* Slim.js * Onsen UI
UI library to create hybrid & progressive web apps. Features: * Super Simple API - _Web Components_ ❤ * Framework Agnostic - _Web Components_ 💕 * Future Proof - _Web Components_ 💘
## UI Components
```
``` ```
``` ```
Hi there!
Dismiss
```
Tailored API
######
JavaScript ```html
Content
``` ```javascript document.getElementById('myDialog').show(); ```
######
AngularJS ```html
Content
``` ```javascript $scope.myDialog.show(); ```
######
React ```html
this.setState({dialogOpen: false})} isOpen={this.state.dialogOpen} > Content
``` ```javascript this.setState({dialogOpen: true}); ```
######
Vue ```html
Content
``` ```javascript this.dialogVisible = true; ```
### Structure of Onsen UI -
CSS Components
-
Web Components (Custom Elements)
-
Framework Bindings
#### Interactive Tutorial
Integrated development platform for Cordova. - Built on top of cloud - Framework agnostic - Online IDE and local tools
## Livesync debugger Free download available from App Store & Google Play Store.
### Continuous integration & deployment - Github & BitBucket support - Deploy to Hockey App and DeployGate - Distribute to iOS App Store via Monaca Cloud
## Backend as a service - Push notifications - User management - Cloud database
#### Free plan - Browser based IDE - iOS / Android / Windows build - Live debugger - Backend as a service (Push, user, collections...) - Limited to 3 projects
#### Commercial plan - Starting from $16/month - iOS App Store deployment - Enhanced security - In app update feature - Technical support included
# DEMO
# Questions?