Vue as the base of Blaze 2.0


#85

Worthy mentioning

  1. https://github.com/vuejs/awesome-vue
  2. https://github.com/Akryum/awesome-vue

#88

I think, at least for those of us with existing Meteor applications in the wild that use Blaze, it’s a tough call.

We have a few choices without starting over completely:

``> Stay the course with Blaze. In this case the feature set and bugs we have today, will most likely persist for some time to come. Like it or not we probably won’t get more advanced features like the Vue.js and React.js community enjoy.

``> Within our existing Blaze-front end application, try to incorporate Vue.js as much as possible. This could mean using great integration packages from @akryum to stand up new screens with Vue.js and over time replacing existing Blaze screens with Vue.js when we can. The only problem is, most of our Blaze apps either use Iron Router or FlowRouter, I myself use the latter. And in this case, from what I gather from @akryum, Vue.js doesn’t play nicely with Iron Router or FlowRouter. Instead Vue should use vue-router. So we’re in a bit of a bind here, and it seems like a no-go situation.

``> The third approach I was hoping for was to get the Blaze API overlay on Vue.js. So far, we don’t know if this is possible. If @akryum is able to achieve this feat, I think the flood gates will open up to Vue.js for us Meteor enthusiasts currently on Blaze.


#89

I am not a React fan because React takes too much time to create a simple project with meteor.
Vue.JS is awesome.


#90

I don’t see why Blaze needs to be replaced or indeed why Vue is the best alternative. Its a very nicely designed and implemented library and you get the benefits or vdom, better performance, components if you wish but I don’t think it fundamentally changes the programming paradigm.

The value of React IMO is that it enables us to reason about and build declarative, data driven apps using mostly FP principles. That may sound like buzzwords but this is the primary reason it has seen such high adoption, not the fact that it added vdom or was from FB.

If I have to learn yet another DSL, I’d like to stay with Blaze and remain compatible. It’d be great if Vue were to become a first class citizen with official support from MDG, in the same way as React/Angular are supported as the rendering layer today. The other advantage of Vue us that its more prescriptive than React, e.g. including a router, and that is in the Meteor spirit of favoring convention over configuration.

Integrating with Apollo/GraphQL/any future data layer is also going to be a problem with any templating language, it simply cannot be done without extending the DSL. This is one of the real benefits of using plain JS everywhere as you don’t have any restrictions.

From what I read, MDSG resources are limited and they have a lot of items on the backlog - Apollo, npm Meteor, webpack, all of which are priorities. Adopting Vue (either directly or underneath) doesn’t seem like a priority above those, esp if work on Blaze2 is already far enough along.


#91

Well, it all depends. If you want want the most advanced and performant UI framework, Vue.js is it ATM – not React – IMO. Now what Vue.js lacks, and Blaze possess is of course deep Meteor integration. Some of us hope this can be remedied, or otherwise worked around somehow. I love the Blaze API but want everything else Vue.js has to offer. Some hoped we could build a Blaze2 on top of Vue.js.

I would be willing to put in the time to learn Vue.js, but again there is no real path for someone that has a Blaze legacy application as a foundation.


#92

I am all for building Blaze2 on top of Vue and wish all success to the project trying to do so. My only concern would be if the view layer was switched to use Vue and Blaze was deprecated/discontinued.

Current Meteor devs would be forced to learn a new technology. The same concern applies if Meteor switched to React, which is why I think it won’t happen, MDG has a pretty good track record of maintaining compatibility.

Whether Vue or React are more advanced is a separate issue, I think there’s a lot more to it than raw performance. e.g. Inferno is clearly the champion when it comes to performance. React Fiber, if it comes out in a timely manner, will narrow the gap. These things are always in flux. Choosing a view layer for a huge framework like Meteor would consider a lot more issues.


#93

I feel like, as a Meteor developer, I’m cheerfully strolling along the golden streets of my secret city in the clouds with Blaze +ViewModel, and that there’s a Holy View Layer War going on down on earth.

(I’m fully aware it’s not the most performant option, if all you care about is rendering speed, but you can’t beat the developer experience)


#94

Wouldn’t it be probably simpler to learn and easier to get backward compatibility to go for Riot.js instead of Vue?

What would it take beyond:

  • Integration with Meteor tracker?
  • Adding Spacebar as a pre-processor option in Riot.js in addition to the existing Jade/Pug, CoffeeScript, LiveScript, TypeScript, ES6, Stylus, Less and Sass?

What are the killer features that Vue has and Riot lacks?

Just my disturbing 2 cents…


#95

How do I use Vue in my meteor application as a beginner coming from blaze. Blaze should just be for older apps and newbies.


#96

Here’s a framework comparison, Riot is in there: https://vuejs.org/v2/guide/comparison.html


#97

There seems to be no master guide AFAIK. @akryum has built a few libraries/tools to help integrate Vue with Meteor. He seems to be the only one working on such projects ATM.


#98

That’s kinda the point of this entire thread (if you read the first post you’ll know what I mean). Blaze is kinda done from what I can tell. Sure there is a little work going on, but nothing too far reaching I’m afraid.

We were hoping to keep the Blaze API, and build a Blaze2 on top of Vue, keeping it as backwards compatible as possible with Blaze1 (as to not break too much in the transition). Thereby keeping the Blaze we all know and love, but also gaining the unbridled performance and top of the line feature-set of Vue.


#99

As does Vue with functional components and render functions (or JSX). React doesn’t have much more other than a bigger ecosystem compared to Vue.


#100

Yes, I have seen that but:

  1. This is on the Vue website, so of course it’s going to be biased towards Vue’s marketed “strengths”;

  2. Even though, what is the killer difference in favor of Vue in this list in the context of Meteor integration?

  • Doesn’t Meteor built-in reactivity already provide automatic conditional rendering?

  • Meteor already provides built-in build tools and the flow router, so the supposed more sophisticated router and more standard build tools of Vue seems irrelevant to our purpose here;

  • The statement on dirty checking is controversial and more of a playing around grey area definitions https://muut.com/i/riot-js/using:riotjs-vs-vuejs

  • IMHO opinion virtual DOM vs. dirty checking vs. a little bit of both is not a pro or cons in itself, without representative and diverse app benchmarking empirically but rigorously comparing the performance of the frameworks based on each approach.


#101

I’d suggest using the official router of the view framework, so using the Vue router would be a good idea.


#102

I’m looking forward to hearing progress on this!

And I’m hoping MDG does make Vue a first-class citizen. I’m not sure why there’s not much excitement from MDG about Vue! Seems to much more for React and Angular.


#103

Can somebody please add Riot to this benchmark? https://github.com/mitar/meteor-blaze-benchmark :-
)


#104

From the first glance Vue seem to be much more understandable and clean compared to React. Somehow it feels a natural evolution of Blaze…


#105

I couldn’t be happier finally this is happening :slight_smile:

I’ve build a large app, using Blaze + ViewModel, even being the slowest framework, It works just fine for me! (another Blaze fan here!).
I agree that retro compatibility with Blaze is necessary for Blaze2, the ViewModel approach in terms of usability was the natural next step in Blaze for me, and now I look at Vue, and looks like the natural step forward.

@akryum started this amazing proof of concept for Blaze2, and I think now we should get to work and follow him on that path.

I think the smart (elegant?) approach to this development, is to divide it in two projects:

  • Vue as a first class citizen in Meteor (Maybe through a package at the beginning, then MDG can merge it to core).
    • I agree with @sashko in that Vue router should be used for Vue.
  • Build a wrapper (Blaze2) to allow Blaze syntax to be transpiled to Vue syntax (is this akyrum proposal?).

This way, the ones who go the Vue way would want to maintain the Vue project, making Blaze2 a lot easier to make/maintain for the rest of us.


#106

Thinking only in terms of retro compatibility, Riot could be a better fit.