KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination...

19
KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online

Transcript of KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination...

Page 1: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

KnockoutJS, TypeScript & Gulp in a combination withSharePoint 2016 andSharePoint Online

Page 2: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Gašper RupnikKompas Xnet d.o.o.

Mainly SharePoint developer

Basically develop all that can be programmable

Titles:• MS

• MCPS

• MCSD: SharePoint Applications, App Builder

• MCT

2

Page 3: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Environment

Visual Studio 2015

Visual Studio Code

KnockoutJS

TypeScript

Node.js

Gulp

3

Page 4: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Visual Studio 2015

Integrated development environment (IDE)

Different projects templates

Drag & drop UI, Code Editor

Debugging, deployment

SP Projects templates:• Empty project• Web parts• Etc.

4

Page 5: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Visual Studio Code

New, redefined code editor

Free, open source, runs everywhere

No projects templates

No drag & drop visual UI

Just code editor

Perfect for client-side technologies (HTML/JS/CSS)

5

Page 6: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

KnockoutJS

JavaScript library

Create responsive display and editor UI

Clean data model

Connect parts of UI to data model

Update parts of UI depend on data model changes

6

Page 7: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

TypeScript

Typed superset of JavaScript

Compiles to plan JavaScript

Independent of:• Browser

• Host

• OS

Open Source

7

Page 8: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Node.js

Runtime environment for developing JS applications

Rich library of various JavaScript modules

Node Package Manager (NPM)

8

Page 9: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Gulp

Task runner

Example:• Concat()

• TypeScript()

• Uglify()

• SPSave() *

• Watch()

9

Page 10: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Demo application - description

Get best place for next SharePoint Days conference

Key: average distance for current attendees

10

Page 11: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Demo application - structure

Lists:• Attendees

• Planned Cities

Pages:• Default.aspx

Client-side script

11

Page 12: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Demo 1Initial project

Page 13: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Demo application – 1. stage update

Read data from „Attendees“ list

Calculate distance with Google Maps API

Write data to „Planned Cities“ list

13

Page 14: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Demo application – 1. stage update

Read data from „Attendees“ list & Write data to „Planned Cities“ list• SPServices

14

Page 15: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Demo application – 1. stage update

Calculate distance with Google Maps API• Get API key

(https://developers.google.com/maps/documentation/javascript/get-api-key)

• Include Google Maps API Scripts

15

Page 16: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Demo 21. stage update

Page 17: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Demo application – 2. stage update

Show calculated routes from Google Maps

17

Page 18: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Demo 32. stage update

Page 19: KnockoutJS, TypeScript & Gulp in a combination …...KnockoutJS, TypeScript & Gulp in a combination with SharePoint 2016 and SharePoint Online Author Gašper Rupnik Created Date 11/3/2016

Questions?