Live data from Hacker News

Show HN: Moon – fast 7k Vue alternative

github.com

81–90 of 200 posts

Re: Show HN: Moon – fast 7k Vue alternative

#81
post #59

Earlier quoted context omitted.

If you want something comprehensible and predictable, go use something else! Reflect upon this comment for a moment. What you just said is, if we want a comprehensible, predictable development ecosystem, we should just use something other than the web . Do you understand why this rebuttal is a bit ridiculous?

Honestly, no. I don't see what place ridicule has in a technical discussion.

This isn't a response. It's a dodge. Instead of responding to the substance of my reply, you've just pivoted to talking about "ridicule", which is a completely different issue that is only a symptom of the issues in the JS community: the lack of stability and comprehensibility that you seem to be willing to excuse, going so far as to tell people to go elsewhere if they don't like it, without seriously offering up a viable alternative (probably because there isn't one... The web is the web and it's unfortunately unavoidable despite the absurdity it frequently embodies).

So are you choosing not to reflect and respond to my comment? Or did you really just completely miss the point I made?

Re: Show HN: Moon – fast 7k Vue alternative

#82
post #46

Earlier quoted context omitted.

Was there a specific reason you chose to do a rewrite rather than to improve vue.js?

Yup. Moon is completely different internally than Vue. Submitting a PR to Vue would require a rewrite of Vue itself, and would change a lot of it. Moon's goal isn't to have complete API compatibility with Vue, but instead to have a light alternative with a similar API.

[deleted]

Re: Show HN: Moon – fast 7k Vue alternative

#83
post #60

Earlier quoted context omitted.

Thanks for the fast answer! That's a tough path you took and I wish you'll reach your goals. There are currently many frameworks who want to get the mind share. Would you mind to share your mindset behind the decision to split and build a new framework? Is there something in Vue you oppose or new concepts you would like to introduce? Would be very interested to hear your thoughts, I'm always on the lookout.

No problem! I wanted to build a new framework mainly because my Vue app was becoming slow and I wanted something small. Moon is 7kb minified and gzipped, that makes it really fast to load on mobile. If you take out the compiler (similar to Vue's runtime version), Moon is only 3kb minified and gzipped! Check out the Medium Article[1] and the README for more information on why I made it. [1] https://hackernoon.com/intr…

Ah thanks, missed the "Another library?" part. I think it's a good idea to address this question because this is the first one someone has after reading the title (Vue, but faster & smaller). Maybe I'll use it for some side projects, would be interesting to see if it is still easy to develop with a subset of Vue's API.

Re: Show HN: Moon – fast 7k Vue alternative

#85
post #15
post #6

Earlier quoted context omitted.

The compiler treats everything as static by default. When the compiler detects something dynamic (such as a {{mustache}} template), it will mark the current node as dynamic, and the parent node as well. These propagate up the tree so Moon eventually has a render function that is extremely optimized and can skip everything static, and the diff will only hit the nodes that can change. Moon also has a stricter syntax fo…

> There is really no way to avoid GC when you have a virtual DOM. If you keep the virtual DOM in a typed array, there is not need for relying on the JavaScript garbage collection. Here's an example: https://github.com/vandenoever/baredom/blob/master/src/bared...

what's the cost of resetting & reusing pre-allocated memory vs letting the GC discard stuff.

if the cost of resetting is greater than the cost of collecting & re-allocating, then you're in the same place. at least in my experiments of trying to reuse already-allocated virtual nodes and resetting their properties was slower than simply unreferencing them for the GC and re-allocating new ones.

have you tested the tradeoffs of your approach in modern browsers? (i see the repo is somewhat dated).

Re: Show HN: Moon – fast 7k Vue alternative

#86
post #79

Looks good, but a slight improvement in speed is not enough IMHO to switch from a proven, popular framework (like React or Vue). I think it takes a radical take on the problem to balance out the cons of using an unproven framework for any non-personal project.

It's 7kb minified and gzipped. Vue is almost 30kb. If you use a runtime version of Moon, it becomes 3kb. This makes it faster to load on mobile devices. Along with that, it also has lots of official plugins similar to what Vue provides.

>This makes it faster to load on mobile devices.

That's not very significant, since even your favicon will be of comparable or even bigger size, much less any static asset like an image.

Re: Show HN: Moon – fast 7k Vue alternative

#87
post #86
post #79

Earlier quoted context omitted.

It's 7kb minified and gzipped. Vue is almost 30kb. If you use a runtime version of Moon, it becomes 3kb. This makes it faster to load on mobile devices. Along with that, it also has lots of official plugins similar to what Vue provides.

> This makes it faster to load on mobile devices. That's not very significant, since even your favicon will be of comparable or even bigger size, much less any static asset like an image.

it's significant because code has to be additionally parsed and JIT-compiled. which is not true of images which simply blit pixels to screen as they decompress; it's not simply about size on the wire.

https://twitter.com/HenriHelvetica/status/877924754195324928

Re: Show HN: Moon – fast 7k Vue alternative

#88
post #84

So far, the Infinite monkey theorem is just giving us an infinite number of javascript frameworks, and no Shakespeare

Did this subthread get detached? I can't find it in the original post...

It's not detached. Even if a thread is detached by a mod, in my experience it appears at the bottom of the post. A new feature was rolled out recently where some get rolled up and hidden by default. They're accessible by clicking the [+n] link in the header of the top-most comment of the thread. That's how this subthread appears to me currently.

I'll look for the comment where I saw more details on this. Edit to add: I haven't been able to find the comment where this was mentioned. It was within the past couple of months, though.

Re: Show HN: Moon – fast 7k Vue alternative

#89

So moon is the alternative to vue which is the alternative to angular(ui engine)/react... Oh dear... How those frameworks want to get used in a wider manner when they place themselves in a 10% of 10% of 30% of the market segment?

> 10% of 10% of 30% of the market segment

Not really. Anyone needing a web UI framework can use Moon. Even if you haven't used React or Vue before.

Re: Show HN: Moon – fast 7k Vue alternative

#90
post #79

Looks good, but a slight improvement in speed is not enough IMHO to switch from a proven, popular framework (like React or Vue). I think it takes a radical take on the problem to balance out the cons of using an unproven framework for any non-personal project.

It's 7kb minified and gzipped. Vue is almost 30kb. If you use a runtime version of Moon, it becomes 3kb. This makes it faster to load on mobile devices. Along with that, it also has lots of official plugins similar to what Vue provides.

Does it support native mobile development? To me that's an important issue. Vue has Weex. React has React Native. Angular has NativeScript. I'd need something similar to switch to a new frontend framework.
Post reply on HN