Skip to content

haXe Dojo API – First Stab

July 19, 2010

If you don’t know Dojo have a look here.

http://github.com/blackdog66/bdog-dojo

First stab Dojo Api. The current generated api in dojoApi dir. The api.json
file is straight from the Dojo SDK 1.4.3 in the util/docscripts dir.
Disclaimer: I haven’t actually used Dojo, but the api seemed like a nice fit
for haXe, in that it doesn’t use quite as much JS magic, as for example JQuery,
and is easier to write a generator for. What I really like is it’s comprehensive,
full widget set, jquery like selection, the works.

So, with Node.js on the server, and Dojo on the client, I’m saying haXe/JS is
starting to kick arse.

Apart from what’s missing!

I’ve only generated classlike objects. There’s a lot of stuff which is
marked without classlike true. The generator has two lists classLike and
typdefLike which can be added to, to add other stuff that’s required but
not parsed by default. classLike is anything that’s a constructor or used as a
subclass, typedefLike is anything that is already instantiated and you just
need a reference to e.g.

static var dojo:Dojo = untyped __js__(“dojo”);

I’ve only tried a few functions, I’ve still got to see how the whole thing
fits together. There are documentation and api mismatches, e.g. I found
NodeList.foreach has it’s second param optional but it’s listed in api.json as
required. There’s going to be lot’s of special cases, and the only way to find
them is to use it.
I shall be using this myself in the coming days/weeks/months for various management consoles for my game server and stuff like that so it should get a good workout.

I also took the opportunity to write the generator using Node.js as the runtime. So a couple of the new js.io.* functions (in bdog-stdhx) got a workout with this.

I reckon I’ll mothball the Google Closure wrappers in preference to this toolkit.

Finally, only for the brave, but there’s only one way to improve it and that’s with input.

bd

Advertisements

From → haxe, javascript, node.js

2 Comments
  1. Nice job 😉
    where do you find time to work on all of these projects 😦

    • Thanks.

      I guess I’m just not satisfied with what’s available so I try and fill the void 🙂 Also, i use all these projects
      for my game system so they aren’t done in a vacuum.

      bd

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: