9 days has passed since Adamantium.js first broke the speed of light in public and what has been described in blogs as a project with potential, to keep under your radar, is now ready to enter the next phase.
Right now, we create Screen, Logic and Library components as objects, using a primitive naming convention, like LOGIC.MyController. To make the framework syntax simpler, version 0.2 will use component type prefixes when querying for components. $(‘%Logic’), $(‘@Screen’) and $(‘=Library’) is how you will use them, as simple as that.
Version 0.2 will offer simple ways to extend the framework with chainable filter methods that can manipulate the query context and also provide a rich set of standard filters methods.
Create a context of all buttons, filter to only the enabled ones with ‘click’ in the title and to these, fire a synthesized click event.
$(':Button').enabled().contains('title', 'click').click();Data is a vital part of almost any application and the shape and form of that data often varies, from context to context. Adamantium.js embraces the concept of free form data collections and implements a pattern inspired by some much loved existing NoSQL projects.
The implementation will be extensive and I have a general plan, but any feedback is of course appreciated. Here’s a few examples, building on the filters.
var users = $('%Users').find({ lastname: 'Appleseed' }).sort('firstname', 'ASC');
$('%Users').find().index(10, 19); // subselect results by indexTo provide a simple and unified syntax, version 0.2 will begin treating strings, objects, arrays and numbers as context, which let’s developers interact with these variables the same way they do with components and elements.
$('I am string').replace('I am', 'We are').alert();
$(anyArray).sort(key, order).limit(10);0.1 only tracked components on elements in a flat dimension, without any knowledge on the elements’ and components’ relationships with each other. Version 0.2 will introduce tracking of every parent/child relationship, which can be used for filtering and provides the foundation for another feature – event propagation to all events and of course, the ability to stop propagation at any time.
Ever since the start I’ve been thinking about a way of implementing something that is for this framework what classes are for jQuery and web development. The result is states, which will be powered by a core revision-control system for applying and re-applying states, using methods addState() and removeState().
Well, that’s my thoughts on the next version of Adamantium.js, codename “Santa’s little helper”. My plan is to have this wrapped up by the end of may, but it mainly depends on the amount of client work I need to give attention to.
Please discuss freely in the comments, all ideas are welcome and in the mean time – I’ll start coding!