Giter Club home page Giter Club logo

mochikit's People

Contributors

anarazel avatar arnar avatar blq avatar cederberg avatar cito avatar eoghanmurray avatar etrepum avatar jaybaird avatar kdart avatar richardmansfield avatar thepaul avatar therve avatar vrkansagara avatar wieslander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mochikit's Issues

MochiKit.Signal with GC

Hi,
This is a kind of RFC before going to PR.
In my fork I've now added a major under-the-hood update to MochiKit.Signal lib.
It uses WeakMap and Set to store references to signals to enable automatic GC.
Should also be faster due to less linear searches.

See: https://github.com/blq/mochikit/blob/master/MochiKit/Signal.js

All unit-tests pass except one, disconnectAllTo(function) since WeakMaps doesn't allow full iteration and I wanted to reduce WeakMaps to only source and dest objects, not functions.

Observe that this setup doesn't remove need to disconnect of course, WeakMaps only release fully GC:ed objects, it's not an out-of-your-scope release.


Another change in my fork is support for signal namespaces, similar to jQuery. That is a separate discussion I guess..
(WeakMap means IE10 is out, but code is written to still work in IE11 (no for-of loops or such))

Customized download does not change Mochikit.Mochikit.SUBMODULES

If you go to the customized download page and create a distribution consisting just of a few sub-modules, the SUBMODULES variable still lists all modules.

This leads a couple of unnecessary http request.

Is it save to edit the SUBMODULES array?

Thanks
Florian

Async: Check on responseText always fails if a local resource is requested and XHR's responseType is set

In recent versions of Chrome and Firefox the following code always calls errback if 'whatever' is a local resource

var xhr = getXMLHttpRequest();
xhr.open('GET', 'whatever');
xhr.responseType = 'arraybuffer';
sendXMLHttpRequest(xhr);

Here we need xhr.response, not xhr.responseText or xhr.responseXML, but MochiKit.Async._xhr_onreadystatechange fails if status is 0 and responseText is not set.

problem add control code for script/pack.py

Windows Vista 64bit
python 2.7.2 (16bit)

run script/pack.py.
add control code on file end.

Just my environment?

script/pack.py
line:16
-    outf = file(os.path.join(dirname, 'packed/MochiKit/MochiKit.js'), 'w')
+    outf = file(os.path.join(dirname, 'packed/MochiKit/MochiKit.js'), 'wb')

Iter: bug in Iter.chain

Thought I'd forward this old forum post by Imri Goldberg. I've used the suggested patch and it seems to work.

http://groups.google.com/group/mochikit/browse_thread/thread/fddacb62dd14deb8

Here is a firebug log to show the bug, present in mochikit 1.4.2, and
according to a test I did, also in mochikit 1.5:

list([1])
[1]
list(chain([1],[2]))
[1, 2]
list(chain([1],[2],[3]))

[1, 2, 3]
>>> list(chain([],[],[3]))
[]

list(chain([1],[2],[3]))
[1, 2, 3]
list(chain([],[2],[3]))

[2, 3]
>>> list(chain([],[],[3]))
[]

*>>> list(chain([],[],[1]))
[]

list(chain([1],[],[1]))
[1]
list(chain([1,2],[],[1]))

[1, 2]*
To fix the bug, I suggest changing lines 298-300 (in 1.4.2) of next (defined
in chain()) from:
argiter.shift();
var result = argiter[0].next();
return result;
to:
argiter.shift();
continue;
Cheers,
Imri

The build script(s) should be added as npm tasks.

I noticed this, and I have no idea on how to open a pr.
If you add npm scripts, you can then run the build scripts
from the base directory without cding to the scripts folder.
This makes it easier, by letting you type npm run build.

Test failed with Firefox 26.0 (MacOS X 10.9.1)

The failing test is test_MochiKit-Style.html with this output:

Passed: 68
Failed: 7
not ok - default left table cell content h ok: got 34, expected 30
not ok - default middle table cell content h ok: got 34, expected 30
not ok - default right table cell content h ok: got 34, expected 30
not ok - collapsed left table cell content h ok: got 32, expected 30
not ok - collapsed middle table cell content h ok: got 32, expected 30
not ok - collapsed right table cell content h ok: got 32, expected 30
not ok - test suite failed in 00:00.024

Wish I can give more detail about the failing tests, but I thing if you use a new version of Firefox you will find them out.

Iter: Incorrect documentation example for Iterator usage

from http://trac.mochikit.com/ticket/340

The example code at: http://mochikit.com/doc/html/MochiKit/Iter.html#fn-iter is not correct. The generic usage of iterable shouldn't stop on null values, only on StopIteration.

var it = iter(iterable);
try {
    while (var o = it.next()) { // <-- !
        // use o
    }
} catch (e) {
    if (e != StopIteration) {
        throw e;
    }
    // pass
}

It should rather be:

var it = iter(iterable);
try {
    while (true) { // <-- !
        var o = it.next();
        // use o
    }
} catch (e) {
    if (e != StopIteration) {
        throw e;
    }
    // pass
}

Regards
// Fredrik Blomqvist

Async: document Async.Deferred.fired property

from http://trac.mochikit.com/ticket/344

In the documentation for Async.Deferred at http://mochikit.com/doc/html/MochiKit/Async.html#fn-deferred the three states of the Deferred (-1, 0, 1) are mentioned. But it is not quite clear how to obtain the state. the word "fired" is only mentioned in the running text. I think the property ".fired" should be clearly included in the formal specification/documentation for Deferred.

Also, http://mochikit.com/doc/html/MochiKit/Async.html#fn-genericerror mentions a non-existing "failed" method of the Deferred object, it should be removed.

Regards
// Fredrik Blomqvist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.