windows 8 - the javascript story

31
Windows 8 The JavaScript Story Clint Edmonson Developer Evangelist Microsoft @clinted notsotrivial.net

Upload: clint-edmonson

Post on 09-May-2015

572 views

Category:

Technology


2 download

DESCRIPTION

With the release of Windows 8, Microsoft has delivered a rich client application platform that is both powerful and approachable. Apps on this platform install easily and uninstall cleanly. They run in a single window that fills the entire screen by default. They automatically work with a variety of input sources, including touch, pen, mouse, and keyboard. Instead of static icons, they use live tiles that can display notifications. Best of all, these apps can be written using HTML5, CSS, and JavaScript.

TRANSCRIPT

Page 1: Windows 8 - The JavaScript Story

Windows 8The JavaScript Story

Clint EdmonsonDeveloper EvangelistMicrosoft

@clintednotsotrivial.net

Page 2: Windows 8 - The JavaScript Story

AgendaPlatform overviewWindows Library for Javascript (WinJS) Application architecture

TypeScript sneak peek

Page 3: Windows 8 - The JavaScript Story

Platform

Page 4: Windows 8 - The JavaScript Story

Microsoft is a devices and services company.Steve Ballmer, October 2012

Page 5: Windows 8 - The JavaScript Story

A new UI that lets people work the way they want – both touch and mouse-and-keyboard delight

New development models built on WinRT, including native support for HTML/CSS/JS, C#/XAML, C++/DirectX

Designed from the chipset up so people can choose and seamlessly use the devices they love – whether it’s a portable tablet or an amazing all-in-one

Windows reimagined

Windows Store on every device creates customer confidence in apps, new opportunity for developers

Windows Store Apps

Page 6: Windows 8 - The JavaScript Story

Content before chrome – Your app front-and-center

Users can easily share content from your app

Live Tiles draw users back into your app

Users can search within your app from anywhere

Windows Store Apps: Apps Take Center Stage

Search Share

Page 7: Windows 8 - The JavaScript Story

Familiar to web developers

Use jQuery, Dojo, Knockout, or any other JS toolkit you love today

Hardware accelerated web platform delivers fast and fluid apps

Full access to the Windows Runtime directly from JS

You can use HTML, CSS and JavaScript to create amazing native Windows 8 apps!

Page 8: Windows 8 - The JavaScript Story

Windows 8

Windows Core OS Services

JavaScript(Chakra)

CC++

C#VB

Metro style Apps

Communication

& Data

Application Model

Devices & Printing

WinRT APIsGraphics &

Media

XAML HTML / CSS

HTMLJavaScri

pt

CC++

C#VB

Desktop Apps

Win32

.NET / SL

Internet Explore

r

Syst

em

Serv

ices

Vie

wM

od

el

Contr

olle

rC

ore Windows Core OS Services

Communication

& Data

Application Model

Devices & Printing

Graphics & Media

Syst

em

Serv

ices

Core

Page 9: Windows 8 - The JavaScript Story

App Execution Environment

Core

OS

Runtime

Broker

Direct API calls

Brokered API calls

App Container + Signed & Validated code

Your App

WinRT APIs

Process.exe

AppXManifest

Page 10: Windows 8 - The JavaScript Story

lap around Windows 8demo

Page 11: Windows 8 - The JavaScript Story

WinJS

Page 12: Windows 8 - The JavaScript Story

Windows Library for JavaScript (WinJS)library for building Metro style apps using JavaScript

Web technologies you’re already familiar with

Modern patterns for responsive, reliable apps

Use interactive design tools

Build your apps fast and with high quality

Matches the Windows Metro design style

Controls for common user experiences

Designed for touch as well as traditional input

Scales across form factors

Make your apps look and feel great

Page 13: Windows 8 - The JavaScript Story

WinJSHelpers for Namespaces, Constructor Definition

Promises

App Model

Navigation

Page & User controls

Data binding

Controls

Animations

Templates

Utilities

Default CSS Styles

Page 14: Windows 8 - The JavaScript Story

WinJS Toolkits

Light StyleSheet

WinJS.Navigation Functions

local (storage)

roaming (storage)

WinJS.Application.sessionState

temp(storage)

Application Events

Namespace definition utilitiesWinJS.Namespace

Keyboard Key Enumeration

WinJS.UI.Animation

helpers

Coordinate Conversion

HTML/DOM UtilsWinJS Element

Attributes

Element Selection/Querying

Dark StyleSheet

Fragment loading and rendering

WinJS.UI.Fragments

WinJS.Promise

WinJS.PromiseStateMachine

Class definition and inheritance

WinJS.Class

Localized String Utilities

Support for WinJS declarative model (supportedForProc

essing)

Logging UtilsWinJS

WinJS.xhrWinJS.ErrorFro

mName

ValidationWinJS

Data-win-res processing

WinJS.UI.Pages.PageControl

WinJS.UI.Pages.IPageControlM

embers

Animation Library

WinJS.Binding.Template

Data Binding (as, bind) Mixins

WinJS.Binding.List

List Projections

Conversions

Support for declarative databinding

ListView

FlipView

Rating

Flyout SettingsFlyout

Semantic Zoom

Tooltip

AppBar

Menu GridLayout ListLayoutCustom Layout

Interface

TabContainer

HTMLControl

ToggleSwitchDatePickerTimePicker

ViewBox

IZoomableView

Animation System Management

Controls Utilities (

setOptions)

Menu Command

DataSourceStatus

IListBinding IListDataSourceIListDataAdapte

rIListNotification

Handler

StorageDataSource

VirtualizedDataSource

Support for declarative model

(processAll)

Error handling

Page 15: Windows 8 - The JavaScript Story

classesnamespacesdata bindingpromises

demo

Page 16: Windows 8 - The JavaScript Story

Prefer your own library? Go for it! Mix & match works fine

Understand our webcontext & sandboxing model

Adhere to the Metro UI and Windows personality

Page 17: Windows 8 - The JavaScript Story

Applications

Page 18: Windows 8 - The JavaScript Story

An app is different from a website..

App model NavigationOS integrationPersistence Trust

Page 19: Windows 8 - The JavaScript Story

…differences from web environment

Styling changesWindows Runtime accessLocal and Web contextIE10 DOCMODE onlyms-appx / ms-appx-web protocols

Mostly the same, but there you need to consider…

Page 20: Windows 8 - The JavaScript Story

A matter of context…

OS

User data Devices Communications Handlers Tiles Cryptography … …

Windows Store app (WWAHost.exe)Local context

Web context

AppData

Local Temp Roaming

Internet Explorer

Web context

WinRT APIs

Page 21: Windows 8 - The JavaScript Story

A matter of trust…Feature Local context Web context

Windows Runtime Yes No

Windows Library for JavaScript Yes Partial

JavaScript URIs(attribute="javascript:code")

No Yes

Data URIs ("data:" ) for fonts No Yes

External script references (<script src="http://*" /> ) No Yes

window.close Yes No

Cross-domain XHR requests Yes No

Page 22: Windows 8 - The JavaScript Story

Single page architecturedefault.html + default.js

<div id=“contenthost” … />

< div id=“appbar” … />

pagespages

pagex.html + pagex.js(injected into DOM as navigation occurs)

Page 23: Windows 8 - The JavaScript Story

Process State Transitions

RunningApp

SuspendedApp

Suspending Terminated

AppLow Resources

Resuming

Page 24: Windows 8 - The JavaScript Story

Data storage Apps automatically get a private storage folder upon

installation WinJS.Application.sessionState

In-memory global application data structure Automatically serialized to the file system and reloaded when app is reactivated

Windows.Storage.ApplicationData LocalFolder LocalSettings RoamingFolder RoamingSettings TemporaryFolder

Window.indexedDB Key-value pair based database engine Can handle large amounts of data

Page 25: Windows 8 - The JavaScript Story

structurenavigationapp statescontracts// storage

demo

Page 26: Windows 8 - The JavaScript Story

TypeScript

Page 27: Windows 8 - The JavaScript Story

TypeScript at a glance Language for application-scale JavaScript development.

Typed superset of JavaScript that compiles to plain JavaScript.

Offers classes, modules, and interfaces to help you build robust components.

Any browser. Any host. Any OS. Open Source.

Page 28: Windows 8 - The JavaScript Story

TypeScript sneak peekdemo

Page 29: Windows 8 - The JavaScript Story

Resources

Page 30: Windows 8 - The JavaScript Story

Resources Start building the next generation of apps – Windows 8, WP8,

Webhttp://clint.ms/NextGenerationApps

Windows 8 Sample Library http://code.msdn.microsoft.com/windowsapps

TypeScripthttp://www.typescriptlang.org/

Page 31: Windows 8 - The JavaScript Story