News Roundup: Traits, Scriptsrc.net, and more

We’re trying something new here at JSMag: in addition to the monthly news column in the magazine, we’ll be featuring a weekly roundup of news here on the blog. We’ve got some great stuff to talk about this week, so let’s dive in.

Traits.js

Traits.js is a library that allows you to use traits in Javascript. In case you’re not familiar with the idea of a trait, it’s something like a mixin (though traits are more flexible) or an abstract class (less apt, but maybe a more familiar concept given its use in PHP & Java). The idea first popped up in Squeak and PLT Scheme, and most recently has become a big part of Scala (along with several other languages). A trait is essentially a collection of methods that can be imported into an object. The Traits.js library allows you to compose traits (i.e. make a new trait by combining other traits), overwrite trait methods, and even provides a way to resolve conflicts among trait methods with the same name. It’s a very clear but powerful API.

The library uses a lot of the awesome new ECMAScript 5 object-manipulation API (a good discussion of which you can find here) Better still, it works with both ECMAScript 3 as well as ES5, so while it conforms to the new standard, it is still fully functional in older ES implementations.

If you’re interested in this stuff, you can see a very in-depth tech talk (video, slides) that goes into a fair bit of detail about Traits.js. Also, there was a lengthy discussion of traits this week on the es-discuss mailing list.

ES5 Implementation Tracker

Speaking of ECMAScript 5, here’s a quick pointer to a list of ES5 implementations. It’s pretty much just a roundup of bug tracking tickets for several Javascript engines that follows those engines’ progress in adding ES5 features. If you want up-to-the-minute news about when you can use a particular part of ES5 in a given browser, this is the place to look.

Scriptsrc.net

Scriptsrc.net provides a simple way to get links to several popular Javascript libraries hosted on Google’s CDN. Just tap a button, and the script tag containing the link to the library is copied to your clipboard. As a side note, I’d be curious to hear why the site’s authors omitted YUI3, when they included YUI2. Other than that, it looks like a handy resource.

Well, that’s it, folks. The first weekly roundup of Javascript news here on the JSMag blog. Did I overlook something of epic importance? Let me know in the comments. Or just @ me on Twitter.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit
  • TwitThis
  • Simpy
  • StumbleUpon

2 Comments

  1. Thomas says:

    I guess the first link should be http://www.traitsjs.org insted of http://www.traits.js ;)

  2. matthenry says:

    Indeed. Thanks, Thomas :)

Leave a Reply




© webdevpublishing 2011