These are chat archives for mithriljs/mithril.js

22nd
Sep 2015
James Forbes
@JAForbes
Sep 22 2015 00:26

can I get a rough sense of peoples opinions of angular? I have never used it, and I have no interest in using it currently. But it is everywhere, and I'm wondering if there are any interesting aspects that I may be overlooking. I'm particularly curious what a bunch of mithril devs think of it.

My current impression is that it is the framework enterprise java shops use because they are afraid of javascript. Is that unfair?

Gilbert
@gilbert
Sep 22 2015 01:30
@JAForbes Personally I've seen companies start to switch from angular to react
and before angular, everyone was using backbone
I wouldn't worry about a framework if you see it everywhere. It will probably get displaced by another framework in a year or two
by contrast, mithril only takes a small percentage of your app, so there's no big risk in using it
Jakob Dam Jensen
@jakobdamjensen
Sep 22 2015 07:05
@JAForbes people switch because they blame poor quality of code & structure on the framework and not the people writing the code. A lot of great products has been built with both Angular & Backbone. It doesn’t really matter IMO. You’ll be able to mess up projects not matter what framework used :)
Bebliuc George
@Bdesign
Sep 22 2015 10:17
hello
shouldnt m.route() call onunload() just like m.mount() does?
djazz
@daniel-j
Sep 22 2015 11:00
Hello world, Mithril! I'm new :)
Am I doing stuff like I should (use debugger to see source)? http://daisy.djazz.se
James Forbes
@JAForbes
Sep 22 2015 11:14

@mindeavor thanks for the article, that was a great read. And I am not so much worried, as just curious if my decision to avoid it was unfounded. If it has some great design aspects I'd like to know.

@jakobdamjensen very true. I personally still like Backbone quite a bit. I wouldn't use it by choice anymore, but I'm quite happy using it when I have to.

hey @daniel-j
Ondrej Brinkel
@der-On
Sep 22 2015 14:33
Is there something like unconfig that is called before or when an element is destroyed?
Arthur Clemens
@ArthurClemens
Sep 22 2015 14:33
yes, see the config documentation
Ondrej Brinkel
@der-On
Sep 22 2015 14:33
I currently have the problem of using requestAnimationFrame recuresivly within a config and on every route change I create another recursion.
Stephan Hoyer
@StephanHoyer
Sep 22 2015 14:34
function unloadable(element, isInit, context) {
   context.timer = setTimeout(function() {
       alert("timed out!");
   }, 1000);

   context.onunload = function() {
       clearTimeout(context.timer);
       console.log("unloaded the div");
   }
};
Ondrej Brinkel
@der-On
Sep 22 2015 14:34
@StephanHoyer thx
Rodrigo Álvarez
@Papipo
Sep 22 2015 16:08
@ArthurClemens I am still kind-of integrating Framework7
The styles are great, the problem are the behavious on some events, I'm not sure about how to use them properly
They seem kinda intrusive
Arthur Clemens
@ArthurClemens
Sep 22 2015 16:16
@Papipo UI behaviors or JS?
Rodrigo Álvarez
@Papipo
Sep 22 2015 16:16
UI behaviours, which depend on JS
things like material ripple
Arthur Clemens
@ArthurClemens
Sep 22 2015 16:17
ah yes
Rodrigo Álvarez
@Papipo
Sep 22 2015 16:17
popups that darken the screen that leave behind
I can kind of duplicate them with my own stuff
but it would be a lot better to just use FW7
I have some ideas thou
Arthur Clemens
@ArthurClemens
Sep 22 2015 16:18
what do you want to change then?
Rodrigo Álvarez
@Papipo
Sep 22 2015 16:18
I don't want to change anything, it's just that this is a lot less intuitive than I expected
For example, I want to have tabbed navigation
and I don't want to load content in the tabs that aren't active
Arthur Clemens
@ArthurClemens
Sep 22 2015 16:19
sure
Rodrigo Álvarez
@Papipo
Sep 22 2015 16:20
It's not straightforward. It's doable, but it's not just like "paint everything and let fw7 handle the UI"
Arthur Clemens
@ArthurClemens
Sep 22 2015 16:21
that’s even not the case with bootstrap
Rodrigo Álvarez
@Papipo
Sep 22 2015 16:21
yeah, I think that FW7 could be more decoupled
Arthur Clemens
@ArthurClemens
Sep 22 2015 16:21
a lot of work can go into things that seem simple
Rodrigo Álvarez
@Papipo
Sep 22 2015 16:21
yep
the problem is that I love how the app looks XD
being able to "switch" to material or iOS is awesome
of course I probably need to do some tweaking, but still...
It would be nice if I could extract some mithril-fw7 integration
Arthur Clemens
@ArthurClemens
Sep 22 2015 16:25
For sure
Rodrigo Álvarez
@Papipo
Sep 22 2015 18:40
is there a way to return an array from a view?
right now I need to add an extra div just because
Arthur Clemens
@ArthurClemens
Sep 22 2015 18:40
for nested view you can't
Gilbert
@gilbert
Sep 22 2015 18:40
@Papipo Only if it's a top-level component. Other components need to return some kind of element
vnc5
@vnc5
Sep 22 2015 19:24
http://codepen.io/anon/pen/bVeZXb does anyone know why those dom nodes will be recreated? at least it seems like it because the animation isn't working like the vanilla version
Rodrigo Álvarez
@Papipo
Sep 22 2015 19:31
I would say that you need to add m.redraw.strategy("diff") to the controller
vnc5
@vnc5
Sep 22 2015 19:34
doesn't work either
oh you're right
in the route components
Hmm i thought it would be diff by default. Seems like i misunderstood the documentation
Rodrigo Álvarez
@Papipo
Sep 22 2015 19:40
yeah, I thought so too somehow