kriszyp / xstyle

A declarative, reactive framework that extends CSS
http://kriszyp.github.com/xstyle
Other
96 stars 55 forks source link

Can't get any tests to work...many missing files, etc. #31

Open ca0v opened 9 years ago

ca0v commented 9 years ago

Using

Errors

The xstyle design is a beautiful thing but critical functionality seems broken and these tests are not helping to dissuade me.

kriszyp commented 9 years ago

Clearly I need to go through and clean up the testing area. This directory has seen a lot of experimental tests that have not been maintained, and I have been working on (slowly) moving xstyle's testing to use intern. And of course, as you can see there is definitely a lot of experimentation that has happened. Currently the intern tests should be passing, but I haven't maintained the tests outside of the intern tests. Indeed I will work on moving these tests to intern or deleting them. If you need any help with setting up the intern tests, let me know. I have been using intern in sibling package mode, which differs from the typical child package mode.

ca0v commented 9 years ago

Switching to the https://github.com/SitePen/xstyle repository allowed me to study working tests enough to get module() working.

I believe I should start with dgrid to get oriented with intern, but yes, I would like help setting up xstyle tests.

ca0v commented 9 years ago

I've become comfortable with the intern and have written some simple xstyle tests. I would really like a pointer to your intern tests for xstyle. I'm presently trying to understand the implications of this comment:

Note, that simply using the plugin loader will not load xstyle, and trigger parsing of the stylesheet, so you will not be able to use the extensions, unless you have specifically included the xstyle module as well.

I was hoping as long as xstyle/main is loaded we could load a stylesheet via the plugin and it would trigger parsing. How is this accomplished? elemental.update() seems to do the trick.

kriszyp commented 9 years ago

You should be able to use xstyle/main as the css loader plugin, if you want to ensure the parsing and extensions are enabled. So rather than 'xstyle/css!stylesheet.css', use 'xstyle/main!stylesheet.css'.

ca0v commented 9 years ago

Okay, so when loading xstyled css after the document is ready it's necessary use the xstyle/main! plugin? I've found that if xstyle/main is already loaded it doesn't work. Here's code which delays loading the xstyled css and further delays creation of a node to be xstyled:

//require(['xstyle/main']); //  uncomment and the page will not be xstyled
setTimeout(function() {
    require(['xstyle/core/elemental', 'xstyle/main!./css/query-builder.css'], function (elemental) {
        setTimeout(function() {
            var node = put(body, "div.query-builder-widget.landscape-tiny", "form 2");
            elemental.update(node);
        }, 2000);
    });
}, 2000);

I guess elemental.update() is the postCreate() or startup() of xstyle controls.

kriszyp commented 9 years ago

I am having a difficult time reproducing this exact issue. I am seeing an issue, but it is related to double loading and rendering, which I will fix.

I would describe elemental.update as more analagous to the parser.parse(node) of xstyle, I think.