Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to ConditionerJS at Kabisa

Introduction to ConditionerJS at Kabisa

An introduction to ConditionerJS and the problems it tries to tackle, a presentation given at a Fronteers meetup hosted by Kabisa.

Rik Schennink

April 08, 2015
Tweet

More Decks by Rik Schennink

Other Decks in Programming

Transcript

  1. Writing maintainable JavaScript for big web platforms is though. Now

    do it for the multi device web, k-thanks-bye!
  2. Screensize “User resizes the window or rotates his device…” Input

    type “User interacts with touch then moves to his mouse…” Cookie support “User decides to not allow cookies…”
  3. touch mouse pen gesture remote voice keyboard virtual gyro CURRENT

    TIME LIGHT LEVEL SESSION LENGTH NAVIGATION HISTORY SCROLL POSITION proximity LOCATION VELOCITY WEATHER CONNECTION STABILITY HISTORICAL BEHAVIOR MOTION
  4. How to make these systems play nice together… Particle engine

    Achievement dispenser Game loop Render engine Collision detection
  5. Using this principle while examining the responsive web I found

    why my code spiralled out of control each time.
  6. A typical piece of code was… Feature testing Waiting for

    DOMContentLoaded Monitoring events Expecting other code
  7. I needed to build an entity that could load those

    modules without taking too much responsibility.
  8. Conditioner measures context and will load all relevant modules without

    knowing anything about them. Just that they’re bound with data-module.
  9. Combine monitors in expressions. media:{…} and not (element:{…} or pointer:{…})

    Use the was operator to remember state. pointer:{was near}
  10. ui/GoogleMap.js define(function(){
 
 var exports = function GoogleMap(element,options) {
 


    }; 
 exports.options = { zoom: 10, type: 'map', key: null }; 
 return exports;
 
 });
  11. { zoom: 10, type: ‘map’, key: null } { key:

    ’123ABC’ } ‘type:terrain’ module website element