-
Notifications
You must be signed in to change notification settings - Fork 12
Haxe 3
andyli edited this page Dec 17, 2012
·
17 revisions
The haxe3 branch includes experimental support to the not-yet-released Haxe 3.
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.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.Plugin
, and start writing the members as if writing directly inside the jQuery.JQuery
/jQuery.JQueryStatic
class.
package com.testing;
import jQuery.JQuery;
extern class MyJQueryPlugIn extends jQuery.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
).