DTVE
August 2013
V1 Features
Advanced JS
Advanced git
Risks
Hunter Loftis
<hunter@skookum.com>
V1 Features this Week
- Message Keys
- Vanity URLs
- Grunt Builds
- Performance Timers
Message Keys
API client + Periodic update + Memory cache +
AJAX endpoint + Angular Directive + Jade Helper
TODO: Talk to real API (once it exists).
Vanity URLs
API client + Mapping middleware +
Memory cached hit / miss
TODO: Limit size of 'miss' cache, otherwise 404s will gradually build up over time.
Grunt Builds
Gruntfile + local helper + script group keys + config
Performance Timer
Middleware + Stats + Event Emitters + Results page
TODO: Run this with jMeter to get better numbers; use data to optimize middleware.
Advanced JS
- Hoisting
- Closures
- Call / Apply
- Bind
- Object.create
Variable Hoisting
Function Hoisting
Closures
Call / Apply
Bind
Object.create
Advanced git (bisect)
- on the current (broken) commit:
`git bisect start` `git bisect bad` - now look back in time and find a working commit:
`git log` `git checkout (ref)` `git bisect good` - now git will start auto-checking-out for you. Test, then:
`git bisect bad` (if broken) or `git bisect good` (if working)
`git bisect reset` once you've found the breaking commit.
Risks
- Front-end "God" objects
- Lowest-common-denominator API performance
- Test progress
"God" Objects
browseApp.js is a good example of this.
It's working, but difficult to maintain and extend.
Next step: split controllers into data models as services.
Services: Data Model, API actions (thick, robust)
Scope: View Model referencing the Data Model (one off)
Directives: DOM manipulation (small, many)
Controllers: Instantiate & coordinate the above (thin, light)
API Performance
A majority of our time is spent waiting on the API - this gives us a definite place to start optimizing:
Test Progress
We've got just 13 tests and most of the angular components are floating around without any sandboxes.
(I know it's unnatural to write tests when you're exploring the early versions of a feature - I delivered several features this week without tests.)
However, we need to consciously devote time to catch up on tests. This is the project's biggest risk factor.
PhantomJS/webkit is fine to replace Zombie (thanks JT!).
Outlook
- Very impressive progress with:
- completeness of front-end
- mobile / fluid layouts
- new components / complex filters
- partials / ajax / standalone content sharing
- single-page history / navigation
- node.js structure / refactor / middleware
- front-end needs a similar refactor (into smaller pieces)
- node.js needs more performance data, optimization
- everything needs tests
Node Summit?
I spoke at Node Summit in 2012 and they've asked us if we'd like to present again. We should present together!
- If you're looking for talented devs, headlining at a cutting-edge industry event is a great way to find them.
- We have the opportunity to frame DTV as a thought leader (just like Walmart in 2012 at the same conference).
- We'll learn as much as we'll teach - the attendees and presenters are a wealth of information relevant to DTVE.
dtv-august-13
By hunterloftis
dtv-august-13
- 1,190