Top Banner
Build PhoneGap apps with Vue.js and Framework7
37

Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Oct 15, 2018

Download

Documents

trinhtruc
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Build PhoneGap apps with Vue.js and Framework7

Page 2: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Timo Ernst

Software Engineer, Freelance Blogger & YouTuber

Studied Media Computer Science University of Ulm, Germany

❤ to create apps and websites with UX in mind

Page 3: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

www.timo-ernst.net

Page 4: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

pgchat.eu

Chat app built with Vue, F7 and PhoneGap

Open Source

131 lines JavaScript Code (763 bytes)

82 lines HTML

Ask questions during the talk

No dick pix pls :-)

Page 5: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Link collection available via

timo-ernst.net/pgday

Page 6: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

I’m not creator of any of these projects.

In my free time I only contribute and support

as a part of the open source community.

Disclaimer

Page 7: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Vue.js

Uprising, component-based MVVM framework

Made by Evan You

Simple, easy to use

It’s fast!

Plain HTML, CSS, JavaScript

Page 8: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

This will run natively This won’t :-(

<div id="app"> {{ message }}</div>

new Vue({ el: '#app', data: { message: 'Hello Vue!' }})

<div id="app"></div>

React.render( <Greeting>Hello JSX</Greeting>, document.getElementById('app'););

Page 9: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

I hate tools

Page 10: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Native ES6 modules with Vue.js Are we there yet?

Table by Sam Thorogood @samthor

Page 11: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Ok, but what about Cordova/PhoneGap?

@kerrishotts

Thanks a lot to Kerri who provided the following info to me!

Page 12: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

WKWebViewCORS failure when served from file:/// 403 when served via local webserver plugin Works for /external/ but no support for <nomodule>

UIWebviewNope

Page 13: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

¯\_(ツ)_/¯

Page 14: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Browsers are on a good way

Webview needs to catch up

Future (2018?)Run Vue + ES6 natively

Until then:Vue + ES5 natively

Vue + ES6 natively (w/o ES6 modules) Vue + Full ES6 + Webpack/Babel

Page 15: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Simplicity is what makes Vue so popular

So simple!

Page 16: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Source: Google Trends Last updated May 10th 2017

VueReact

Page 17: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

?UI components

Page 18: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Semantic UI

UI Kit

KendoUI

Sencha Touch

Bootstrap

Foundation

jQuery Mobile

etc…

Page 19: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Many libraries fail to emulate

the look and feel of native apps

Page 20: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Performance

(Native) Look and Feel

Ease of Use, Gradual learning curve

Scalability

Maintainability

Quality of documentation

Open source? Community active? / Company backed?

Page 21: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps
Page 22: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

UI components

99.9% close to native UX

iOS + Material Design

Custom Router

Dom7: „jQuery style“ (old)

See Kitchen Sink demo

Page 23: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

www.framework7.io

Page 24: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Dis

tanc

e

Time

Cubic Bézier Transition („ease“)Linear Transition

Page 25: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Framework7-Vue Plugin

Page 26: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

„Bridge“ between F7 and Vue

Custom router

Page 27: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

LET’S SEE

SOME CODE

Page 28: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

<head> <link rel="stylesheet" href="framework7.ios.css"> <link rel="stylesheet" href="framework7.ios.colors.css"> </head>

<body> <div id="app"></div>

<script src="vue.min.js"></script> <script src="framework7.min.js"></script> <script src="framework7-vue.min.js"></script> </body>

Page 29: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

var pageChatTemplate = `<f7-page> <f7-messages> <f7-message v-for="msg in messages" :text="msg.text" /> </f7-messages>

<f7-messagebar send-link="Send" v-on:submit="onSend"/>

</f7-page>`;

Page 30: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Vue.use(Framework7Vue);

new Vue({ el: '#app', framework7: {root: '#app'}, template: pageChatTemplate, data: { messages: [] }, methods: { onCreate: _ => this.messages = api.get(), onSend: text => api.send(text) },});

Page 31: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

See Linklist timo-ernst.net/pgday

PhoneGap Templates by

Holly Schinsky(Static version)

Oguz Özcan(Webpack enhanced)

Page 32: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Coming up

Visual App Builder

CLI

Framework7 v2Vladimir Kharlampidi

Framework7 Lead Developer

Page 33: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Is not getting the attention it deserves

Entirely community-backed project

Small (but active) community

Page 34: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Before we end.. =)

Page 35: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

framework7.io/react

by Ben Compton

Page 36: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Thanks a lot for listening!

Page 37: Build PhoneGap apps with Vue.js and Framework7 · Timo Ernst Software Engineer, Freelance Blogger & YouTuber Studied Media Computer Science University of Ulm, Germany to create apps

Questions?

Link list available via timo-ernst.net/pgday