-
Notifications
You must be signed in to change notification settings - Fork 12
Haxe 3
andyli edited this page Mar 29, 2013
·
17 revisions
The haxe3 branch includes experimental support to Haxe 3.0RC.
Individual jQuery classes are now split into their own modules(files) instead of living in the single jQuery.JQuery
module.
They can now be easily accessed by
import jQuery.*; //previously `import jQuery.JQuery;`
A jQuery.haxe.Plugin
class is introduced for writing jQuery plugin extern. It is macro-based, responsible for copy-and-pasting the fields in the extern classes into jQuery.JQuery
and jQuery.JQueryStatic
.
To write a jQuery plugin extern, create an extern class that extends jQuery.haxe.Plugin
, and start writing the members as if writing directly inside the jQuery.JQuery
/jQuery.JQueryStatic
class.
package com.testing;
import jQuery.*;
extern class MyJQueryPlugIn extends jQuery.haxe.Plugin {
//instance members will go to `jQuery.JQuery`
public function myMethod(arg:Dynamic):JQuery;
//static members will go to `jQuery.JQueryStatic`
static public function myStaticMethod(arg:Dynamic):JQueryStatic;
}
To use it, add the following compiler option:
--macro jQuery.Plugin.add('com.testing.MyJQueryPlugIn')
- Review all the signatures and try to eliminate more
Dynamic
by@:overload
. - Complete the jQueryTools and jQueryUI externs.
- Look into if we want to add a type param for the containing elements (constrained to
js.html.Element
).