DailyJS

JavaScript.next, Front-end Guidelines, Crossroads.js

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

HTML css routing harmony

JavaScript.next, Front-end Guidelines, Crossroads.js

Posted by Alex R. Young on .
Featured

HTML css routing harmony

JavaScript.next, Front-end Guidelines, Crossroads.js

Posted by Alex R. Young on .

JavaScript.next

Brendan Eich gave a last-minute talk at JSConf
2011
about the future of JavaScript, spurred on
by a CoffeeScript talk. There's good coverage by Ian Elliot in
JavaScript creator talks about the future
which contains some interesting quotes from Brendan:

I advocated strongly for standardizing prototypal inheritance a la CoffeeScript’s class, super, and @ syntactic sugar.

We've seen all this before and what it did to the community during
ECMAScript 4's planning (which I covered on DailyJS in The History of
JavaScript
). I
don't know if this time anything will change, but there's an undeniably
growing movement that wants to push JavaScript's syntax in new
directions.

I've already seen some harsh commentary from JavaScript developers that
I have a lot of respect for -- but if we learned anything from
ECMAScript it's that progress should come in small steps rather than too
much at once.

I've collected some other resources related to this talk:

And I'm still not sure if I should be writing JavaScript.next, JS.next,
JS.Next, JS/Next, JS-Next, or "Harmony"!

Front-end Guidelines

Front End Development Guidelines
(GitHub: taitems / Front-End-Development-Guidelines)
is a document written by Tait Brown that attempts to collate useful
HTML, CSS and JavaScript best practises that he's learned along the
years. The document is easy to read and contains a lot of things that
I've found myself teaching junior developers and designers before.

Crossroads.js

Crossroads.js (millermedeiros / crossroads.js, MIT
License) by Miller Medeiros is a routing library:

I consider the main target to be single page applications with complex navigation paths and also large websites that shares the same JS files across multiple pages or would benefit from this kind of approach. It is also very useful for server-side and RESTful applications.

The API supports "string rules" and regular expressions:

var route1 = crossroads.addRoute('/news/{id}', function(id){
  console.log(id);
});

var route2 = crossroads.addRoute(/^\/lorem\/([a-z]+)$/, function(id){
  console.log(id);
});

Routes can be removed, parsed, and validated.