4 ms·
I'm a big fan of Vue and I think Moon looks very promising. I have some questions w.r.t Vue API compatibility: - In Vue, you can call a method or access a vari
by samuelantonioli 9y ago
I'm a big fan of Vue and I think Moon looks very promising.
I have some questions w.r.t Vue API compatibility:
- In Vue, you can call a method or access a variable directly using this.var or this.fn, did you deliberately choose to do it in a different way or are you planning to implement this using defineProperty?
- Are you planning to implement filters and refs?
- Are you planning to make it compatible with Vue to make it a drop-in replacement?
If it's gonna be a drop-in replacement and existing code can be reused, I can imagine testing it for some projects (framework7 based).
Edit: Another idea would be to integrate all the performance improvements in Vue, Evan You is a great developer who single-handedly built this great framework and I think it's a good idea to make your ideas available for the whole Vue ecosystem. Are you having plans to do that?
- kbr 9y agoAwesome, I'll be glad to answer these! 1. I'm not planning for this, as it has a runtime cost, but it can easily be done with a plugin[1]. 2. I'm not planning to implement filters, as you can use methods instead. Refs might be coming if there is enough demand. 3. Moon is actually going in a different direction from Vue now. The core API will be very similar, but it might not be a drop in replacement for some of the advanced features of Vue. Most directives work, components are similar, but it won't be fully compatible. [1] https://jsfiddle.net/btoegknn/ https://jsfiddle.net/btoegknn/ EDIT: To answer your edited question: I agree, Evan is a super smart developer, kudos to him for building Vue! Applying some of the performance improvements might be a little complex for Vue, because Moon's compiler is fundamentally different in a couple ways. It generates code for a stricter HyperScript-like syntax (called "HyperMoon"), while Vue aims to be compatible with JSX as well. Differences like these, while might seem small, are actually pretty complex when implemented in code.
- samuelantonioli 9y agoThanks 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.
- kbr 9y agoNo 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/introducing-moon-1d44a99635f0 https://hackernoon.com/introducing-moon-1d44a99635f0
- samuelantonioli 9y agoAh 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.