sproutcore and the future of web apps

40
2.0 3F

Post on 22-Oct-2014

4.170 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: SproutCore and the Future of Web Apps

2.03F

Page 2: SproutCore and the Future of Web Apps

Future of Web AppsFast,

Page 3: SproutCore and the Future of Web Apps

Future of Web AppsFluid,

Page 4: SproutCore and the Future of Web Apps

Future of Web Appsand Feature-rich.

Page 5: SproutCore and the Future of Web Apps

Future of Web AppsLess web, more app

Page 6: SproutCore and the Future of Web Apps

Future of Web AppsMore demanding users

Page 7: SproutCore and the Future of Web Apps

Future of Web AppsWeb-native, no plugins

Page 8: SproutCore and the Future of Web Apps

Future of Web AppsProbably client-server

Page 9: SproutCore and the Future of Web Apps

Building 3F Apps with SproutCore

Mike SubelskyOtherInbox.com

IgniteBaltimore.com

Page 10: SproutCore and the Future of Web Apps

Users Want More

Page 11: SproutCore and the Future of Web Apps
Page 12: SproutCore and the Future of Web Apps
Page 13: SproutCore and the Future of Web Apps
Page 14: SproutCore and the Future of Web Apps
Page 15: SproutCore and the Future of Web Apps
Page 16: SproutCore and the Future of Web Apps

Impossible with “traditional” web 2.0

techniques

Page 17: SproutCore and the Future of Web Apps
Page 18: SproutCore and the Future of Web Apps

remove_messages: function(message_ids,block) { OtherInbox.undo_stack.push(new UndoAction(message_ids,Mailbox.current_id,block)) $('undo').writeAttribute('disabled',null)

var affected_mailboxes = $H() var highest_position = null var msg_count = 0 message_ids.each(function(id) { $('msg_row_' + id).remove() var msg = Message.instances.unset(id) var position = Message.ordered_instance_keys.indexOf(Number(id)) Message.ordered_instance_keys.splice(position,1)

if ((highest_position == null) || (highest_position < position)) highest_position = position msg_count++ })

Mailbox.update_message_count(msg_count)

Page 19: SproutCore and the Future of Web Apps
Page 20: SproutCore and the Future of Web Apps
Page 21: SproutCore and the Future of Web Apps

You Need Client-Server

Page 22: SproutCore and the Future of Web Apps

OI.executeAjax('/refresh', { method: 'get', parameters: parameters, onSuccess: function(transport) { OI._parseServerUpdate( transport ); }});

Page 23: SproutCore and the Future of Web Apps

class RefreshController < ApplicationController before_filter :signin_required

def index render :text => JSON.generate(Refresher.new(params).to_hash) end

end

Page 24: SproutCore and the Future of Web Apps

{"deleted":{},"flash":[],"recordTypes":["Mailbox","User","Folder"],

"changed":{"User":[{"name":"forfun","preferences":null,"guid":3,"type":"User",

"admin":true,"invitationsRemaining":1,"login":"testuser","state":"completed"}],

"created":{"Mailbox":[{"name":"Freeslide","unreadCount":null,"guid":"12",

"folder":"3","priority":"2","type":"Mailbox"}]}}}

Page 25: SproutCore and the Future of Web Apps

HTM

L

CSSJavaScript

Flash

Page 26: SproutCore and the Future of Web Apps

removeMessages: function(msgs) {

SC.Store.destroyRecords();

}

Page 27: SproutCore and the Future of Web Apps

- Charles Jolley

“...writing an app in Javascript on the web is akin to writing C on the desktop: it is just one level above the 'bare metal’.”

Page 28: SproutCore and the Future of Web Apps

SproutCore does 80%

Page 29: SproutCore and the Future of Web Apps

Feels a bit like Rails

Page 30: SproutCore and the Future of Web Apps

Feels a bit like RailsConvention over configuration

Page 31: SproutCore and the Future of Web Apps

Feels a bit like RailsConfiguring components

Page 32: SproutCore and the Future of Web Apps

Feels a bit like RailsUses ERB or Haml

Page 33: SproutCore and the Future of Web Apps

Except totally different

Page 34: SproutCore and the Future of Web Apps

Except totally different

Inspired by Cocoa

Page 35: SproutCore and the Future of Web Apps

Except totally different

Everything is a binding

Page 36: SproutCore and the Future of Web Apps

Except totally different

Trust but verifyif (foo && foo.get(‘importantValue’))

Page 37: SproutCore and the Future of Web Apps

Except totally different

By all means, repeat yourself

Page 38: SproutCore and the Future of Web Apps

Except totally differentJavaScript is awesome

(just avoid the bad parts)

Page 39: SproutCore and the Future of Web Apps

Except totally different

MVC !== MVC

Page 40: SproutCore and the Future of Web Apps

Demo