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
- Depend on a framework
- Depend on no one
Handicapped
-
Harder to share code
- Fragmentation
- 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
- Small (~200 LOC or less)
Small is Beautiful
- Small (~200 LOC or less)
- Single-Purpose (SRP)
Small is Beautiful
- Small (~200 LOC or less)
- Single-Purpose (SRP)
- Short Learning Curve
Small is Beautiful
-
Small (~200 LOC or less)
- Single-Purpose (SRP)
- Short Learning Curve
- Easy to Make
Small is Beautiful
- Small (~200 LOC or less)
- Single-Purpose (SRP)
- Short Learning Curve
- Easy to Make
-
Easy to Replace
NPM for Browser Code?
- npm with Browserify
- Bower
- Component
But The FUD
-
Which package manager?
- Which module format?
- Which tool chain?
Go Forth And Publish
- Write modular code
- 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
- big/steep learning curve
- it's slow
- it's bloated
- it's not easily testable
- tests are slow
- violates the single responsibility principle
- requires non-semantic markup
- 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?
- Wanting to enrich others
- Focus to make the produce great
Things Framework Developers Can Do
- Make the internals easy to understand
- Make the internals modular
- Make the internals usable outside the framework
Summary
- Write modular code today
- Share your work
Thank You
tobyho.com
@airportyh
github.com/airportyh
Small.JS
By airportyh
Small.JS
- 1,103