Community Code: Jarvus Innovations

85
Wednesday, November 2, 2011

description

Chris started programming in high school to support his gaming habits, and co-founded Jarv.us Innovations after dropping out of business school so he could keep playing. He started using ExtJS at version 2 to build administration backends for websites, so when Sencha Touch was released that experience enabled him to quickly train and tool his web development team for building cross-platform mobile apps using the skills they’d already tuned. In addition to leading development at Jarv.us, Chris is the architect of the open-source Emergence platform and helps the Science Leadership Academy apply technology to building the ultimate School 2.0.Ryon has practiced HTML and CSS ever since since elementary school, when his father brought home a photocopy of an HTML2 tutorial and set him up with a text editor and Netscape to tinker. He is a passionate follower of the latest markup and styling techniques, so designing Sencha Touch applications seemed like a natural fit. At Jarvus, a company started by some high school friends, he has had the opportunity to work with some high-profile clients, working their well-known brands into SASS and HTML5.

Transcript of Community Code: Jarvus Innovations

Page 1: Community Code: Jarvus Innovations

Wednesday, November 2, 2011

Page 2: Community Code: Jarvus Innovations

Chris Alfano & Ryon Coleman@themightychris @ryon55

jARV.US SPOTLIGHT

Wednesday, November 2, 2011

Page 3: Community Code: Jarvus Innovations

Overview

Wednesday, November 2, 2011

Page 4: Community Code: Jarvus Innovations

Overview

SENCHA TOUCH

Eagles Draft 2011

Consumer Reports

Christie’s

EXTJS 4

Jarv.us

DynamicWear

GoLive.TV

Wednesday, November 2, 2011

Page 5: Community Code: Jarvus Innovations

Philadelphia Eagles Draft 2011

Wednesday, November 2, 2011

Page 6: Community Code: Jarvus Innovations

Insta-style<!DOCTYPE html><html lang="en"><head>! <style>body{background-color:#033}</style>! <link rel="stylesheet" href="css/eagles-init.css+eagles-sencha.css+eagles-fonts.css+eagles-overrides.css" type="text/css">! <!-- ... --></head><body></body></html>

Wednesday, November 2, 2011

Page 7: Community Code: Jarvus Innovations

Stretchy backgrounds

body {! background: url(../img/backgroundLogo.jpg) no-repeat center center #033;! -webkit-background-size: cover;}

/* OR */

.storeCard {! background: url(../img/storeCard.jpg) no-repeat center top;! -webkit-background-size: contain;}

Wednesday, November 2, 2011

Page 8: Community Code: Jarvus Innovations

On-the-fly CSS & JS minifier<link rel="stylesheet" type="text/css" href="css/eagles-init.css+eagles-sencha.css+eagles-fonts.css+eagles-overrides.css" />

<link rel="stylesheet" href="css/eagles2x.css" media="only screen and (-webkit-min-device-pixel-ratio: 1.5)" />

<script type="text/javascript" src="js/sencha-touch.js+app.js+views/*+models/TwitterProxy.js+models/*"></script>

Wednesday, November 2, 2011

Page 9: Community Code: Jarvus Innovations

<link rel="stylesheet" href="css/eagles-init.css?debug=1" type="text/css"><link rel="stylesheet" href="css/eagles-sencha.css?debug=1" type="text/css"><link rel="stylesheet" href="css/eagles-fonts.css?debug=1" type="text/css"><link rel="stylesheet" href="css/eagles-overrides.css?debug=1" type="text/css">

<link rel="stylesheet" href="css/eagles2x.css" media="only screen and (-webkit-min-device-pixel-ratio: 1.5)" />

<script type="text/javascript" src="js/sencha-touch.js?debug=1"></script><script type="text/javascript" src="js/app.js?debug=1"></script><script type="text/javascript" src="js/views/AppViewport.js?debug=1"></script><script type="text/javascript" src="js/views/ArticleCard.js?debug=1"></script><script type="text/javascript" src="js/views/DraftCard.js?debug=1"></script><script type="text/javascript" src="js/views/LandingCard.js?

Wednesday, November 2, 2011

Page 10: Community Code: Jarvus Innovations

,startAutoRefresh: function() {! this.autoRefreshInterval = setInterval(! ! Ext.createDelegate(this.picksStore.load, this.picksStore)! ! ,this.autoRefreshSeconds * 1000! );}

,onPicksLoaded: function(store, records, success){!!! if(this.isVisible() && this.liveDraft.isVisible())! ! this.seenPicks = records.length;! else! ! this.updateUnseen(records.length);}

,onDraftCardActivated: function() {! this.markSeen();}    ,markSeen: function() {! this.seenPicks = this.picksStore.getCount();! this.updateUnseen(this.seenPicks);}

Wednesday, November 2, 2011

Page 11: Community Code: Jarvus Innovations

Challenges

Lessons Learned

Wednesday, November 2, 2011

Page 12: Community Code: Jarvus Innovations

ChallengesLearn Sencha Touch and SASS theming :)

Lessons Learned

Wednesday, November 2, 2011

Page 13: Community Code: Jarvus Innovations

ChallengesLearn Sencha Touch and SASS theming :)Get and display live updates

Lessons Learned

Wednesday, November 2, 2011

Page 14: Community Code: Jarvus Innovations

ChallengesLearn Sencha Touch and SASS theming :)Get and display live updatesAdapt static images to different screen ratios

Lessons Learned

Wednesday, November 2, 2011

Page 15: Community Code: Jarvus Innovations

ChallengesLearn Sencha Touch and SASS theming :)Get and display live updatesAdapt static images to different screen ratios

Lessons LearnedDestroy DOM when you’re done with it

Wednesday, November 2, 2011

Page 16: Community Code: Jarvus Innovations

ChallengesLearn Sencha Touch and SASS theming :)Get and display live updatesAdapt static images to different screen ratios

Lessons LearnedDestroy DOM when you’re done with itEstablish clear parameters for post-launch content

Wednesday, November 2, 2011

Page 17: Community Code: Jarvus Innovations

ChallengesLearn Sencha Touch and SASS theming :)Get and display live updatesAdapt static images to different screen ratios

Lessons LearnedDestroy DOM when you’re done with itEstablish clear parameters for post-launch content-webkit-background-size

Wednesday, November 2, 2011

Page 18: Community Code: Jarvus Innovations

Wednesday, November 2, 2011

Page 19: Community Code: Jarvus Innovations

Barcode scanning,onScanPress: function() {! if(window.device) {! ! window.plugins.barcodeScanner.scan(! ! ! Ext.createDelegate(this.onBarcodeSuccess, this)! ! ! ,Ext.createDelegate(this.onBarcodeFailure, this)! ! );! } else {! ! alert('barcode scanning is currently only available in native builds');! }}

,onBarcodeSuccess: function(upc) {! CR.views.viewport.executeBarcodeSearch(upc);}

Wednesday, November 2, 2011

Page 20: Community Code: Jarvus Innovations

StackPanel viewportCR.views.viewport.loadCard({! xtype: 'aboutpanel'! ,prevCard: this},{! // optional animation controls! animate: 'slide'! ,direction: 'left'! ,reverse: false! ,cover: false! ,reveal: false!! // optional stack management! ,clearStack: false // true to erase history stack! ,clearAfter: false // pass a panel instance to clear any forward history});

https://github.com/JarvusInnovations/Jarvus.mobile.StackPanel

Wednesday, November 2, 2011

Page 21: Community Code: Jarvus Innovations

DOM destructionthis.on('beforeactivate', function() {! this.setLoading(true);!}, this, {delay: 10});

this.on('activate', function() {! if(this.loaded) {! ! this.setLoading(false);! ! this.list.refresh(); // redraw existing store contents! } else {! ! this.list.store.load({! ! ! scope: this! ! ! ,callback: function() {! ! ! ! this.setLoading(false);! ! ! }! ! });! }}, this);

this.on('beforedeactivate', function() {! this.list.update('');}, this);

Wednesday, November 2, 2011

Page 22: Community Code: Jarvus Innovations

.x-list-item {! .product {! ! -webkit-box-align: stretch;! ! -webkit-box-orient: horizontal;! ! display: -webkit-box;! ! overflow: hidden;! !! ! & > div { -webkit-transition: -webkit-transform 250ms; }!! ! .delete-button-ct {! ! ! -webkit-box-align: center;! ! ! display: -webkit-box;! ! ! margin-right: -85px;! ! ! width: 85px;! ! !! ! ! .x-button { -webkit-box-flex: 1; }! ! }! }!! &.confirm-delete .product > * { -webkit-transform: translate3d(-85px, 0, 0) }}

Wednesday, November 2, 2011

Page 23: Community Code: Jarvus Innovations

Challenges

Lessons Learned

Wednesday, November 2, 2011

Page 24: Community Code: Jarvus Innovations

ChallengesAccess native APIs for barcode scanner

Lessons Learned

Wednesday, November 2, 2011

Page 25: Community Code: Jarvus Innovations

ChallengesAccess native APIs for barcode scannerLocked grid for comparison view

Lessons Learned

Wednesday, November 2, 2011

Page 26: Community Code: Jarvus Innovations

ChallengesAccess native APIs for barcode scannerLocked grid for comparison viewComplex history tracking

Lessons Learned

Wednesday, November 2, 2011

Page 27: Community Code: Jarvus Innovations

ChallengesAccess native APIs for barcode scannerLocked grid for comparison viewComplex history trackingAggregation of disparate data sources in a single view

Lessons Learned

Wednesday, November 2, 2011

Page 28: Community Code: Jarvus Innovations

ChallengesAccess native APIs for barcode scannerLocked grid for comparison viewComplex history trackingAggregation of disparate data sources in a single viewAnimated swipe-to-delete

Lessons Learned

Wednesday, November 2, 2011

Page 29: Community Code: Jarvus Innovations

ChallengesAccess native APIs for barcode scannerLocked grid for comparison viewComplex history trackingAggregation of disparate data sources in a single viewAnimated swipe-to-delete

Lessons LearnedDon’t use tabpanel

Wednesday, November 2, 2011

Page 30: Community Code: Jarvus Innovations

ChallengesAccess native APIs for barcode scannerLocked grid for comparison viewComplex history trackingAggregation of disparate data sources in a single viewAnimated swipe-to-delete

Lessons LearnedDon’t use tabpanelWrap card layout for history

Wednesday, November 2, 2011

Page 31: Community Code: Jarvus Innovations

ChallengesAccess native APIs for barcode scannerLocked grid for comparison viewComplex history trackingAggregation of disparate data sources in a single viewAnimated swipe-to-delete

Lessons LearnedDon’t use tabpanelWrap card layout for history-webkit-box and -webkit-transform3d

Wednesday, November 2, 2011

Page 32: Community Code: Jarvus Innovations

Wednesday, November 2, 2011

Page 33: Community Code: Jarvus Innovations

Make it pop!@mixin background-gradient($bg-color, $type: $base-gradient) {... } @else if $type == 'supergloss' { @include background-image( linear-gradient(color_stops( lighten($bg-color, 40%), lighten($bg-color, 15%) 50%, $bg-color 51%, lighten($bg-color, 5%) )) ); }...

@include sencha-button-ui('action', darken($christies-red, 10%), 'supergloss');

Wednesday, November 2, 2011

Page 34: Community Code: Jarvus Innovations

Challenges

Lessons Learned

Wednesday, November 2, 2011

Page 35: Community Code: Jarvus Innovations

ChallengesRandom access thumbnail gallery

Lessons Learned

Wednesday, November 2, 2011

Page 36: Community Code: Jarvus Innovations

ChallengesRandom access thumbnail galleryThird-party SOAP backend

Lessons Learned

Wednesday, November 2, 2011

Page 37: Community Code: Jarvus Innovations

ChallengesRandom access thumbnail galleryThird-party SOAP backendCustom gradient types

Lessons Learned

Wednesday, November 2, 2011

Page 38: Community Code: Jarvus Innovations

ChallengesRandom access thumbnail galleryThird-party SOAP backendCustom gradient typesForm styling

Lessons Learned

Wednesday, November 2, 2011

Page 39: Community Code: Jarvus Innovations

ChallengesRandom access thumbnail galleryThird-party SOAP backendCustom gradient typesForm stylingZoomable image carousel

Lessons Learned

Wednesday, November 2, 2011

Page 40: Community Code: Jarvus Innovations

ChallengesRandom access thumbnail galleryThird-party SOAP backendCustom gradient typesForm stylingZoomable image carousel(https://github.com/JarvusInnovations/Jarvus.mobile.PinchCarousel)

Lessons Learned

Wednesday, November 2, 2011

Page 41: Community Code: Jarvus Innovations

ChallengesRandom access thumbnail galleryThird-party SOAP backendCustom gradient typesForm stylingZoomable image carousel(https://github.com/JarvusInnovations/Jarvus.mobile.PinchCarousel)

Lessons LearnedDefer loading data until after screen is rendered

Wednesday, November 2, 2011

Page 42: Community Code: Jarvus Innovations

ChallengesRandom access thumbnail galleryThird-party SOAP backendCustom gradient typesForm stylingZoomable image carousel(https://github.com/JarvusInnovations/Jarvus.mobile.PinchCarousel)

Lessons LearnedDefer loading data until after screen is renderedOverride mixins

Wednesday, November 2, 2011

Page 43: Community Code: Jarvus Innovations

ChallengesRandom access thumbnail galleryThird-party SOAP backendCustom gradient typesForm stylingZoomable image carousel(https://github.com/JarvusInnovations/Jarvus.mobile.PinchCarousel)

Lessons LearnedDefer loading data until after screen is renderedOverride mixinsReusable list tpls and box layout

Wednesday, November 2, 2011

Page 44: Community Code: Jarvus Innovations

Wednesday, November 2, 2011

Page 45: Community Code: Jarvus Innovations

Challenges

Lessons Learned

Wednesday, November 2, 2011

Page 46: Community Code: Jarvus Innovations

ChallengesPerformance on a HEAVY page full of images

Lessons Learned

Wednesday, November 2, 2011

Page 47: Community Code: Jarvus Innovations

ChallengesPerformance on a HEAVY page full of imagesMake an animated dataview appear & init quickly

Lessons Learned

Wednesday, November 2, 2011

Page 48: Community Code: Jarvus Innovations

ChallengesPerformance on a HEAVY page full of imagesMake an animated dataview appear & init quickly

Lessons LearnedStack JS builds to minimize load times, avoid dupes

Wednesday, November 2, 2011

Page 49: Community Code: Jarvus Innovations

ChallengesPerformance on a HEAVY page full of imagesMake an animated dataview appear & init quickly

Lessons LearnedStack JS builds to minimize load times, avoid dupes“Stunt double” hack

Wednesday, November 2, 2011

Page 50: Community Code: Jarvus Innovations

ChallengesPerformance on a HEAVY page full of imagesMake an animated dataview appear & init quickly

Lessons LearnedStack JS builds to minimize load times, avoid dupes“Stunt double” hackLazy loading via data- attributes

Wednesday, November 2, 2011

Page 51: Community Code: Jarvus Innovations

Wednesday, November 2, 2011

Page 52: Community Code: Jarvus Innovations

Challenges

Lessons Learned

Wednesday, November 2, 2011

Page 53: Community Code: Jarvus Innovations

ChallengesRealtime node.js integration

Lessons Learned

Wednesday, November 2, 2011

Page 54: Community Code: Jarvus Innovations

ChallengesRealtime node.js integrationMake page render immediately, then update with latest info

Lessons Learned

Wednesday, November 2, 2011

Page 55: Community Code: Jarvus Innovations

ChallengesRealtime node.js integrationMake page render immediately, then update with latest info

Lessons LearnedSocket.IO is fun!

Wednesday, November 2, 2011

Page 56: Community Code: Jarvus Innovations

ChallengesRealtime node.js integrationMake page render immediately, then update with latest info

Lessons LearnedSocket.IO is fun!Old-school progressive enhancement = good practice

Wednesday, November 2, 2011

Page 57: Community Code: Jarvus Innovations

Wednesday, November 2, 2011

Page 58: Community Code: Jarvus Innovations

Use iconCls for buttons.x-btn-icon {! background-position: center center;! background-repeat: no-repeat;

! &.shirts! { background-image: url(/img/icons/nav/shirts.png); }! &.orders! { background-image: url(/img/icons/nav/orders.png); }! &.settings! { background-image: url(/img/icons/nav/settings.png); }}

Wednesday, November 2, 2011

Page 59: Community Code: Jarvus Innovations

Toolset & Workflow

Wednesday, November 2, 2011

Page 60: Community Code: Jarvus Innovations

Toolset & WorkflowEmergence framework

TotalTerminal

Dropbox

Coda

Wednesday, November 2, 2011

Page 61: Community Code: Jarvus Innovations

DOs and DON’Ts

Wednesday, November 2, 2011

Page 62: Community Code: Jarvus Innovations

Wrangling DependenciesDO DON’T

Wednesday, November 2, 2011

Page 63: Community Code: Jarvus Innovations

Wrangling Dependencies

Define requirements as close to their use as possible

DO DON’T

Wednesday, November 2, 2011

Page 64: Community Code: Jarvus Innovations

Wrangling Dependencies

Define requirements as close to their use as possible

Use Ext.create for all object instantiation

DO DON’T

Wednesday, November 2, 2011

Page 65: Community Code: Jarvus Innovations

Wrangling Dependencies

Define requirements as close to their use as possible

Use Ext.create for all object instantiation

DO DON’T

Define requirements as close to their use as possible

Wednesday, November 2, 2011

Page 66: Community Code: Jarvus Innovations

Wrangling Dependencies

Define requirements as close to their use as possible

Use Ext.create for all object instantiation

DO DON’T

Define requirements as close to their use as possible

Use Ext.create for all object instantiation

Wednesday, November 2, 2011

Page 67: Community Code: Jarvus Innovations

Custom BuildsDO DO!

Wednesday, November 2, 2011

Page 68: Community Code: Jarvus Innovations

Custom Builds

Load your whole site on ext-core.js (sans manifest) for the

auto-build script

DO DO!

Wednesday, November 2, 2011

Page 69: Community Code: Jarvus Innovations

Custom Builds

Load your whole site on ext-core.js (sans manifest) for the

auto-build script

Separate your classes from Ext classes into different builds

DO DO!

Wednesday, November 2, 2011

Page 70: Community Code: Jarvus Innovations

Custom Builds

Load your whole site on ext-core.js (sans manifest) for the

auto-build script

Separate your classes from Ext classes into different builds

DO DO!

Create builds on top of ext.js at milestones to reduce load

times

Wednesday, November 2, 2011

Page 71: Community Code: Jarvus Innovations

Custom Builds

Load your whole site on ext-core.js (sans manifest) for the

auto-build script

Separate your classes from Ext classes into different builds

DO DO!

Create builds on top of ext.js at milestones to reduce load

times

Mix compiled and static loading during development

for quick iteratoin

Wednesday, November 2, 2011

Page 72: Community Code: Jarvus Innovations

Page LoadingDO DON’T

Wednesday, November 2, 2011

Page 73: Community Code: Jarvus Innovations

Page Loading

Create a minimal CSS file to load first—show that

something is happening

DO DON’T

Wednesday, November 2, 2011

Page 74: Community Code: Jarvus Innovations

Page Loading

Create a minimal CSS file to load first—show that

something is happening

Load modernizr and any font loaders in the <head>

DO DON’T

Wednesday, November 2, 2011

Page 75: Community Code: Jarvus Innovations

Page Loading

Create a minimal CSS file to load first—show that

something is happening

Load modernizr and any font loaders in the <head>

DO DON’T

Load all of your JavaScript in the <head>

Wednesday, November 2, 2011

Page 76: Community Code: Jarvus Innovations

Working with SASSDO DON’T

Wednesday, November 2, 2011

Page 77: Community Code: Jarvus Innovations

Working with SASS

Explore Ext’s default .scss files

DO DON’T

Wednesday, November 2, 2011

Page 78: Community Code: Jarvus Innovations

Working with SASS

Explore Ext’s default .scss files

Enjoy mixins, variables, color functions, nesting

DO DON’T

Wednesday, November 2, 2011

Page 79: Community Code: Jarvus Innovations

Working with SASS

Explore Ext’s default .scss files

Enjoy mixins, variables, color functions, nesting

Be OCD about indentation!

DO DON’T

Wednesday, November 2, 2011

Page 80: Community Code: Jarvus Innovations

Working with SASS

Explore Ext’s default .scss files

Enjoy mixins, variables, color functions, nesting

Be OCD about indentation!

Use Compass for CSS3 and tricky techniques

DO DON’T

Wednesday, November 2, 2011

Page 81: Community Code: Jarvus Innovations

Working with SASS

Explore Ext’s default .scss files

Enjoy mixins, variables, color functions, nesting

Be OCD about indentation!

Use Compass for CSS3 and tricky techniques

DO DON’T

Go too crazy with nesting

Wednesday, November 2, 2011

Page 82: Community Code: Jarvus Innovations

Working with SASS

Explore Ext’s default .scss files

Enjoy mixins, variables, color functions, nesting

Be OCD about indentation!

Use Compass for CSS3 and tricky techniques

DO DON’T

Go too crazy with nesting

Battle defaults; instead work with the variables provided

Wednesday, November 2, 2011

Page 83: Community Code: Jarvus Innovations

Working with SASS

Explore Ext’s default .scss files

Enjoy mixins, variables, color functions, nesting

Be OCD about indentation!

Use Compass for CSS3 and tricky techniques

DO DON’T

Go too crazy with nesting

Battle defaults; instead work with the variables provided

Overdo it with ‘ui’ configs when regular classes will do

Wednesday, November 2, 2011

Page 84: Community Code: Jarvus Innovations

Working with SASS

Explore Ext’s default .scss files

Enjoy mixins, variables, color functions, nesting

Be OCD about indentation!

Use Compass for CSS3 and tricky techniques

DO DON’T

Go too crazy with nesting

Battle defaults; instead work with the variables provided

Overdo it with ‘ui’ configs when regular classes will do

Be afraid to line-by-line it

Wednesday, November 2, 2011

Page 85: Community Code: Jarvus Innovations

Chris Alfano & Ryon Coleman@themightychris @ryon55

tHANK YOU!

Wednesday, November 2, 2011