MooTools 1.3 beta 1 launches today. Lots of bug fixes and improvements, and all that jazz. Before presenting you with a random rundown of features, let me be clear about something: MooTools 1.3 is (or will be) 100% compatible with every public documented API of MooTools 1.2. So chill already.
Anyways, here's what's new:
MooTools 1.3 moves away from the $name
functions. Most of the useless ones, such as $chk
(god knows why I thought it was a good idea to have $chk
), were completely nixed. Some of them moved to the proper object's namespace ($merge
» Object.merge
, $pick
» Array.prototype.pick
). Some others were renamed without the stupid $
in front ($type
» typeOf
, $defined
» nil
). In the end, there are a lot less global variables now. You can refer to the 1.3 documentation to have a proper list of what's changed. Keep in mind that the old version of the methods will still work, by default. There will be a way in the future to "compile" MooTools without the compatibility stuff, but the feature is not ready yet.
Every native type has now a from
method that will try to convert every object passed to that type. Array.from
, for instance, replaces both $A
and $splat
. Function.from
will return a function that returns the passed in value, if it wasn't a function itself. String.from
... well you know that at this point, don't you? We also changed how we internally handle Native types, but that should be none of your concerns, since they were handled with private apis anyways.
It is now possible, easy, and even perhaps recommended to generate MooTools (and its plugins) yourself. Last few months I've been working, on and off, on a pretty advanced projects-builder. It's called Packager, it supports multiple project dependancies and has a very similar syntax of what's used in the Forge right now. It's written in php and you can use it from your php webpages to dynamically include JavaScripts for development, or you can build a single .js for production from the command line.
If you care to build MooTools and MooTools projects for yourself, you should take these steps:
Ofcourse, Packager itself is not limited to MooTools, MooTools plugins or just javascript projects. A tutorial post on how to use Packager for development is coming soon (few years tops).
If you dislike php, worry not! There is also a Django builder, called Depender, written by our Aaron Newton, on github as well. I really don't know how it works, as I don't do python, but I do know it's scope is way greater than that of Packager. Depender can, for instance, dynamically build your MooTools for production use, like that. But don't take my word for it, go check it out on github.
The most notable new feature in 1.3 is Slick. Slick is our new, shiny, super fast, exhaustively tested, pure-javascript selector engine. There will probably be a dedicated Slick post in the following days (or months, given our relaxed release cycles), but here's a few Slick-facts for those who haven't checked it out already:
On another note, thanks to the Slick's parser, you will be able to build an element using a css selector. Let me give you an example of this cool new feature (courtesy of our amazing Christoph Pojer):
new Element("input", {"id": "someID", "class": "someClass1 someClass2", "disabled": true});
new Element("input#someID.someClass1.someClass2[disabled=true]");
As I get back to work on an exciting number of totally amazing upcoming MooTools projects that you know nothing about because you don't follow me on github, I'll leave you with a few useful 1.3 links:
UPDATE: There was a "merge" problem with beta1, so we quickly fixed it and re-tagged beta 1.1.
Have fun with 1.3! I know I will.
Valerio
Hey there MooToolers. I just returned from speaking at jQuery Conference 2010 in San Francisco on "Object Oriented jQuery with MooTools" and thought I'd share some notes on the experience.
If you ask me how I did I'd say I missed a few connecting ideas but got the concept out there and got some people thinking. Several people came up to me afterward asking how to actually give this a shot on their web apps. Also, if you are reading this on a Mac, do this: command + option + control + 8 (⌃⌥⌘8). I think for the first time in the history of OSX this keyboard shortcut was useful. The projector had a hard time with my bright colored code on a black background so I inverted the the whole presentation!
Some of you have read my post Pigs take flight about using the Class
module from MooTools to write modular code in a way we all love but use jQuery for DOM manipulation, effects, AJAX, etc. That was the basis of my talk. You can find the slides and a demo at my blog here.
The Demo is especially awesome.
It was very well attended, said to be the largest JavaScript conference ever. There were a lot of really talented people there and all of the speakers did great. I am humbled by the ability of the jQuery team to put together great events and market their library, I'd even say a bit jealous!
It seems at the user level people see frameworks as rivals or something, but at the framework developer level they generally feel like we're on the same team, working to make the web better.
There was a lot of talk about organizing code, which is a problem that jQuery doesn't try to solve. I don't think any other framework can step in quite like MooTools to do it and yet keep the jQuery API in tact when writing an application's code (thanks to mutators). Another testament that -core is rock solid and ridiculously versatile for JavaScript generally, not just the DOM. I also found that a lot of people didn't know that you can create custom builds of MooTools to solve all sorts of JavaScript problems.
So, thanks jQuery for a great weekend!