ext-touch-debug.js..............458k
[...]
And speaking of the other efforts; you mentioned that ExtJS was the
worst of the worst with respect to queries. But I don't know how you
could get much more inept than Dojo's, which relies on their "attr"
I did not review Dojo's in depth, but the overall design approach makes
more sense. From memory, dojo uses its own engine first, and if that
works, then it tries to use NodeSelector the next time.
function, which has always been complete gibberish. It's only a
couple of dozen lines of code and I once tried to explain its illogic
to them, but they just kept chirping: "show me where it fails". I was
reluctant to do that as it would predictably lead to patches without
understanding (or fixing) the general problem. But even after
producing a couple of failure cases, they were still hesitant to
change anything, lest they break compatibility. Of course,
"compatibility" that produces one result in IE8 standards mode and
another in its compatibility view is not something to preserve.
Furthermore, their "vaunted" widgets and parser rely heavily on this
function, so the mistakes manifest themselves in virtually everything
they do. Their forums, mailing lists, etc. are full of confused
questions (and even more confused answers) related to these issues.
The predicament is that fixing the broken abstraction affects the
dependencies.
Changes to low-level abstractions propagate to higher level abstractions
and the result is instability.
The alternative to causing such instability -- and which Dojo has seemed
to favor here -- is to not fix the bugs.
Of course the problem with that is that everything is broken and as you
pointed out, broken differently across different browsers, rendering
mode, etc.
An low level abstraction that is fundamentally broken is a serious problem.
Of course it is. A child could see that.
It appears that way. And they have the gall to charge people to use
recycled garbage.
Well, if it is coming at premium cost, there will be those who think
that it must be better.
[...]
That sounds like an optimistic appraisal of ExtJS, but Sencha Touch
does nothing of the sort. It "compiles" nothing and certainly won't
work with XML documents.
Ext-JS -- not Sencha -- dynamically create functions that they reuse.
This is what they mean by "compiled". that doesn't apply to Sencha, but
just an FYI about what they mean by "compile".
[...]
That's not right. For one, a checked attribute cannot be
"true" (except in an invalid document) and the :checked pseudo queries
the *property* so as to take user input into account. Fortunately, I
think that's what they all do anyway; but unfortunately, they do the
same thing when querying the CHECKED attribute. In my experience,
most of the participants in these projects don't know the difference.
Not all, and there are some that check attributes. NWMatcher is
cognizant of that, at least.
[...]
Yes, using these things to query by style values is even less
predictable than querying by attribute values.
It is.
The selector engine can be accessed from both
Ext.Element.selectorFunction and Ext.query. These are core abstractions
in the library and are accessed from two core parts of the library, both
of which express a package interdependency.
A selector engine that offers no deliberate syntax extensions is safer,
because it does not have as much deviation from the spec.
Any library that uses custom selectors, selectors that match attributes,
and anything that uses native-first dual approach cannot be easily
fixed. Continuing to use such library either changed or unchanged would
be unsafe.
Any library that uses a broken query selector at the core is just as
broken as its query engine. Fixing the bugs causes instability. Problems
are not limited to queries, however.
When changes to low-level abstractions propagate to higher level
abstractions the result is instability.
Each bug in Ext-JS's selector engine necessarily propagates to a higher
level. When the selector engine's behavior is changed, that change is
propagated to all of the higher level dependencies. Such behavioral
changes cause instability. The alternative to causing such changes is to
not fix the bugs.
Buyer Beware.
The alternative for the end user is to not use include such things on
the page. As I have always advised for the developer who is considering
using a js library: Carefully review the source code of any js library
before using it.
No, "inherit" would be incorrect for getComputedStyle. For elements
without a visibility rule, "visible" is the expected result. Now,
IE's "cascaded styles" will indeed return "inherit" as IE doesn't
compute styles at all, simply returning whatever is specified in
applicable rules (or the default value, which is "inherit" in this
case).
That's correct.
var a = Ext.query("{visibility=inherit}");
The result of that in Ext shows that it does not work consistently
either, and a.length will be 0, depending on the browser. This is due to
the fact that it relies on Ext.Dom.getStyle, which, like most everything
in Ext-JS, is very broken.
Regardless, I'm sure that ExtJS fails to account for this (among many
other things). Just like jQuery!
Of course as it has no query engine; it simply hands off all queries
to QSA.
If it had simply handed queries off to `querySelectorAll`, it would not
have created as many problems.
Extra effort was required to split on "," and create a loop, adding
duplicates to the returned result.
So while they do use querySelectorAll, they go to a lot of extra effort
to complicate it and create problems. Why they expended this extra
effort, I cannot say.
The code with comments being blatantly false could be attributed to haste.
There's not a chance in hell they got any of those right cross-
browser.
You reviewed Ext.Dom.getStyle and, as you pointed out,
`hasRightMarginBug` is completely missing for the script.
"hasRightMarginBug" in Ext.platform
false
It seems they forgot to include that property, though continue to
reference it. Since the resolution results in undefined and since
undefined evaluates to false, any code that uses that identifier in a
boolean context is completely useless and dead code.
And so all of the:
| if (Ext.platform.hasRightMarginBug && marginRightRe.test(prop) && out
| != '0px') {
| display = this.getStyle('display');
| el.style.display = 'inline-block';
| result = view.getComputedStyle(el, '');
| el.style.display = display;
| }
is dead code and will never be evaluated.
| * E{display!=none} css value "display" that does not equal "none"
|
|
|
| This class is a singleton and cannot be created directly.
It's neither a class nor a singleton.
All JS properties are public.
| Property Defined By
| matchers : Object
| Collection of matching regular expressions and code snippets. Each
| capture group within () will be replace the {} in ...
| Collection of matching regular expressions and code snippets. Each
| capture group within () will be replace the {} in the select statement
| as specified by their index.
| DomQuery
| pseudos : Object
| Object hash of "pseudo class" filter functions which are used when
| filtering selections. Each function is passed two ...
Oh God. As usual, these types of projects get ten steps ahead of
themselves. I mean, it's 2010 and their basic queries are still
broken. What's the point of piling all of this other nonsense on top?
[snip more delusions]
Although library author is free to make any design decision he chooses,
if the design decisions violate the CSS specifications and drafts (and
these do), then the code cannot honestly be said to be CSS3 compliant.
Ext-JS claims "DomQuery supports most of the CSS3 selectors spec, along
with some custom selectors and basic XPath". Whether Ext supports more
than half of CSS3 selectors depends on the browser and the claim of
"basic XPath" support is false (possibly outdated documentation from
previous jQuery copying).
|
| DomQuery
| selectNumber( String selector, [Node root], Number defaultValue ) :
| Number
| Selects the value of a node, parsing integers and floats. Returns the
| defaultValue, or 0 if none is specified.
| Selects the value of a node, parsing integers and floats. Returns the
| defaultValue, or 0 if none is specified.
| Parameters:
|
| * selector : String
| The selector/xpath query
| * root : Node
| (optional) The start of the query (defaults to document).
| * defaultValue : Number
|
| Returns:
|
| * Number
|
| DomQuery
| selectValue( String selector, [Node root], String defaultValue ) :
| String
| Selects the value of a node, optionally replacing null with the
| defaultValue.
| Selects the value of a node, optionally replacing null with the
| defaultValue.
| Parameters:
|
| * selector : String
| The selector/xpath query
| * root : Node
| (optional) The start of the query (defaults to document).
| * defaultValue : String
|
| Returns: String
|
| DomQuery
The `selectValue` and `selectNumber` methods are missing altogether from
Sencha.
There's a lot of that going on. They were clearly pressed for time.
Seems so. Yet another framework rushed to market, marketed heavily,
using fancy demos with nice images.
The difference between marketing and engineering seems to not very well
perceived.
Looking at demos is much more accessible than being able to make
assessments of front end code quality.
The number of individuals who look at the demos is going to be larger
than the number of individuals who review the code. This is not surprising.
What is surprising is that prior to the recent angel investment into
Sencha, they did not a few qualified individuals to do code review on
it. This would not have been much investment and could have helped avoid
such an amazing waste of money[1].
From the perspective of the investor who does not have any idea of the
code quality, he could employ two highly qualified individuals for a
maximum of one week each to review and assess the code at a cost under
10,000 USD. In reality, it is not hard to look at the code and find a
mistake at line 1:
window.undefined = window.undefined;
- and continue to find a very high defect rate and significantly bad
defects that we have covered and other glaring errors and design
mistakes that were covered by RobG[2].
Having volunteered so much free time over the years to spread knowledge
of web development, it seems that too few care about the code.
The financial losses from projects debilitated by bad code is real.
Bad code costs money.
Bad code hides bugs that might not surface immediately.
Tangled messy code can't be changed easily. The time involved to add a
new feature can be double, and then coming back to regression testing,
bugfixes for all of the change propagation.
This can lead to losing customers from bugs and even project failure
(and I have swam from such sunken ships, having failed to inspire the
captain into smart choices). It is not easy to measure how much money
was wasted by bad code. There is never a "good code" control group and
problems and debt compound.
Ext-JS is very buggy. It is awful code.
Any javascript developer who Ext-JS either has not read the source code
enough, is not capable of understanding the problems, or has read and
understood the problems but has not appreciated the consequences deeply.
The choice to use Ext-JS is a substantially irresponsible and uninformed
decision that puts quality and long-term success of his project at risk.
[1] <
http://techcrunch.com/2010/06/23/sencha-html5-funding-sequoia/>
[2] "jquery vs dojo vs yui etc"
<
http://groups.google.com/group/comp.lang.javascript/msg/d49c2a6b9a01c55c>