290b5481ab152cfd458486efb552b3f20cacb31f |
|
22-Jul-2011 |
Luke Smith <lsmith@yahoo-inc.com> |
Avoid attribute API methods in render loops
There were a lot of calls to get('attr') within
the row and cell rendering loops. The render
methods should not be modifying these values
during iteration, so it should be safe to capture
the values before iteration. Similarly with the
determination of cell formatters, all conditional
logic and setup can be moved above the row render
loop.
This should speed up rendering somewhat (see
ticket #2530152), though the biggest performance win
will be moving away from Node.create to innerHTML
string concatenation. That won't happen until 3.5.0.
Also while I was in there, I moved UI related
event bindings to bindUI and did some other code
cleanup. |
8e9916f9f941d449c02f791f310cc77f63582a6d |
|
16-Jul-2011 |
Luke Smith <lsmith@yahoo-inc.com> |
Restub Y.dump and use Y.Lang.sub in DataTable
Fixes #2530546.
Prior to commit
https://github.com/yui/yui3/commit/0212e3fe3137ecc4fd3d270f14837467f05bfa61#L11R1021
Y.dump was undefined unless the module was included.
Y.substitute used a feature test `if (Y.dump)` to fork
output formatting of object values through Y.dump if
available. With the stub, this test became always true,
but the stub was a noop, resulting in Y.dump(...)
returning undefined.
There are two issues here:
1) Y.dump is expected to return a value
2) DataTable default formatter was using Y.substitute
which changed behavior if the dump module was
included.
It could be that DataTable's use of substitute was
purposeful, to support recursive substitution. The
replacement of Y.substitute with Y.Lang.sub in the
DataTable methods will break this, but there was no
use of recursion in any DataTable module, so any
breakage would be with custom template overrides.
I decided to replace with Y.Lang.sub anyway, because
it's possible to work around the loss of recursive
substitution, but not so for the behavior change
based on the presence of the dump module.
There's more discussion about this in commit
comments on the linked commit. |