Hello,

I am Toby!




tobyho.com
@airportyh
Atlanta, GA
atlantajavascript.com
Adobe Systems Inc.
author of Testem

Got 'Scripts? Test'em

github.com/airportyh/testem


  • Javascript test runner
  • Designed to deliver a smooth test experience
  • Framework agnostic
  • Supports any browser
  • Supports Node.js
  • file watcher
  • Cross-platform
  • Preprocessor support
  • Similar to Karma

But...

Small.JS









JavaScript Modules





We are Framework-Heavy




JS Library Rules

JS Library Rule #1





Depend on No One

JS Library Rule #2





Unless it's jQuery

JS Library Rule #2





Unless it's

<insert awesome framework>

JS Library Rule #2





Unless it's

<insert awesome framework>

but nothing else

JS Library Authoring





  1. Depend on a framework
  2. Depend on no one

Handicapped






  1. Harder to share code
  2. Fragmentation
  3. Harder to reuse code in multiple libaries



The Dream:

Easy Dependencies



Like npm



Beauty of npm

npm yay!



Install

Use


Rich Dependencies

npm yay!



Small is Beautiful




  1. Small (~200 LOC or less)

Small is Beautiful




  1. Small (~200 LOC or less)
  2. Single-Purpose (SRP)

Small is Beautiful




  1. Small (~200 LOC or less)
  2. Single-Purpose (SRP)
  3. Short Learning Curve

Small is Beautiful




  1. Small (~200 LOC or less)
  2. Single-Purpose (SRP)
  3. Short Learning Curve
  4. Easy to Make

Small is Beautiful




  1. Small (~200 LOC or less)
  2. Single-Purpose (SRP)
  3. Short Learning Curve
  4. Easy to Make
  5. Easy to Replace

NPM for Browser Code?






  1. npm with Browserify
  2. Bower
  3. Component

But The FUD






  1. Which package manager?
  2. Which module format?
  3. Which tool chain?

Go Forth And Publish






  1. Write modular code
  2. Publish the reusable parts



But Why Small?



Why Not a Framework?

Frameworks

Frameworks




Rails is like an iPad or a limousine; it's crafted to exacting specifications, designed for comfort, and is full of little flourishes that may appear to many as shameless luxury. 


                                                       - Giles Bowkett, Rails As She Is Spoke

Framework Pains

Framework Pains



  1. big/steep learning curve
  2. it's slow
  3. it's bloated
  4. it's not easily testable
  5. tests are slow
  6. violates the single responsibility principle
  7. requires non-semantic markup
  8. the internals are fubar'd




Trying To Do With It 

What It's Not Good At

Deviating From The "Happy Path"






Blame The User?




Legit Reasons for 

Go Off The Rails





Quest For Perfection








Unusual Requirements





New Technology

The Framework Cliff




You think you've been under our thumb? You've been under our protection. Think about that. You want out? Here's the door. But hear this. You have no idea what hell will rain down... if we stop watching out for you.

                                                                           

                                                                                 - Quote from Burn Notice






Alleviating The Framework Cliff

What The Developer Can Do:

Open Up the Insides








What The Framework Author Can Do






Why Make it Easy to Quit Your Product?





  1. Wanting to enrich others
  2. Focus to make the produce great

Things Framework Developers Can Do






  1. Make the internals easy to understand
  2. Make the internals modular
  3. Make the internals usable outside the framework

Summary






  1. Write modular code today
  2. Share your work

Thank You






tobyho.com
@airportyh
github.com/airportyh

Small.JS

By airportyh

Small.JS

  • 1,097