root / trunk / web / dojo / dojox / jq / README @ 9
History | View | Annotate | Download (4.15 KB)
1 |
------------------------------------------------------------------------------- |
---|---|
2 |
DojoX jq |
3 |
------------------------------------------------------------------------------- |
4 |
Version 0.0.1 |
5 |
Release date: 8/9/2009 |
6 |
------------------------------------------------------------------------------- |
7 |
Project state: |
8 |
experimental |
9 |
------------------------------------------------------------------------------- |
10 |
Credits |
11 |
James Burke |
12 |
------------------------------------------------------------------------------- |
13 |
Project description |
14 |
|
15 |
DojoX jq is a compatibility layer that tries to match the jquery 1.3.2 API. |
16 |
------------------------------------------------------------------------------- |
17 |
Dependencies: |
18 |
|
19 |
- Dojo Core. |
20 |
------------------------------------------------------------------------------- |
21 |
Documentation |
22 |
|
23 |
IF YOU WISH TO WORK ON THIS MODULE, PLEASE DO NOT LOOK AT THE JQUERY SOURCE. |
24 |
|
25 |
We want CLA-clean code to be put in the Dojo repos. Just refer to the jquery API |
26 |
documentation and unit tests. As we get bug reports, we can build up our own test |
27 |
suite, and then hopefully contribute those tests back to jquery if their tests |
28 |
do not adequately cover an API call. |
29 |
|
30 |
This module needs a lot of work, it is in the very initial, rough stages. Some |
31 |
(all?) of the code is ugly. It is missing some APIs, notably queue/dequeue, |
32 |
the FX methods and live/die. |
33 |
|
34 |
There are also some incompatibilities with how acme and sizzle operate at the moment, |
35 |
mentioned in the comments in jq.js |
36 |
|
37 |
The tests for this module so far have been the jquery 1.3.2 tests. Since those |
38 |
tests are not CLA-clean, you will need to download them from here: |
39 |
|
40 |
http://www.tagneto.org/dojo/jquery132.zip |
41 |
|
42 |
Place the zip file in the dojox/jq/tests directory and unzip it. Then you can |
43 |
run the jquery132/test/index.html file inside there to start the tests. |
44 |
|
45 |
The tests were changed in a couple ways. For the tests I modified, |
46 |
you can look for //JRB changed: to find the original test construction. |
47 |
Things that were changed: |
48 |
|
49 |
1) acme requires spaces between CSS3 selectors, where sizzle does |
50 |
not ("div>span" fails in acme, but works in sizzle). There is a |
51 |
dtk.org bug on it, and it is allowed by the CSS3 spec to not have |
52 |
spaces so hopefully that incompatibility can go away after a while. |
53 |
|
54 |
2) sizzle supports some psuedos like :last, :first: :odd, :even that |
55 |
work on the list of matched elements, not just individual elements or |
56 |
their children. This is a more fundamental change to acme, but it is probably |
57 |
doable. |
58 |
|
59 |
3) The XML tests and ajax tests that call out to files fail because of |
60 |
some weird timing interaction between the jquery unit test thing and |
61 |
our XHR code. I believe since our code has a timer where we check the |
62 |
status of the XHR calls instead of using load callbacks directly on |
63 |
the XHR callbacks, something is confused in jquery -- the failure case |
64 |
is fired before our callbacks work. If only they used deferreds. ;) |
65 |
To get those tests to sort of work, I modified qunit/testrunner.js's process() |
66 |
method to be like so: |
67 |
|
68 |
function process() { |
69 |
if(config.queue.length && !config.blocking){ |
70 |
setTimeout(function(){ |
71 |
if(config.queue.length && !config.blocking){ |
72 |
config.queue.shift()(); |
73 |
process(); |
74 |
} |
75 |
}, 100); |
76 |
} |
77 |
} |
78 |
|
79 |
Change 100 above to tune it depending on your patience and how much |
80 |
you want to make sure the tests have enough time to run. With 100, you |
81 |
can see some of the ajax tests passing. |
82 |
|
83 |
From some previous notes (I have not checked more recently), it looks |
84 |
like the compat layer fires "ajaxStop" more than jquery, I think due |
85 |
to how we do our async in-flight testing, so that messes up some of |
86 |
the testing in the ajax calls, but I think that is a detail that is |
87 |
fine to go with. I just have to make sure that is really the cause of |
88 |
a test failure and not something else. So I will probably need to |
89 |
modify the tests more. |
90 |
|
91 |
|
92 |
------------------------------------------------------------------------------- |
93 |
Installation instructions |
94 |
|
95 |
Grab the following from the Dojo SVN Repository: |
96 |
http://svn.dojotoolkit.org/src/dojox/trunk/jq.js |
97 |
http://svn.dojotoolkit.org/src/dojox/trunk/jq/* |
98 |
|
99 |
Install into the following directory structure: |
100 |
/dojox/jq.js |
101 |
|
102 |
...which should be at the same level as your Dojo checkout. |
103 |
------------------------------------------------------------------------------- |