Building JavaScript API Libraries for Drupal

TT
by Travis Tidwell1 view·Updated Feb 20, 2012
Powered by AI

Need to present on this topic?

Create your own polished presentation in minutes. Just describe what you need.

Free to try, no credit card required

Transcript

Building JavaScript API Libraries

for Drupal

at first we needed just a website...

Questions

How to maintain your library

  • Use a lint tool (jslint, jshint, or gjslint)
  • Use a compiler ( Google Closure )
  • Use an auto documentation tool ( doxygen, etc )
  • Create a make file
  • Run the make on an automated build machine

Written in a ubiquitous language

The good news is we are working on it

Drupal as a Web Application Framework

Recipe for a great Client API Library

  • Services Module ( project/services )
  • Web Services and Context Core Initiative

What we really need is a Web Application Framework

The power of Object Oriented Programming

Drupal Services

Well Documented

Travis Tidwell

Lead Developer - Allplayers.com

http://drupal.org/user/98581 (travist)

Agenda

Services Mission

A Drupal website is no longer good enough.

  • Motivation
  • Drupal as a Web Application Framework
  • Drupal Services
  • Recipe for a client API library
  • Drupal JavaScript API ( drupal.api.js )
  • Continuous Integration

What's the motivation?

Provide a RESTful interface for Drupal

  • Code Reuse
  • Speeds up development through derivation
  • Proxy design pattern
  • Testability
  • Extensibility
  • Maintainability
  • Encapsulation

We now need more than just a website

Client API Libraries?

I work for

RESThuh?

Object Oriented

at first we needed a website...

Representational State Transfer

Server API's are in the works

WTF?

But, it takes two to tango...

Unit Tested

  • Server
  • Client

GET

server

Independent

Bringing it all together

Yay!!! I'm RESTful!

client

PUT

Testing

drupal.api.js uses QUnit

Building Unit Tests is crucial for API Developmet