DIVTAG DEVELOPER MEETUP @ NOV. 12, 2015

JavaScript Web Applications

Hiun Kim Computer Science Department, Sejong University Seoul, South Korea

Computer Research Group We are old, the web as we know..

Computer Research Group New Waves of Modern Web

Computer Research Group Computer Research Group Single Page Application

Web site that fits on a single web page with the goal of providing a more fuild UX akin to desktop apps

- via Wikipedia

Computer Research Group Single Page Application (cont.)

Concepts established circa 2002 (not sure)

US Patents 8136109 ( Delivery of data and formatting information to allow client-side manipulation )

Computer Research Group Single Page Application (cont.)

Provides layout and partial view

Every event is related to JavaScript

They against the web we know!

Computer Research Group Enhancing User Experience

Proviedes seamless experience through,

Reducing round tripping of submission

Reducing process of CSS & JavaScript

Computer Research Group Continuity

Page does not reload completely, browser can store state with JavaScript

Computer Research Group Continuity (cont)

Web is not only a document viewer, but data manipulator (Google Spread Sheets) or interactive viewer (Facebook.com )

Computer Research Group https://upload.wikimedia.org/wikipedia/commons/c/ce/Bonsack_machine.png Pros

Does not require to load whole page,

Saving time

Seamless user experience

Computer Research Group http://grannymar.com/wp-content/uploads/2010/03/dscf5587.jpg Cons

Not simple, not pure (as definition of today)

Often slow for processing

Fallback exist but incomplete

Sometime impossible

Computer Research Group Core Mechanism

Browser is sandbox

JavaScript can manipulate URL and History pushState for creating history

Computer Research Group Libraries and Frameworks jquery-pjax (pushState + ajax) ember.js etc.

Computer Research Group jquery-pjax

My Site

Go to next page.
Computer Research Group jquery-pjax (cont.)

GET /?_pjax=%23main HTTP/1.1 Host: pjax.herokuapp.com Connection: keep-alive Pragma: no-cache Cache-Control: no-cache User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Accept: text/html, */*; q=0.01 X-Requested-With: XMLHttpRequest X-PJAX: true X-PJAX-Container: #main Referer: http://pjax.herokuapp.com/dinosaurs.html Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8,ko;q=0.6 Computer Research Group Workflow

GET /login HTTP/1.1 ! Host: example.com Ȑ Response layout.html

GET /login HTTP/1.1 ! X-PJAX: true

Response login.html Ȑ ! Computer Research Group Workflow (cont.) ! GET /api/posts HTTP/1.1 Ȑ Response JSON Object

! ...... Computer Research Group Paradigm shifts in rendering

In usual, logic within template executed

Data is rendered in server

The number is: $x
"; } ?> Computer Research Group Paradigm shifts in rendering (cont.)

In usual, logic within template executed

Server only render template

Client JS renders data

Computer Research Group Frameworks

Angularjs Bidirectional UI

Ember.js MVC Architectural Pattern

METEOR Fullstack Framwrork for SPAs. Computer Research Group Libraries

React A JavaScript library for building user interfaces

Vue.js Reactive Components for Modern Web Interfaces

Computer Research Group New Perspectives

Facebook: Rethink established best practices™

- Ben Alman

Computer Research Group XHP

Augments the syntax of the language such that XML document fragments become valid PHP expressions.

Computer Research Group XHP (cont.)

Facebook;

Computer Research Group XHP (cont.)

{$post}

Hey there.

Like