These are chat archives for anthonyshort/deku

9th
Jun 2015
Giuseppe
@giuseppeg
Jun 09 2015 03:29
Giuseppe
@giuseppeg
Jun 09 2015 03:43
these pretzels are making me thirsty
Michael Trotter
@spicydonuts
Jun 09 2015 06:21
Try running babel on just that file and see what it's turning that line into (so pre-browserify)
Anthony Short
@anthonyshort
Jun 09 2015 06:23
The only thing I could possibly think it could be would be something with the class name being restricted by something...
@giuseppeg As for the async data loading stuff, I’m going to write up some guides for it. But basically what we do is treat null as the loading state. So while rendering if says projects is null then we just assume they haven’t loaded yet. There are lots of ways to go about actually loading it, but I’d recommend not doing it within the components themselves.
The Dude
@6D65
Jun 09 2015 17:21

Hi everyone,
has anyone been able to build a deku app with Webpack? I know you here are big fans of Duojs, but it would be cool to make it work with Webpack.

Currently i'm getting this output, plus the whole Deku source code. Is anything here that's obvisouly wrong and that i'm missing? Also, the render function. Is this a one time thing? Shall I call it on repeat(requestAnimationFrame)? Or it should take care of everything itself?

    "use strict";

    var _deku = __webpack_require__(1);

    var HelloWorld = {
        render: function render(component) {
            var props = component.props;
            var state = component.state;

            return _deku.element(
                "div",
                null,
                props.text
            );
        }
    };

    var app = _deku.tree(_deku.element(HelloWorld, { text: "Hello World!" }));

    _deku.render(app, document.body);
Anthony Short
@anthonyshort
Jun 09 2015 17:30
@6D65 hey! It should work fine with Webpack if you’re using the npm module. But I have no idea how webpack loads stuff from npm :) The render function you only need to call once, whenever any state changes it will just re-render automatically
The Dude
@6D65
Jun 09 2015 17:47
thank you Anthony, I guess will have to investigate further. it might be just Webpack being sloppy, probably a good reason to ditch it while I can
The Dude
@6D65
Jun 09 2015 19:02
it turns out, I was the one being sloppy. everything is working now. i guess i just hit the panic button too early
Anthony Short
@anthonyshort
Jun 09 2015 19:02
Glad it’s working for you. I haven’t tried Webpack yet so I can’t help much with that
The Dude
@6D65
Jun 09 2015 19:04
well, will give Duojs and other guys a try later. but Webpack worked really good for me in a few small projects. will stick with it for now. the require from github with versions looks cool though
Anthony Short
@anthonyshort
Jun 09 2015 19:04
Browserify is also a really nice option
The Dude
@6D65
Jun 09 2015 19:06
will have a look at that too. anyway, thank you for the nice lib, it's really a great fresh take on the whole react/vdom idea
i love the simpler interface. will try to have a more closer look under the hood when i'll have some free time, maybe we could make it even faster
Anthony Short
@anthonyshort
Jun 09 2015 19:08
Yeah that’s the plan! We have a few ideas
The key diffing could use some love, it’s probably one of the slower parts of the diffing
The Dude
@6D65
Jun 09 2015 19:18
it's a good plan. and I have a feeling it will work out. simpler systems have a great advantage over complicated ones. at least that's my opinion
The Dude
@6D65
Jun 09 2015 19:30
call me Captain