SlideShare a Scribd company logo
SocketStream
A web framework for
single page apps
Created by
Owen Barnes
@temporalwave
!
!

(my boss at a former company)
About me
Paul Jensen
@paulbjensen
!
!

(I’m the new lead developer)

Recommended for you

Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile

The document discusses developing for mobile web. It covers several topics including physical properties of mobile devices, their network usage and power constraints. It also discusses different versions of Gmail optimized for different devices. The document recommends inlining content, deferring non-essential work, and being creative with JavaScript libraries and debugging to improve performance for mobile. It highlights the ability of web technologies to build cross-device applications quickly without native restrictions. The conclusion is that native languages may be better if writing many device plugins, but web technologies can be effective otherwise.

html5mobilejavascript
Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service Worker

2 parts of talking at Google Developer Summit 2016 Seoul - How to optimize loading performance your web app - Introducing to Service Worker & Offline 101

offlinehtml5serviceworker
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance

Presentation on how Meetup tackles web performance. Given on: - Nov 17th, 2009 for the NY Web Performance Group (http://www.meetup.com/Web-Performance-NY/) - Jan 26th, 2010 for NYC Tech Talks Meetup Group (http://www.meetup.com/NYC-Tech-Talks/)

achitecturemeetupperformance
Where to begin?
Why Single Page
Apps?
With a traditional web app,
the user has to refresh the
page to see new information
Client

Server

Time

Recommended for you

#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance

This document discusses optimizing Meetup's performance by reducing page load times. It recommends reducing JavaScript, image, DOM, and CSS files. Specific techniques include externalizing and concatenating JavaScript, lazy loading images and scripts, minimizing DOM elements, writing efficient CSS selectors, and profiling code to optimize loops and DOM manipulation. Reducing page weight through these techniques can improve the user experience by speeding up load times and drop in member activity.

JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patterns

This document summarizes best practices for optimizing JavaScript performance. It discusses loading JavaScript asynchronously or lazily to avoid blocking page loads. It also recommends minimizing DOM manipulation, batching style changes, and caching references to reduce reflows and repaints. The document emphasizes measuring performance through tools like Benchmark.js and jsperf.com to avoid premature optimization. It cautions against unnecessary shims and polyfills and stresses optimizing for mobile environments.

wpodomlazy
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance Patterns

JavaScript performance patterns focuses on optimizing JavaScript loading and execution for better performance. Some key points include reducing the number of script files, leveraging caching, minification and compression. Asynchronous loading helps prevent blocking. DOM operations are expensive so it's important to cache references, batch operations and avoid reflows. Data attributes provide a convenient way to store data on elements. Shims and polyfills should be used judiciously, loading conditionally where native support is limited. Benchmarking is crucial to identify real bottlenecks and measure impact of optimizations.

wpodomlazy
GET/football/live

Client

Server

Time

HTTP/1.1
HTTP/1.1 200 OK

Client

Server

Time
20 seconds later…

Client

Server

Time
I wonder what the latest score is…
Let’s reload the page

Client

Server

Time

Recommended for you

High Performance Social Plugins
High Performance Social PluginsHigh Performance Social Plugins
High Performance Social Plugins

Social plugins are third-party iframes that allow users to interact with social features like liking or sharing content. They can be plugged in two main ways: 1) by writing the iframe directly or 2) by loading third-party JavaScript that generates the iframe. The third-party JavaScript should be loaded asynchronously to avoid blocking the page load. Once loaded, the social plugin needs to show up quickly with a single request, resize itself if needed, and handle user interactions like likes in a lazy manner by preloading JavaScript but not evaluating it until an interaction occurs.

pluginindapifcss
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)

The document summarizes techniques for improving JavaScript performance in web applications. It discusses how JavaScript execution blocks the browser UI thread, leading to unresponsive user experiences if scripts run for too long. It then provides recommendations to limit JavaScript execution times to under 50ms and describes load time techniques like placing scripts at the bottom of the page, combining files, and loading scripts dynamically or deferring their execution to improve page load performance.

amazonjavascriptperformance
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin

Jenkins User Conference 2012 Only by the third plugin do you get the hang of writing a plugin. I thought as a developer coming to the build side of things it'd be easy to jump in and write some plugins. I was wrong. Don't be fooled by the extremely friendly Jenkins community, writing a plugin from scratch is harder than they let on. This talk will explain the hurdles that I had to cross to make writing plugins easy.

pluginsjenkinshudson
GET/football/live

Client

Server

Time

HTTP/1.1
HTTP/1.1 304 Not Modified

Client

Server

Time
Client

Server

Time
The user had to press F5
to get at any new information
Client

Server

Time

Recommended for you

Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)

In the beginning, progressive enhancement was simple: HTML layered with CSS layered with JavaScript. That worked fine when there were two browsers, but in today's world of multiple devices and multiple browsers, it's time for a progressive enhancement reboot. At the core is the understanding that the web is not print - the same rules don't apply. As developers and consumers we've been fooled into thinking about print paradigms for too long. In this talk, you'll learn just how different the web is and how the evolution of progressive enhancement can lead to better user experiences as well as happier developers and users. This deck is a conference-agnostic one, suitable to be shown anywhere without site-specific jokes!

htmlcssprogressive enhancement
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins

This document discusses jQuery UI and plugins. It provides an overview of jQuery UI classes that can be used to style elements. It also demonstrates several common jQuery UI widgets like buttons, accordions, dialogs, and tabs. The document discusses jQuery UI effects for animations and transitions. It provides tips for identifying good plugins based on aspects like their API, documentation, support, and community. Overall, the document is an introduction to using jQuery UI and evaluating jQuery plugins.

pluginsthemerollercss framework
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashed

Peter Lubbers from Kaazing gave a presentation on HTML5 features such as Web Workers, Geolocation, and WebSockets. He discussed how these new technologies allow for asynchronous background processing, location detection, and bi-directional real-time communications without polling. Browser support for HTML5 features was also reviewed.

Client

Server

Time

Even though there was
no new information,
the server still had to serve
the HTTP request
This is not a fun experience
How do we make this
better?
Client

Server

Time

Recommended for you

Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!

After consulting with several companies on performance related issues, it became clear that one of the biggest performance issues facing websites today is the sheer amount of JavaScript needed to power the page. The demand for more interactive and responsive applications has driven JavaScript usage through the roof. It’s quite common for large sites to end up with over 1 MB of JavaScript code on their page even after minification. But do today’s web applications really need that much JavaScript?

javascriptperformancenzakas
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery Plugins

The document discusses lessons learned from examining popular jQuery plugins. It summarizes 30 top plugins, describing why each was created and how it grew. Key takeaways are that authors build plugins to make something better, for fun/exploration, or client needs. Managing features and user feedback is challenging. The best plugins have great demos, documentation, browser support testing, and are fun. The author is available for questions.

pluginsjquery
Liking performance
Liking performanceLiking performance
Liking performance

The document discusses techniques for optimizing the performance of a Facebook like button, including: 1. Reducing the number of CSS and JavaScript files needed by combining them into single files and hosting on a single CDN. 2. Loading CSS styles inline initially and lazy loading remaining styles. Loading JavaScript asynchronously and lazily. 3. Addressing challenges like IE still downloading images in hidden elements and using CSS techniques like "nubs" for rounded corners.

cssdataurilike
We could use AJAX to
update the page
We’d save the user
having to press the F5 key
What else can we do?
Client

Server

Time

Recommended for you

Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared To

This document provides an overview of building progressive web apps (PWAs). It discusses the key technologies needed for PWAs including manifest files, service workers, and app shells. It provides examples of how to add a manifest to enable installable web apps, how to cache assets using service workers, and how to send push notifications. While Safari and iOS do not fully support these technologies yet, the document notes they are being developed for future releases.

javascriptpwaweb
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player

Slides from my talk discussing my experience rebuilding a video player I previously developed in Flash. I gave this talk on March 18th, at the Brisbane Web Design Meetup.

htmlhtml5css
Web Crawling with NodeJS
Web Crawling with NodeJSWeb Crawling with NodeJS
Web Crawling with NodeJS

Lightning talk I did at the second #JSMeetup in Paris. #Parisjs It kickstarted the project http://github.com/sylvinus/node-crawler

nodejs crawling node javascript jquery server spid
Optimise the response
GZIP the response
data, and …
Avoid sending data we
already have on the client
We could also
separate the HTML
from the data

Recommended for you

Lambda Architecture with Spark
Lambda Architecture with SparkLambda Architecture with Spark
Lambda Architecture with Spark

The presentation covers lambda architecture and implementation with spark. In the presentation we will discuss about components of lambda architecture like batch layer, speed layer and serving layer. We will also discuss its advantages and benefits with spark.

sparkknolduslambda architecture with spark
Test in action – week 1
Test in action – week 1Test in action – week 1
Test in action – week 1

This document discusses different types of software testing including unit testing and integration testing. Unit testing involves writing code to test individual units or modules in isolation with few dependencies. Integration testing evaluates how modules function together as a group in a black box manner. The benefits of testing include facilitating code changes, enhancing software quality by catching bugs, serving as documentation, and improving code quality. Test-driven development is introduced as an approach where tests are written before code to drive the design. Continuous integration is also discussed as a way to fully automate testing, build, and code quality checks.

software testingphpphpunit
Ese Neno Da Rua
Ese Neno Da RuaEse Neno Da Rua
Ese Neno Da Rua
Reuse the HTML on
the client
…and use the server to
provide you with just
data
And the web site becomes a
client

Web App

Native App

Server

API User
The server is just an API

Recommended for you

Aspen Lion
Aspen LionAspen Lion
Aspen Lion

First grade animal research project. Each student chose an animal, researched it and completed a PowerPoint template.

Segundo Caraujulca Galvez
Segundo Caraujulca GalvezSegundo Caraujulca Galvez
Segundo Caraujulca Galvez

O documento repete a frase "Segundo Caruajulca Gálvez" cinco vezes, sem fornecer mais contexto ou informações.

asociacionabarel
Springbreak Workshop
Springbreak WorkshopSpringbreak Workshop
Springbreak Workshop

Interne communicatie is in beweging. Zo zien we in bedrijven ‘interactieve visionjams’ op het intranet waar-bij iedereen meepraat over de nieuwe strategie. Medewerkers laten zien wat hen bezig houdt via eigen ‘Youtube’ filmpjes. Directeuren bloggen of chatten. Allerlei vernieuwingen worden van buiten naar binnen gehaald. Dat leidt ook tot nieuwe vragen en dilemma’s. Wie heeft de regie? Willen we wel dat dat onder werktijd gebeurt? Wat kost dat allemaal? Hoe zit het met de informatiedruk? En de verdieping of duiding van al het vluchtige nieuws? Waar is de scheiding tussen werk en privé? En natuurlijk: wat leveren al die moderne middelen op?

twitterinternecommunicatie
A beautiful separation
of concerns
Overview
•

The server becomes a REST API serving JSON

•

HTML compilation is done on the client

•

As a result, less processing & bandwidth is
consumed by the server
Why Realtime?
Client

Server

Time

Recommended for you

Who Is Muhammad (Pbuh)
Who Is Muhammad (Pbuh)Who Is Muhammad (Pbuh)
Who Is Muhammad (Pbuh)

Muhammad was born in 570 CE in Mecca, Saudi Arabia. He was raised by his uncle from the respected Quraysh tribe after being orphaned at a young age. Muhammad became known for his truthfulness, generosity, and sincerity, and he was often sought out to arbitrate disputes. Historians described Muhammad as calm and meditative. He was deeply religious and had long opposed the decadence of his society. It was his habit to meditate in the Cave of Hira on Mount Jabal An-Nur.

islamiceducationsyukran
Proyek penciptaan dan digitalisasi konten
Proyek penciptaan dan digitalisasi kontenProyek penciptaan dan digitalisasi konten
Proyek penciptaan dan digitalisasi konten

Proyek ini mencakup beberapa subproyek penciptaan dan digitalisasi konten untuk Wikipedia bahasa Indonesia, Sunda, Jawa, dan Minangkabau antara tahun 2013-2015. Subproyek utama adalah kompetisi menulis artikel baru untuk Wikipedia bahasa Indonesia dan permainan daring untuk memajukan Wikipedia bahasa Sunda, ditambah upaya digitalisasi karya cetak bahasa Jawa dan sarasehan untuk pedoman bahasa Minangkabau.

wikimedia indonesiadigicproyek 2015
Lontar class 2
Lontar class 2Lontar class 2
Lontar class 2

Dokumen tersebut memberikan pedoman tentang penulisan artikel di Wikipedia meliputi definisi artikel baru, artikel sempurna, artikel rintisan, artikel yang tidak dihitung, penggunaan kategori, wikifisasi, format badan artikel, penggunaan referensi, rambu, markah wiki, pengalihan, dan penggunaan infobox.

Polling the server every
[n] seconds for new
data is redundant
There has to be a
better way
What if the server could
send its client(s) new
data as soon as it came
about?
We can, thanks to
WebSockets

Recommended for you

Lesson16vocab
Lesson16vocabLesson16vocab
Lesson16vocab

This document contains metadata in the form of photo credits linking to various photos on Wikimedia Commons and Flickr. The photos referenced are of military graduation ceremonies, with subjects such as newly commissioned naval officers celebrating and people in military dress uniforms.

 
by PEDH
洋服はあなたの良さを引き立てるコミュニケーション
洋服はあなたの良さを引き立てるコミュニケーション洋服はあなたの良さを引き立てるコミュニケーション
洋服はあなたの良さを引き立てるコミュニケーション

This is a presentation about Personal styling and how-to-wear for working women. Presented in the event hosted by Smapo, which is a smartphone APPS of shopping points service, on Nov 7th, 2013.

personal stylingpersonal stylistfashion
Proposal Bebaskan Pengetahuan 2014
Proposal Bebaskan Pengetahuan 2014Proposal Bebaskan Pengetahuan 2014
Proposal Bebaskan Pengetahuan 2014

Proposal untuk sponsor Bebaskan Pengetahuan 2014

kompetisi menulisbebaskan pengetahuan 2014wikipedia bahasa indonesia
WebSockets allows data
to be sent both ways
Client

Server

Time
Client

Server

Time

Goal
The server sends a message
to the client that an action has
occurred

Client

Server

Time

Goal

Recommended for you

DoInk2'
DoInk2'DoInk2'
DoInk2'

DoInk is a website for users ages 13 and up to create and animate art online. Users can make art without logging in, but must create an account to save their work. With an account, users can publish their art for others to view, like, comment on, and find inspiration from other users' works. The site allows users to bring drawings to life through animation by taking them frame by frame. It's a free site where users can connect, learn, and share creative works.

doinkpresentation
how to get a job in advertising
how to get a job in advertisinghow to get a job in advertising
how to get a job in advertising

This was for a little talk I gave at CUNY's City College to ad students in the excellent Media and Comm Arts program.

jobhuntingcityget
Presentatie ExcellentSecretary
Presentatie ExcellentSecretaryPresentatie ExcellentSecretary
Presentatie ExcellentSecretary
We eliminate the need
to poll the server for
new data
Overview
•

We can replace AJAX polling with WebSockets,
and provide a better user experience as a result

•

We also remove the need to make redundant
polling requests back to the server.

•

We use WebSockets for sending/receiving JSON
Single Page Apps
+
The Realtime Web
There are many ways
to build this kind of
app

Recommended for you

QUESTION 7
QUESTION 7QUESTION 7
QUESTION 7

The student felt they learned more about magazine production from their preliminary task to the final product. They improved their knowledge of media terminology and magazine making skills. While photography was not new, working with layout programs like Quark Express taught them new printing techniques. Researching large publishers also increased their understanding of the magazine industry, such as the UK's leading company IPC.

State and Capital Game
State and Capital GameState and Capital Game
State and Capital Game

This document quizzes the user on identifying the capital cities of various US states by providing multiple choice answers. It asks the capital of 20 different states, including Alabama, Alaska, Arizona, Arkansas, California, Colorado, Hawaii, Michigan, Kansas, Maine, Minnesota, Texas, Vermont, North Carolina, New Mexico, Washington, and Rhode Island. The document provides feedback on whether answers are correct or incorrect.

Kelas lontar 1
Kelas lontar 1Kelas lontar 1
Kelas lontar 1

Kelas menulis I: Wikimedia-Lontar untuk Penulis Indonesia. 1. Membuat akun 2. Mengunggah gambar 3. Membuat artikel baru

wikimedia indonesiawikipediawikimedia
You could build it
mostly from scratch, and
use Express + Socket.io
Or alternatively, you
could use a web
framework like Meteor
or Firebase
SocketStream is
somewhere in-between
these 2 approaches
It provides tools to help
with building realtime
single page apps...

Recommended for you

Vocab lesson 11
Vocab lesson 11Vocab lesson 11
Vocab lesson 11

The document discusses various terms related to art and transportation. It defines artist as people who create art, and notes that artists paint, draw pictures, and blend colors. It defines draw as making a picture using lines, and defines subway as an underground train that travels through tunnels, providing an example of someone taking the subway to work each day.

 
by PEDH
Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction

Node.js is an extremely light weight framework for rapidly developing and deploying next generation web and mobile apps. It enables developers to have full stack development. Not only does it save lines of code, but also saves a lot of time in writing those critical code. Node.js is built on open source Chrome V8 engine. Its built on top of C++ layer. JS code is compiles into machine code for blazing execution on your machine or server. This slide gives a jump start and a sneak peak for node.js. About Parth: Parth Joshi is a Tech - Entrepreneur and a Corporate Trainer. He has been part of two internet startups and has been lead technical architect and project manager. He has zeal for exploring new technology and how innovation solves problems of people at large. He currently acts as consultant for various startups. He also trains tech teams to make them startup ready. For more information about how Parth can train your team visit: www.parthjoshi.in/Training Follow him on Twitter: twitter.com/joshiparthin Connect with him on LinkedIN : linkedin.com/in/joshiparthin

internetjavascriptweb design and development
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.js

This document provides an overview of Node.js, including what it is, its key features, and how to test a Node.js installation. Node.js is a JavaScript runtime environment that allows building scalable network applications in a single programming language. It uses non-blocking I/O and event-driven architecture, making it suitable for data-intensive real-time applications. The document demonstrates creating an HTTP server in Node.js, using the built-in URL module, and shows how Node.js uses an asynchronous and event-driven platform. It concludes by providing a link to a demo login application built with Node.js on GitHub.

node.js
... Whilst trying not to
restrict what
technologies you can
use with your app
For example, we don't
provide an ORM.
Instead, you choose the
database & the ORM
Also, we don't mandate using a
specific client-side framework
!

You can use BackBone, Angular,
Ember, or something else, that is
entirely your choice.
What we focus on
instead are these
things:

Recommended for you

Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end apps

This document provides an overview of key concepts for building single-page web applications. It discusses client-server relationships, routing, views and content rendering, global event handling, dependency management, initialization and execution, form handling. The document emphasizes defining RESTful APIs, rendering HTML on the server when possible, using a dependency library like RequireJS, and following conventions to manage initialization and execution of code.

single-pagexhrfront-end
Introduction to node.js
Introduction to  node.jsIntroduction to  node.js
Introduction to node.js

The presentation is an overview of Node.js on how to use it in developing web apps. It also describes the pros and cons it has along with why it got so much adaption in quick time.

mongodbnodejsjavascript
08 ajax
08 ajax08 ajax
08 ajax

This document discusses various techniques for transferring data between a client and server, including JSON, web sockets, and AJAX. JSON is introduced as a widely supported format for data interchange. Web sockets allow for full-duplex communication between client and server, while AJAX can be used to make asynchronous requests. Requirements for communication protocols include wide server/client support, ease of debugging, and ability to pass firewalls. JSON meets these requirements as it is text-based, simple, and supported across many platforms. The document demonstrates using JSON to return flight data from a server to a client and discusses jQuery functions like $.get and $.ajax for making requests. It also covers concepts like the same-origin policy and techniques like JSON

web developmentmobile web
HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
I'll run through each of
these, 1-by-1. But first,
let's look at how to use
SocketStream
Getting started

npm install -g socketstream
!

socketstream new my_app
Getting started
!

!
!
!

Success! Created app 'my_app' with:
✓ Basic chat demo (-m for minimal install)
✓ Javascript example code (-c if you prefer CoffeeScript)
✓ Plain HTML for views (-j if you prefer Jade)
Next, run the following commands:
cd my_app
[sudo] npm install
To start your app:
node app.js


Recommended for you

Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations

The document discusses optimization of the presentation tier of web applications. It notes that the presentation tier is often overlooked despite being responsible for over 30% of client/server performance. Some key optimizations discussed include reducing HTTP requests, optimizing response objects by reducing size and load pattern, JavaScript minification and placement, image sprites, caching, and ensuring valid HTML markup.

htmlcssjavascript
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js

This document provides an introduction to node.js, Express, Jade, MongoDB, and mongoose. It discusses installing and using these technologies to build a web application with a backend server in JavaScript. Node.js is introduced as a way to develop server-side applications with JavaScript. Express is presented as a web application framework that can be used with Node.js. Jade is described as an HTML templating language. MongoDB is explained as a document-oriented NoSQL database, and mongoose is an ODM that provides an interface to work with MongoDB from Node.js applications.

node.js express jade mongodb mongoose
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)

“ACTIVE SERVER PAGES OR ASP IS COMMONLY KNOWN AS A TECHNOLOGY THAT ENABLES TO MAKE DYNAMIC AND INTERACTIVE WEB PAGES.” ASP uses server-side scripting to dynamically produce web pages that are not affected by the type of browser the web site visitor is using. The default scripting language used for writing ASP is VBScript, although some other languages can also be used like Jscript (Microsoft‟s version of JavaScript). ASP pages have the extension .asp instead of .htm, when a page with extension .asp is requested by a browser the web server knows to interpret any ASP contained within the web page before sending the HTML produced to the browser. Any web pages containing ASP cannot be run by just simply opening the page in a web browser. The page must be requested through a web server that supports ASP, this is why ASP stands for Active Server Pages, means no server, no active pages.

servletasp(active server pages)dynamic content technologies
Here's what the initial file/
folder structure looks like
HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
Client code is organised
into 5 sub-folders
Client side code organisation
•

CODE stores client side JavaScript files and libraries

•

CSS stores CSS files

•

STATIC stores public files like images, font files, and other
assets

•

TEMPLATES stores HTML templates for the single page
app to render on the client

•

VIEWS stores HTML files that are rendered from the server
for the initial page

Recommended for you

Node js getting started
Node js getting startedNode js getting started
Node js getting started

The document discusses Node.js and the Express web application framework. It provides a basic "Hello World" example to demonstrate creating a Node.js server file and requiring it in an index file to start the server. It then shows a simple Express app with one route that responds to requests to the homepage with "Hello World!". The document provides an overview of building an application stack in Node.js and introducing the Express framework.

Play framework
Play frameworkPlay framework
Play framework

The document discusses the Play framework, an agile web development framework created by Guillaume Bort in 2007. It provides an overview of Play's main concepts including its stateless MVC architecture, ability to fix bugs and reload code without restarting, efficient templating, and support for test-driven development. The document also covers getting started with Play and using modules to add additional functionality.

play frameworkgoogle appenginecloud computing
3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web

3 Tips to Deliver Fast Performance Across Mobile Web On-Demand Webinar Seems like everyone’s doing Responsive Web Design these days! Are you using React, Angular or others to create a mobile-friendly web experience? Newsflash: Mobile-friendly doesn’t always equal customer-friendly, when it comes to performance. We’re talking about 60% of your traffic—how do you avoid disaster? Learn the basics of high-performance mobile development through the examination of real-world, performance-killing code examples. You’ll also hear about: Why 4.5 seconds on Chrome can be 15 seconds on a Galaxy S5 Chromium How to identify major issues within mobile page construction Best practices for managing CSS and JavaScript Things to consider going global with your Web application Join web performance experts Klaus Enzenhofer and Stefan Baumgartner from Dynatrace to ensure your mobile properties are delighting your customers!

web monitoring user experience testingend user monitoringbehavior analysis
Those sub-folders have subfolders, but are optional
This is how we load them
// My SocketStream 0.3 app

!

var http = require('http'),
ss = require('socketstream');

!

// Define a single-page client called 'main'
ss.client.define('main', {
view: 'app.html',
css: ['libs/reset.css', 'app.styl'],
code: ['libs/jquery.min.js', 'app'],
tmpl: '*'
});

!

// Serve this client on the root URL
ss.http.route('/', function(req, res){
res.serveClient('main');
});
// My SocketStream 0.3 app

!

var http = require('http'),
ss = require('socketstream');

!

// Define a single-page client called 'main'
ss.client.define('main', {
view: 'app.html',
css: ['libs/reset.css', 'app.styl'],
code: ['libs/jquery.min.js', 'app'],
tmpl: '*'
});

!

// Serve this client on the root URL
ss.http.route('/', function(req, res){
res.serveClient('main');
});
// My SocketStream 0.3 app

!

var http = require('http'),
ss = require('socketstream');

!

// Define a single-page client called 'main'
ss.client.define('main', {
view: 'app.html',
css: ['libs/reset.css', 'app.styl'],
code: ['libs/jquery.min.js', 'app'],
tmpl: '*'
});

!

// Serve this client on the root URL
ss.http.route('/', function(req, res){
res.serveClient('main');
});

Recommended for you

Building ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS ApplicationsBuilding ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS Applications

The document provides an overview of building applications using ColdFusion and AngularJS. It discusses requirements for a player registration application using ColdFusion as the server-side and AngularJS as the client-side framework. It covers building the ColdFusion REST API, core AngularJS features used in the client, and integrating the two by calling the ColdFusion API from AngularJS.

coldfusionangularjs
Testable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascriptTestable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascript

This document discusses building testable, client-side MVC apps in JavaScript using Spine, Jasmine, and Node.js. It advocates pushing as much work to the client as possible for responsiveness, and outlines a thin-server architecture with common front-end technologies and libraries to structure code, add interactivity, and optimize resources.

javascript nodejs
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When

Save 10% off ANY FITC event with discount code 'slideshare' See our upcoming events at www.fitc.ca Node.js: The What, The How and The When with Richard Nieuwenhuis

 
by FITC
node.jsweb design and development
// My SocketStream 0.3 app

!

var http = require('http'),
ss = require('socketstream');

!

// Define a single-page client called 'main'
ss.client.define('main', {
view: 'app.html',
css: ['libs/reset.css', 'app.styl'],
code: ['libs/jquery.min.js', 'app'],
tmpl: '*'
});

!

// Serve this client on the root URL
ss.http.route('/', function(req, res){
res.serveClient('main');
});
// My SocketStream 0.3 app

!

var http = require('http'),
ss = require('socketstream');

!

// Define a single-page client called 'main'
ss.client.define('main', {
view: 'app.html',
css: ['libs/reset.css', 'app.styl'],
code: ['libs/jquery.min.js', 'app'],
tmpl: '*'
});

!

// Serve this client on the root URL
ss.http.route('/', function(req, res){
res.serveClient('main');
});
// My SocketStream 0.3 app

!

var http = require('http'),
ss = require('socketstream');

!

// Define a single-page client called 'main'
ss.client.define('main', {
view: 'app.html',
css: ['libs/reset.css', 'app.styl'],
code: ['libs/jquery.min.js', 'app'],
tmpl: '*'
});

!

// Serve this client on the root URL
ss.http.route('/', function(req, res){
res.serveClient('main');
});
// My SocketStream 0.3 app

!

var http = require('http'),
ss = require('socketstream');

!

// Define a single-page client called 'main'
ss.client.define('main', {
view: 'app.html',
css: ['libs/reset.css', 'app.styl'],
code: ['libs/jquery.min.js', 'app'],
tmpl: '*'
});

!

// Serve this client on the root URL
ss.http.route('/', function(req, res){
res.serveClient('main');
});

Recommended for you

Message in a Bottle
Message in a BottleMessage in a Bottle
Message in a Bottle

This document discusses different methods for client-client and client-server communication using HTML5, including desktop notifications, postMessage for cross-window messaging, CORS for cross-origin resource sharing, and server-sent events for streaming data from the server to client. It provides an overview and examples of how each technique works and when they should be used, such as desktop notifications for browser-based apps, postMessage for communication between iframes or popups, CORS for making cross-domain AJAX requests, and server-sent events for push notifications from server without websockets.

corshtml5festhtml5
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor

Meteor is a reactive web application framework that uses JavaScript on both the client and server. It provides reactivity through Tracker.autorun, which re-runs functions automatically when reactive data sources change. Meteor uses DDP for client-server communication and Minimongo, a MongoDB implementation, for client-side data caching. The document provides steps for creating a basic Meteor application with user accounts, routing, schemas, forms, and template helpers to display posts data reactively.

node.jsmongodbjavascript
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern AppsMeteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps

These are the slides for the talk Emily Stark and I presented at MIT on September 9, 2014. We talked about the components that make up Meteor and how they fit together, finishing off with a more in-depth discussion of DDP, Meteor's Distributed Data Protocol.

mitjavascriptmeteor
SocketStream uses
Browserify to handle
requiring JS files
Browserify allows us to
use a Node.js style of
requiring JS files
// This file automatically gets called first by
SocketStream and must always exist

!

// Make 'ss' available to all modules and the
browser console
window.ss = require('socketstream');

!

ss.server.on('disconnect', function(){
console.log('Connection down :-(');
});

!

ss.server.on('reconnect', function(){
console.log('Connection back up :-)');
});

!

ss.server.on('ready', function(){

!

!
!

// Wait for the DOM to finish loading
jQuery(function(){
// Load app
require('/app');
});

});
// This file automatically gets called first by
SocketStream and must always exist

!

// Make 'ss' available to all modules and the
browser console
window.ss = require('socketstream');

!

ss.server.on('disconnect', function(){
console.log('Connection down :-(');
});

!

ss.server.on('reconnect', function(){
console.log('Connection back up :-)');
});

!

ss.server.on('ready', function(){

!

!
!

// Wait for the DOM to finish loading
jQuery(function(){
// Load app
require('/app');
});

});

Recommended for you

nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt

This document provides an overview of Node.js and how to build web applications with it. It discusses asynchronous and synchronous reading and writing of files using the fs module. It also covers creating HTTP servers and clients to handle network requests, as well as using common Node modules like net, os, and path. The document demonstrates building a basic web server with Express to handle GET and POST requests, and routing requests to different handler functions based on the request path and method.

Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client

The document discusses the evolution of web applications from thin clients with fat servers to more balanced architectures. New browser technologies like HTML5, faster JavaScript engines, local storage, and offline capabilities allow more processing to be done locally on the client. This enables richer interfaces, offline usage, and more balanced work distribution between the client and server. It provides examples of how a web application may utilize these new capabilities, such as storing data locally and caching interfaces while communicating with a server via JSON.

AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx

This power point presentation provides an overview of advance Java topics including servlets, session handling, database handling, JSP, Struts, MVC, and Hibernate. It begins with a brief introduction of Java and its history. It then discusses advance Java topics like J2EE, servlets, session handling using different techniques. It also covers database handling using JDBC and topics like JSP, Struts framework, MVC pattern, Tiles framework, and Hibernate for object-relational mapping.

HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
Over the years, developers
have come up with new
languages to generate
HTML, CSS, and JavaScript
SocketStream allows
developers to use these
code preprocessors in
their apps
Adding a preprocessor is simple

// Code Formatters
ss.client.formatters.add(require('ss-stylus'));

Recommended for you

End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...

Here are the slides from my talk at Ember London meetup June 2018 on End-to-end testing Single Page Apps & APIs with Cucumber.js and Puppeteer

node.jsember.jscucumber
Objection.js, a SQL ORM
Objection.js, a SQL ORMObjection.js, a SQL ORM
Objection.js, a SQL ORM

- Objection.js is a SQL ORM that allows you to define models for tables using ES6 classes and define relationships between them. It uses Knex for building SQL queries and managing database schemas. - The presentation demonstrates how to install Objection.js and Knex, create database migrations to manage schema changes, define models and relationships, perform queries, add validation, and use plugins like Objection-GraphQL and Objection-Password. - The speaker also announces that they are launching their own consultancy called ANEPHENIX and will be available for contracting work beginning in mid-June.

node.jsormobjection.js
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer

This document discusses end-to-end testing of single page applications and APIs using Cucumber.js and Puppeteer. It explains that E2E testing an SPA needs to handle loading the SPA, API, databases, and test data. An effective strategy must coordinate setup and teardown across components and be flexible to changes. The document then provides a 7 step process for using Cucumber.js to describe features, run automated tests, and provide living documentation. It also discusses using Puppeteer to control the browser from Node.js. Finally, it provides an example of using these tools together to test the Dashku application, which loads the SPA and API as modules, manages test data in MongoDB, and abstract

node.jscucumberpuppeteer
For Javascript

•

SS-COFFEE - supports using CoffeeScript

•

SS-GORILLA - supports using GorillaScript
For CSS

•

SS-STYLUS - supports using Stylus

•

SS-LESS - supports using Less
For HTML Views

•

SS-JADE - supports using Jade
For HTML Templating

•

SS-HOGAN - supports using Twitter's Hogan.js

•

SS-COFFEEKUP - supports using CoffeeKup

Recommended for you

Lnug jan 2018
Lnug jan 2018Lnug jan 2018
Lnug jan 2018

A lightning talk on creating PowerPoint files with Officegen and Node.js. Delivered at the LNUG January 2018 meet up

node.jspowerpointoffice
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit

Node Webkit allows you to create desktop applications using HTML, CSS, JavaScript and Node.js modules. It combines the Chromium browser and Node.js framework. This allows building cross-platform desktop apps that can include Node functionality and access system resources. Examples are given of apps built with Node Webkit. Key aspects covered include how it integrates Chromium and Node.js, building a basic app, window rendering options, menus, tray apps, and the developer tools. Benefits for a medical conference app replacement are discussed.

node.js
Geokit In Social Apps
Geokit In Social AppsGeokit In Social Apps
Geokit In Social Apps

Geokit is a Ruby gem and Rails plugin that provides geocoding and geographic distance/heading/midpoint calculation services. It supports geocoding addresses, latitude/longitude coordinates, and IP addresses. The gem contains classes for mappable models, geocoders, and distance/bounds calculations. Geokit can be used to geocode records and perform location-based searches in Rails applications. It has some limitations like not supporting SQLite or older PostgreSQL versions.

rubyrailsgeokit
Setting a Templating engine

// Use server-side compiled Hogan (Mustache)
templates. Others engines available
ss.client.templateEngine.use(require('ss-hogan'));
HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
Having to press F5 to reload
the page in order to view
changes to HTML/CSS/JS...
... is not a fun experience

Recommended for you

Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides

If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights. During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to: - Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value - Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems - Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors - Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported - Look Ahead: Gain insights into where FME is headed with coordinate systems in the future Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!

Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...

This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator. Link to presentation recording and slides: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/ Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.

a11yaccessibilityalt text
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024

Everything that I found interesting last month about the irresponsible use of machine intelligence

quantumfaxmachine
In development mode,
SocketStream will watch the
client files for changes, and
reload the page when they
occur
In the case of CSS,
SocketStream will apply
the changes without
reloading the page
HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
Client-side HTML
templates are made
available to the browser
via the ss.tmpl object

Recommended for you

7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf

Solar Storms (Geo Magnetic Storms) are the motion of accelerated charged particles in the solar environment with high velocities due to the coronal mass ejection (CME).

solar storms
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy

Not so much to say

BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf

Presented at Gartner Data & Analytics, London Maty 2024. BT Group has used the Neo4j Graph Database to enable impressive digital transformation programs over the last 6 years. By re-imagining their operational support systems to adopt self-serve and data lead principles they have substantially reduced the number of applications and complexity of their operations. The result has been a substantial reduction in risk and costs while improving time to value, innovation, and process automation. Join this session to hear their story, the lessons they learned along the way and how their future innovation plans include the exploration of uses of EKG + Generative AI.

neo4jneo4j webinarsgraph database
SocketStream
HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
When you're building a
single page app, you'll
have a lot of JS files, and
maybe a few CSS files
But serving a HTML
page with lots of these
files can take time, and
is inefficient

Recommended for you

Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time

Is your patent a vanity piece of paper for your office wall? Or is it a reliable, defendable, assertable, property right? The difference is often quality. Is your patent simply a transactional cost and a large pile of legal bills for your startup? Or is it a leverageable asset worthy of attracting precious investment dollars, worth its cost in multiples of valuation? The difference is often quality. Is your patent application only good enough to get through the examination process? Or has it been crafted to stand the tests of time and varied audiences if you later need to assert that document against an infringer, find yourself litigating with it in an Article 3 Court at the hands of a judge and jury, God forbid, end up having to defend its validity at the PTAB, or even needing to use it to block pirated imports at the International Trade Commission? The difference is often quality. Quality will be our focus for a good chunk of the remainder of this season. What goes into a quality patent, and where possible, how do you get it without breaking the bank? ** Episode Overview ** In this first episode of our quality series, Kristen Hansen and the panel discuss: ⦿ What do we mean when we say patent quality? ⦿ Why is patent quality important? ⦿ How to balance quality and budget ⦿ The importance of searching, continuations, and draftsperson domain expertise ⦿ Very practical tips, tricks, examples, and Kristen’s Musts for drafting quality applications https://www.aurorapatents.com/patently-strategic-podcast.html

patentspatent applicationpatent prosecution
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL

Blockchain technology is transforming industries and reshaping the way we conduct business, manage data, and secure transactions. Whether you're new to blockchain or looking to deepen your knowledge, our guidebook, "Blockchain for Dummies", is your ultimate resource.

blockchainweb3blockchain technology
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter

Widya Salim and Victor Ma will outline the causal impact analysis, framework, and key learnings used to quantify the impact of reducing Twitter's network latency.

SocketStream provides a
way to concatenate, minify,
and GZip these files into 1
JS and 1 CSS file
This saves bytes being
transferred, as well as
reducing the number of
HTTP requests you make
Also, you can tell
SocketStream to load
these files from a CDN
Setting a Templating engine

// Minimize and pack assets if you type: SS_ENV=production node app.js
if (ss.env === 'production') ss.client.packAssets();

Recommended for you

Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024

This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator. Link to presentation recording and transcript: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/ Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.

a11yaccessibilityalt text
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx

Your comprehensive guide to RPA in healthcare for 2024. Explore the benefits, use cases, and emerging trends of robotic process automation. Understand the challenges and prepare for the future of healthcare automation

rpa in healthcarerpa in healthcare usarpa in healthcare industry
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024

Everything that I found interesting about machines behaving intelligently during June 2024

quantumfaxmachine
HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
Web Workers are handy
for intensive client-side
JS operations
SocketStream provides
support for using Web
Workers in your app
First, create a folder

Recommended for you

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf

In the modern digital era, social media platforms have become integral to our daily lives. These platforms, including Facebook, Instagram, WhatsApp, and Snapchat, offer countless ways to connect, share, and communicate.

social media hackerfacebook hackerhire a instagram hacker
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM

Quantum Communications Q&A with Gemini LLM. These are based on Shannon's Noisy channel Theorem and offers how the classical theory applies to the quantum world.

quantum communicationsshannon's channel theoremclassical theory
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses

CIO Council Cal Poly Humboldt September 22, 2023

national research platformdistributed supercomputerdistributed systems
Next, put your web worker files in
that folder
Then, load the worker in a client
code file, and enjoy
HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
SocketStream uses
Connect middleware to
support HTTP features

Recommended for you

find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges

accommodate the strengths, weaknesses, threats and opportunities of autonomous vehicles

automotive self-driving car technology
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...

Have you noticed the OpenSSF Scorecard badges on the official Dart and Flutter repos? It's Google's way of showing that they care about security. Practices such as pinning dependencies, branch protection, required reviews, continuous integration tests etc. are measured to provide a score and accompanying badge. You can do the same for your projects, and this presentation will show you how, with an emphasis on the unique challenges that come up when working with Dart and Flutter. The session will provide a walkthrough of the steps involved in securing a first repository, and then what it takes to repeat that process across an organization with multiple repos. It will also look at the ongoing maintenance involved once scorecards have been implemented, and how aspects of that maintenance can be better automated to minimize toil.

dartflutteropenssf
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf

Support en anglais diffusé lors de l'événement 100% IA organisé dans les locaux parisiens d'Iguane Solutions, le mardi 2 juillet 2024 : - Présentation de notre plateforme IA plug and play : ses fonctionnalités avancées, telles que son interface utilisateur intuitive, son copilot puissant et des outils de monitoring performants. - REX client : Cyril Janssens, CTO d’ easybourse, partage son expérience d’utilisation de notre plateforme IA plug & play.

genaicloudrgpd
SocketStream uses the following
middleware by default:
•

compress - for GZipping assets

•

cookieParser - for handling user tracking

•

favicon - for serving a favicon.ico file

•

session - for handling sessions

•

static - for serving static assets
SocketStream uses the following
middleware by default:
•

compress middleware is loaded first, before all
other middleware

•

static middleware is loaded last, after all other
middleware
SocketStream provides
a way to load custom
middleware into the
connect stack
ss.http.middleware.prepend()
ss.http.middleware.append()

Recommended for you

What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024

This is a powerpoint that features Microsoft Teams Devices and everything that is new including updates to its software and devices for May 2024

microsoft teamsmicrosoft
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence

Our Linux Web Hosting plans offer unbeatable performance, security, and scalability, ensuring your website runs smoothly and efficiently. Visit- https://onliveserver.com/linux-web-hosting/

cheap linux hosting
This allows you to use all
of the connect
middleware out there
today, i.e. EveryAuth
HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
We use connect’s session
middleware, so authentication
can be done with either
EveryAuth, PassportJS, or you
can roll your own.
We also recommend
using connect-redis

Recommended for you

Both HTTP and
WebSocket interfaces
can get/set the session
data
Via HTTP
// app.js
ss.http.router.on('/updateSession', function(req, res) {
req.session.myVar = 4321;
res.end('req.session.myVar has been updated to', req.session.myVar);
});
Via WebSockets
HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility

Recommended for you

RPC is a common
pattern for clients
requesting data from
the server
SocketStream provides
a way to construct RPC
APIs with flexibility
SocketStream
SocketStream

Recommended for you

HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
PubSub is a great
pattern for Single Page
Apps
SocketStream handles
this in various ways:
1 - Publishing to everyone
viewing the app right now
Server
ss.publish.all('newMessage', message);

// Broadcast the message to everyone

Client
// Listen out for newMessage events coming from the server
ss.event.on('newMessage', function(message) {
// do something with the message
});

Recommended for you

2 - Sending to private channels
Server (subscribe/unsubscribe the session )
// in a /server/rpc file after calling req.use('session') middleware

!

req.session.channel.subscribe('disney')

!

req.session.channel.unsubscribe('kids')

!

req.session.channel.reset()

// unsubscribes the session from every channel

req.session.channel.list()

// shows what channels are subscribed to

!
2 - Sending to private channels
Server (publish to channel)
// in a /server/rpc file
ss.publish.channel('disney', 'chatMessage', {from: 'jerry', message: 'Has anyone seen
Tom?'});

Client (receive channel message)
// in a /client/code file
ss.event.on('chatMessage', function(msg, channelName){
console.log('The following message was sent to the ' + channelName + ' channel:', msg);
});
3 - Sending to users
Server
// in a /server/rpc file
ss.publish.user('fred', 'specialOffer', 'Here is a special offer just for you!');
4 - Sending to a browser
tab
Server
// in a /server/rpc file
ss.publish.socketId('254987654324567', 'justForMe', 'Just for one tab');

Recommended for you

HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
On top of RPC and PubSub,
SocketStream provides you
with a way to create custom
request responders
Request Response is
basically a WebSocket
message handler
It allows you to write
message handling for
games, where every
byte matters

Recommended for you

HTML / CSS / JS
code preprocessing

Minifying CSS/JS for
production use

Client-side code
organisation

HTML Templates

WebSocket
Management

Live Reload

Building RPC APIs

Building PubSub APIs

Session Management

Building custom APIs
on top of WS

Web Workers

Connect middleware
compatibility
WebSockets are not
immortal…
They are mangled by
mobile networks…
Blocked by firewalls…

Recommended for you

Routed to dead ends by
proxy servers
And severed by train
tunnels
Also, browser support
for WebSockets isn’t
guaranteed
You need a transport
strategy

Recommended for you

Originally, SocketStream
used Socket.io
But Socket.io asserted
that if a browser
supported WebSockets,
then it would work
They learned from this,
by building Engine.io
I created the transport
wrapper for Engine.io in
SocketStream for
Bechtel & Dashku

Recommended for you

And designed it to
reconnect the client
when severed
Months later, it made it’s
way into SocketStream’s
core.
SocketStream let’s you
use this, alongside
SockJS
…and that is
SocketStream in a
nutshell. Whew!

Recommended for you

Let’s look at some
SocketStream apps in
the wild
Hollow
hollowdocumentary.com
Vmux
vmux.co
Dashku
dashku.com

Recommended for you

SocketStream plugins
SS-BACKBONE
SS-ANGULAR
SS-CUCUMBER

Recommended for you

Tips for deploying
SocketStream in
production
1 - Check your server’s
ulimit configuration
(This can bite you hard)
I learned this when Dashku went
#1 on Hacker News in 45min
2 - Use HTTPS, but
handle it at the load
balancer level rather
than at the app level

Recommended for you

HTTPS helps to improve
the stability of WebSocket
connections, especially
on mobile devices
But Node’s HTTPS
implementation is
noticeably slower than
using HAProxy or Nginx
Where is SocketStream
going next?
We’re in the process of
getting SocketStream’s
test coverage up

Recommended for you

We’re also trying to
close some ancient
bugs
We also need better
documentation
We’re giving the web
site an overhaul
And we want to
document how
SocketStream’s internals
function, to help build 0.4

Recommended for you

but what about 0.4?
…0.4 is starting to look like these:
I promise you all, it’s
coming in June 2014
Thank You

Recommended for you

More Related Content

What's hot

WordPress and Ajax
WordPress and AjaxWordPress and Ajax
WordPress and Ajax
Ronald Huereca
 
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao PauloHTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
Robert Nyman
 
Mastering Grunt
Mastering GruntMastering Grunt
Mastering Grunt
Spencer Handley
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
Remy Sharp
 
Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service Worker
Chang W. Doh
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
Greg Whalin
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
Justin Cataldo
 
JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patterns
Stoyan Stefanov
 
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance Patterns
Stoyan Stefanov
 
High Performance Social Plugins
High Performance Social PluginsHigh Performance Social Plugins
High Performance Social Plugins
Stoyan Stefanov
 
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)
Nicholas Zakas
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin
Justin Ryan
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
Nicholas Zakas
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
Marc Grabanski
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashed
Peter Lubbers
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!
Nicholas Zakas
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery Plugins
Marc Grabanski
 
Liking performance
Liking performanceLiking performance
Liking performance
Stoyan Stefanov
 
Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared To
Raymond Camden
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player
Jim Jeffers
 

What's hot (20)

WordPress and Ajax
WordPress and AjaxWordPress and Ajax
WordPress and Ajax
 
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao PauloHTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
HTML5, The Open Web, and what it means for you - MDN Hack Day, Sao Paulo
 
Mastering Grunt
Mastering GruntMastering Grunt
Mastering Grunt
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
 
Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service Worker
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patterns
 
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance Patterns
 
High Performance Social Plugins
High Performance Social PluginsHigh Performance Social Plugins
High Performance Social Plugins
 
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashed
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery Plugins
 
Liking performance
Liking performanceLiking performance
Liking performance
 
Building a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared To
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player
 

Viewers also liked

Web Crawling with NodeJS
Web Crawling with NodeJSWeb Crawling with NodeJS
Web Crawling with NodeJS
Sylvain Zimmer
 
Lambda Architecture with Spark
Lambda Architecture with SparkLambda Architecture with Spark
Lambda Architecture with Spark
Knoldus Inc.
 
Test in action – week 1
Test in action – week 1Test in action – week 1
Test in action – week 1
Yi-Huan Chan
 
Ese Neno Da Rua
Ese Neno Da RuaEse Neno Da Rua
Ese Neno Da Rua
rosal0453
 
Aspen Lion
Aspen LionAspen Lion
Aspen Lion
Kelly Berry
 
Segundo Caraujulca Galvez
Segundo Caraujulca GalvezSegundo Caraujulca Galvez
Segundo Caraujulca Galvez
Isabel Caruajulca
 
Springbreak Workshop
Springbreak WorkshopSpringbreak Workshop
Springbreak Workshop
emmer
 
Who Is Muhammad (Pbuh)
Who Is Muhammad (Pbuh)Who Is Muhammad (Pbuh)
Who Is Muhammad (Pbuh)
Syukran
 
Proyek penciptaan dan digitalisasi konten
Proyek penciptaan dan digitalisasi kontenProyek penciptaan dan digitalisasi konten
Proyek penciptaan dan digitalisasi konten
Wikimedia Indonesia
 
Lontar class 2
Lontar class 2Lontar class 2
Lontar class 2
Wikimedia Indonesia
 
Lesson16vocab
Lesson16vocabLesson16vocab
Lesson16vocab
PEDH
 
洋服はあなたの良さを引き立てるコミュニケーション
洋服はあなたの良さを引き立てるコミュニケーション洋服はあなたの良さを引き立てるコミュニケーション
洋服はあなたの良さを引き立てるコミュニケーション
Naoko Kawachi
 
Proposal Bebaskan Pengetahuan 2014
Proposal Bebaskan Pengetahuan 2014Proposal Bebaskan Pengetahuan 2014
Proposal Bebaskan Pengetahuan 2014
Wikimedia Indonesia
 
DoInk2'
DoInk2'DoInk2'
DoInk2'
allie_allison
 
how to get a job in advertising
how to get a job in advertisinghow to get a job in advertising
how to get a job in advertising
Helen Klein Ross
 
Presentatie ExcellentSecretary
Presentatie ExcellentSecretaryPresentatie ExcellentSecretary
Presentatie ExcellentSecretary
marckuipers
 
QUESTION 7
QUESTION 7QUESTION 7
QUESTION 7
TomWallace1301
 
State and Capital Game
State and Capital GameState and Capital Game
State and Capital Game
orange_pizza
 
Kelas lontar 1
Kelas lontar 1Kelas lontar 1
Kelas lontar 1
Wikimedia Indonesia
 
Vocab lesson 11
Vocab lesson 11Vocab lesson 11
Vocab lesson 11
PEDH
 

Viewers also liked (20)

Web Crawling with NodeJS
Web Crawling with NodeJSWeb Crawling with NodeJS
Web Crawling with NodeJS
 
Lambda Architecture with Spark
Lambda Architecture with SparkLambda Architecture with Spark
Lambda Architecture with Spark
 
Test in action – week 1
Test in action – week 1Test in action – week 1
Test in action – week 1
 
Ese Neno Da Rua
Ese Neno Da RuaEse Neno Da Rua
Ese Neno Da Rua
 
Aspen Lion
Aspen LionAspen Lion
Aspen Lion
 
Segundo Caraujulca Galvez
Segundo Caraujulca GalvezSegundo Caraujulca Galvez
Segundo Caraujulca Galvez
 
Springbreak Workshop
Springbreak WorkshopSpringbreak Workshop
Springbreak Workshop
 
Who Is Muhammad (Pbuh)
Who Is Muhammad (Pbuh)Who Is Muhammad (Pbuh)
Who Is Muhammad (Pbuh)
 
Proyek penciptaan dan digitalisasi konten
Proyek penciptaan dan digitalisasi kontenProyek penciptaan dan digitalisasi konten
Proyek penciptaan dan digitalisasi konten
 
Lontar class 2
Lontar class 2Lontar class 2
Lontar class 2
 
Lesson16vocab
Lesson16vocabLesson16vocab
Lesson16vocab
 
洋服はあなたの良さを引き立てるコミュニケーション
洋服はあなたの良さを引き立てるコミュニケーション洋服はあなたの良さを引き立てるコミュニケーション
洋服はあなたの良さを引き立てるコミュニケーション
 
Proposal Bebaskan Pengetahuan 2014
Proposal Bebaskan Pengetahuan 2014Proposal Bebaskan Pengetahuan 2014
Proposal Bebaskan Pengetahuan 2014
 
DoInk2'
DoInk2'DoInk2'
DoInk2'
 
how to get a job in advertising
how to get a job in advertisinghow to get a job in advertising
how to get a job in advertising
 
Presentatie ExcellentSecretary
Presentatie ExcellentSecretaryPresentatie ExcellentSecretary
Presentatie ExcellentSecretary
 
QUESTION 7
QUESTION 7QUESTION 7
QUESTION 7
 
State and Capital Game
State and Capital GameState and Capital Game
State and Capital Game
 
Kelas lontar 1
Kelas lontar 1Kelas lontar 1
Kelas lontar 1
 
Vocab lesson 11
Vocab lesson 11Vocab lesson 11
Vocab lesson 11
 

Similar to SocketStream

Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction
Parth Joshi
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.js
Ayush Mishra
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end apps
Zohar Arad
 
Introduction to node.js
Introduction to  node.jsIntroduction to  node.js
Introduction to node.js
Md. Sohel Rana
 
08 ajax
08 ajax08 ajax
08 ajax
Ynon Perek
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
Anup Hariharan Nair
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Adrien Guéret
 
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
Prof Ansari
 
Node js getting started
Node js getting startedNode js getting started
Node js getting started
Pallavi Srivastava
 
Play framework
Play frameworkPlay framework
Play framework
sambaochung
 
3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web
Dynatrace
 
Building ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS ApplicationsBuilding ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS Applications
ColdFusionConference
 
Testable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascriptTestable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascript
Timothy Oxley
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When
FITC
 
Message in a Bottle
Message in a BottleMessage in a Bottle
Message in a Bottle
Zohar Arad
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
Sapna Upreti
 
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern AppsMeteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Sashko Stubailo
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
WalaSidhom1
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client
Paul Klipp
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
SachinSingh217687
 

Similar to SocketStream (20)

Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.js
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end apps
 
Introduction to node.js
Introduction to  node.jsIntroduction to  node.js
Introduction to node.js
 
08 ajax
08 ajax08 ajax
08 ajax
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
 
Node js getting started
Node js getting startedNode js getting started
Node js getting started
 
Play framework
Play frameworkPlay framework
Play framework
 
3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web3 Tips to Deliver Fast Performance Across Mobile Web
3 Tips to Deliver Fast Performance Across Mobile Web
 
Building ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS ApplicationsBuilding ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS Applications
 
Testable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascriptTestable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascript
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When
 
Message in a Bottle
Message in a BottleMessage in a Bottle
Message in a Bottle
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
 
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern AppsMeteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 

More from Paul Jensen

End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
Paul Jensen
 
Objection.js, a SQL ORM
Objection.js, a SQL ORMObjection.js, a SQL ORM
Objection.js, a SQL ORM
Paul Jensen
 
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
Paul Jensen
 
Lnug jan 2018
Lnug jan 2018Lnug jan 2018
Lnug jan 2018
Paul Jensen
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
Paul Jensen
 
Geokit In Social Apps
Geokit In Social AppsGeokit In Social Apps
Geokit In Social Apps
Paul Jensen
 

More from Paul Jensen (6)

End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
 
Objection.js, a SQL ORM
Objection.js, a SQL ORMObjection.js, a SQL ORM
Objection.js, a SQL ORM
 
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
 
Lnug jan 2018
Lnug jan 2018Lnug jan 2018
Lnug jan 2018
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
Geokit In Social Apps
Geokit In Social AppsGeokit In Social Apps
Geokit In Social Apps
 

Recently uploaded

Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 

Recently uploaded (20)

Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 

SocketStream

  • 2. A web framework for single page apps
  • 7. With a traditional web app, the user has to refresh the page to see new information
  • 12. I wonder what the latest score is… Let’s reload the page Client Server Time
  • 14. HTTP/1.1 304 Not Modified Client Server Time
  • 16. The user had to press F5 to get at any new information Client Server Time
  • 17. Client Server Time Even though there was no new information, the server still had to serve the HTTP request
  • 18. This is not a fun experience
  • 19. How do we make this better?
  • 21. We could use AJAX to update the page
  • 22. We’d save the user having to press the F5 key
  • 23. What else can we do?
  • 27. Avoid sending data we already have on the client
  • 28. We could also separate the HTML from the data
  • 29. Reuse the HTML on the client
  • 30. …and use the server to provide you with just data
  • 31. And the web site becomes a client Web App Native App Server API User
  • 32. The server is just an API
  • 34. Overview • The server becomes a REST API serving JSON • HTML compilation is done on the client • As a result, less processing & bandwidth is consumed by the server
  • 37. Polling the server every [n] seconds for new data is redundant
  • 38. There has to be a better way
  • 39. What if the server could send its client(s) new data as soon as it came about?
  • 40. We can, thanks to WebSockets
  • 41. WebSockets allows data to be sent both ways
  • 44. The server sends a message to the client that an action has occurred Client Server Time Goal
  • 45. We eliminate the need to poll the server for new data
  • 46. Overview • We can replace AJAX polling with WebSockets, and provide a better user experience as a result • We also remove the need to make redundant polling requests back to the server. • We use WebSockets for sending/receiving JSON
  • 47. Single Page Apps + The Realtime Web
  • 48. There are many ways to build this kind of app
  • 49. You could build it mostly from scratch, and use Express + Socket.io
  • 50. Or alternatively, you could use a web framework like Meteor or Firebase
  • 52. It provides tools to help with building realtime single page apps...
  • 53. ... Whilst trying not to restrict what technologies you can use with your app
  • 54. For example, we don't provide an ORM. Instead, you choose the database & the ORM
  • 55. Also, we don't mandate using a specific client-side framework ! You can use BackBone, Angular, Ember, or something else, that is entirely your choice.
  • 56. What we focus on instead are these things:
  • 57. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 58. I'll run through each of these, 1-by-1. But first, let's look at how to use SocketStream
  • 59. Getting started npm install -g socketstream ! socketstream new my_app
  • 60. Getting started ! ! ! ! Success! Created app 'my_app' with: ✓ Basic chat demo (-m for minimal install) ✓ Javascript example code (-c if you prefer CoffeeScript) ✓ Plain HTML for views (-j if you prefer Jade) Next, run the following commands: cd my_app [sudo] npm install To start your app: node app.js

  • 61. Here's what the initial file/ folder structure looks like
  • 62. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 63. Client code is organised into 5 sub-folders
  • 64. Client side code organisation • CODE stores client side JavaScript files and libraries • CSS stores CSS files • STATIC stores public files like images, font files, and other assets • TEMPLATES stores HTML templates for the single page app to render on the client • VIEWS stores HTML files that are rendered from the server for the initial page
  • 65. Those sub-folders have subfolders, but are optional
  • 66. This is how we load them // My SocketStream 0.3 app ! var http = require('http'), ss = require('socketstream'); ! // Define a single-page client called 'main' ss.client.define('main', { view: 'app.html', css: ['libs/reset.css', 'app.styl'], code: ['libs/jquery.min.js', 'app'], tmpl: '*' }); ! // Serve this client on the root URL ss.http.route('/', function(req, res){ res.serveClient('main'); });
  • 67. // My SocketStream 0.3 app ! var http = require('http'), ss = require('socketstream'); ! // Define a single-page client called 'main' ss.client.define('main', { view: 'app.html', css: ['libs/reset.css', 'app.styl'], code: ['libs/jquery.min.js', 'app'], tmpl: '*' }); ! // Serve this client on the root URL ss.http.route('/', function(req, res){ res.serveClient('main'); });
  • 68. // My SocketStream 0.3 app ! var http = require('http'), ss = require('socketstream'); ! // Define a single-page client called 'main' ss.client.define('main', { view: 'app.html', css: ['libs/reset.css', 'app.styl'], code: ['libs/jquery.min.js', 'app'], tmpl: '*' }); ! // Serve this client on the root URL ss.http.route('/', function(req, res){ res.serveClient('main'); });
  • 69. // My SocketStream 0.3 app ! var http = require('http'), ss = require('socketstream'); ! // Define a single-page client called 'main' ss.client.define('main', { view: 'app.html', css: ['libs/reset.css', 'app.styl'], code: ['libs/jquery.min.js', 'app'], tmpl: '*' }); ! // Serve this client on the root URL ss.http.route('/', function(req, res){ res.serveClient('main'); });
  • 70. // My SocketStream 0.3 app ! var http = require('http'), ss = require('socketstream'); ! // Define a single-page client called 'main' ss.client.define('main', { view: 'app.html', css: ['libs/reset.css', 'app.styl'], code: ['libs/jquery.min.js', 'app'], tmpl: '*' }); ! // Serve this client on the root URL ss.http.route('/', function(req, res){ res.serveClient('main'); });
  • 71. // My SocketStream 0.3 app ! var http = require('http'), ss = require('socketstream'); ! // Define a single-page client called 'main' ss.client.define('main', { view: 'app.html', css: ['libs/reset.css', 'app.styl'], code: ['libs/jquery.min.js', 'app'], tmpl: '*' }); ! // Serve this client on the root URL ss.http.route('/', function(req, res){ res.serveClient('main'); });
  • 72. // My SocketStream 0.3 app ! var http = require('http'), ss = require('socketstream'); ! // Define a single-page client called 'main' ss.client.define('main', { view: 'app.html', css: ['libs/reset.css', 'app.styl'], code: ['libs/jquery.min.js', 'app'], tmpl: '*' }); ! // Serve this client on the root URL ss.http.route('/', function(req, res){ res.serveClient('main'); });
  • 73. SocketStream uses Browserify to handle requiring JS files
  • 74. Browserify allows us to use a Node.js style of requiring JS files
  • 75. // This file automatically gets called first by SocketStream and must always exist ! // Make 'ss' available to all modules and the browser console window.ss = require('socketstream'); ! ss.server.on('disconnect', function(){ console.log('Connection down :-('); }); ! ss.server.on('reconnect', function(){ console.log('Connection back up :-)'); }); ! ss.server.on('ready', function(){ ! ! ! // Wait for the DOM to finish loading jQuery(function(){ // Load app require('/app'); }); });
  • 76. // This file automatically gets called first by SocketStream and must always exist ! // Make 'ss' available to all modules and the browser console window.ss = require('socketstream'); ! ss.server.on('disconnect', function(){ console.log('Connection down :-('); }); ! ss.server.on('reconnect', function(){ console.log('Connection back up :-)'); }); ! ss.server.on('ready', function(){ ! ! ! // Wait for the DOM to finish loading jQuery(function(){ // Load app require('/app'); }); });
  • 77. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 78. Over the years, developers have come up with new languages to generate HTML, CSS, and JavaScript
  • 79. SocketStream allows developers to use these code preprocessors in their apps
  • 80. Adding a preprocessor is simple // Code Formatters ss.client.formatters.add(require('ss-stylus'));
  • 81. For Javascript • SS-COFFEE - supports using CoffeeScript • SS-GORILLA - supports using GorillaScript
  • 82. For CSS • SS-STYLUS - supports using Stylus • SS-LESS - supports using Less
  • 83. For HTML Views • SS-JADE - supports using Jade
  • 84. For HTML Templating • SS-HOGAN - supports using Twitter's Hogan.js • SS-COFFEEKUP - supports using CoffeeKup
  • 85. Setting a Templating engine // Use server-side compiled Hogan (Mustache) templates. Others engines available ss.client.templateEngine.use(require('ss-hogan'));
  • 86. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 87. Having to press F5 to reload the page in order to view changes to HTML/CSS/JS...
  • 88. ... is not a fun experience
  • 89. In development mode, SocketStream will watch the client files for changes, and reload the page when they occur
  • 90. In the case of CSS, SocketStream will apply the changes without reloading the page
  • 91. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 92. Client-side HTML templates are made available to the browser via the ss.tmpl object
  • 94. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 95. When you're building a single page app, you'll have a lot of JS files, and maybe a few CSS files
  • 96. But serving a HTML page with lots of these files can take time, and is inefficient
  • 97. SocketStream provides a way to concatenate, minify, and GZip these files into 1 JS and 1 CSS file
  • 98. This saves bytes being transferred, as well as reducing the number of HTTP requests you make
  • 99. Also, you can tell SocketStream to load these files from a CDN
  • 100. Setting a Templating engine // Minimize and pack assets if you type: SS_ENV=production node app.js if (ss.env === 'production') ss.client.packAssets();
  • 101. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 102. Web Workers are handy for intensive client-side JS operations
  • 103. SocketStream provides support for using Web Workers in your app
  • 104. First, create a folder
  • 105. Next, put your web worker files in that folder
  • 106. Then, load the worker in a client code file, and enjoy
  • 107. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 108. SocketStream uses Connect middleware to support HTTP features
  • 109. SocketStream uses the following middleware by default: • compress - for GZipping assets • cookieParser - for handling user tracking • favicon - for serving a favicon.ico file • session - for handling sessions • static - for serving static assets
  • 110. SocketStream uses the following middleware by default: • compress middleware is loaded first, before all other middleware • static middleware is loaded last, after all other middleware
  • 111. SocketStream provides a way to load custom middleware into the connect stack
  • 113. This allows you to use all of the connect middleware out there today, i.e. EveryAuth
  • 114. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 115. We use connect’s session middleware, so authentication can be done with either EveryAuth, PassportJS, or you can roll your own.
  • 116. We also recommend using connect-redis
  • 117. Both HTTP and WebSocket interfaces can get/set the session data
  • 118. Via HTTP // app.js ss.http.router.on('/updateSession', function(req, res) { req.session.myVar = 4321; res.end('req.session.myVar has been updated to', req.session.myVar); });
  • 120. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 121. RPC is a common pattern for clients requesting data from the server
  • 122. SocketStream provides a way to construct RPC APIs with flexibility
  • 125. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 126. PubSub is a great pattern for Single Page Apps
  • 128. 1 - Publishing to everyone viewing the app right now Server ss.publish.all('newMessage', message); // Broadcast the message to everyone Client // Listen out for newMessage events coming from the server ss.event.on('newMessage', function(message) { // do something with the message });
  • 129. 2 - Sending to private channels Server (subscribe/unsubscribe the session ) // in a /server/rpc file after calling req.use('session') middleware ! req.session.channel.subscribe('disney') ! req.session.channel.unsubscribe('kids') ! req.session.channel.reset() // unsubscribes the session from every channel req.session.channel.list() // shows what channels are subscribed to !
  • 130. 2 - Sending to private channels Server (publish to channel) // in a /server/rpc file ss.publish.channel('disney', 'chatMessage', {from: 'jerry', message: 'Has anyone seen Tom?'}); Client (receive channel message) // in a /client/code file ss.event.on('chatMessage', function(msg, channelName){ console.log('The following message was sent to the ' + channelName + ' channel:', msg); });
  • 131. 3 - Sending to users Server // in a /server/rpc file ss.publish.user('fred', 'specialOffer', 'Here is a special offer just for you!');
  • 132. 4 - Sending to a browser tab Server // in a /server/rpc file ss.publish.socketId('254987654324567', 'justForMe', 'Just for one tab');
  • 133. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 134. On top of RPC and PubSub, SocketStream provides you with a way to create custom request responders
  • 135. Request Response is basically a WebSocket message handler
  • 136. It allows you to write message handling for games, where every byte matters
  • 137. HTML / CSS / JS code preprocessing Minifying CSS/JS for production use Client-side code organisation HTML Templates WebSocket Management Live Reload Building RPC APIs Building PubSub APIs Session Management Building custom APIs on top of WS Web Workers Connect middleware compatibility
  • 139. They are mangled by mobile networks…
  • 141. Routed to dead ends by proxy servers
  • 142. And severed by train tunnels
  • 143. Also, browser support for WebSockets isn’t guaranteed
  • 144. You need a transport strategy
  • 146. But Socket.io asserted that if a browser supported WebSockets, then it would work
  • 147. They learned from this, by building Engine.io
  • 148. I created the transport wrapper for Engine.io in SocketStream for Bechtel & Dashku
  • 149. And designed it to reconnect the client when severed
  • 150. Months later, it made it’s way into SocketStream’s core.
  • 151. SocketStream let’s you use this, alongside SockJS
  • 152. …and that is SocketStream in a nutshell. Whew!
  • 153. Let’s look at some SocketStream apps in the wild
  • 162. 1 - Check your server’s ulimit configuration (This can bite you hard)
  • 163. I learned this when Dashku went #1 on Hacker News in 45min
  • 164. 2 - Use HTTPS, but handle it at the load balancer level rather than at the app level
  • 165. HTTPS helps to improve the stability of WebSocket connections, especially on mobile devices
  • 166. But Node’s HTTPS implementation is noticeably slower than using HAProxy or Nginx
  • 168. We’re in the process of getting SocketStream’s test coverage up
  • 169. We’re also trying to close some ancient bugs
  • 170. We also need better documentation
  • 171. We’re giving the web site an overhaul
  • 172. And we want to document how SocketStream’s internals function, to help build 0.4
  • 173. but what about 0.4?
  • 174. …0.4 is starting to look like these:
  • 175. I promise you all, it’s coming in June 2014