I'm pretty sure this is all with the best intentions, but this would be a disaster similar to how Angular suddenly changed everything.
Not against change, but the API is fine. Just iterate and evolve it.
disclaimer: Big fan of Vue, early user and conference attender..
To be fair to Angular, if they'd stuck with what they had, it'd have faded into obscurity far more than the current version has. Angular.js was great for its time, but lost most of its advantages as the web caught up, and what used to be its advantages started to become kludges.
Like trying to take jQuery and make it a framework like React. But in their attempt to make it "simple" they made it useless. And then the next generation of frameworks like React came out and basically killed it.
jQuery did it right. They decided on a methodology and stick with it changing the internals and gradually adding features.
> “The proposed APIs are all new additions and can theoretically be introduced in a completely backwards compatible way.”
One thing they want to avoid is the whole Python 2 vs 3 distinction that went on forever. I’m not entirely sure these differences are that significant but having to merge in all of the data/computed/watch etc options into a single setup() function would require quite a bit of refactoring.
That was overplayed in my opinion by Python 3.2 or so a large percentage of Python 2 code could be made Python 3 code with the addition of: from __future__ import print_function at the top of the file (provided your libraries also went to 3 that is) most people didn't use any of the stuff that was removed.
Edit: Because my comment will probably age poorly, the old headline used to be: "Vue 3 set to change in a big way – Current Syntax to be deprecated"
For me, working in a large project with TypeScript vs one in vanilla JavaScript makes all the difference in terms of how maintainable it is. The number and the nature of the tests I need to write for such project changes, the IDE tooling available makes development much more pleasant, and I generally feel like it is harder to write code that is buggy, because a large amount of potential errors are avoided through use of the type system.
Whether or not they've made the right decision with this split is a different question that I can't answer.
99% of people that got into Vue.js use it because it felt like an anti of the ever changing, dragon chasing JS world.
Changing the syntax will almost certainly yield zero benefits to the folks out in the field running apps for their businesses. They will end up with the same app, with the same functionality, just $100k lighter due to hours burnt on refactoring to the “function based” API.
Everyone roles their eyes and the bad wrap Javascript has continues.
What the hell.
Anyway, when it comes to programming, I've found that a single person can often (not always) do a better job than committee rule.
I think it cuts both ways. As a sole developer he can push Vue quickly into new directions. It has been part of Vue's success and will be the cause of its downfall.
Vue has a history of rough upgrades, version 1 to 2 wasn't fun.
logo win32 tk latex opengl mfc html wxwidgets awt swing fltk glut android ios tapestry play templates hugo static site generator vue.js scratch
I'm sure I've forgotten a few.
There is a lot of FUD in this thread so we need to clarify a bit:
- This API is purely additive to 2.x and doesn't break anything.
- 3.0 will have a standard build which adds this API on top of 2.x API, and an opt-in "lean build" which drops a number of 2.x APIs for a smaller and faster runtime.
- This is an open RFC, which means it's not set in stone. The whole point of having an RFC is so that users can voice their opinions. It's not like we are shipping this tomorrow.
For more details, we added a Q&A section at the top of the RFC to avoid further confusions: https://github.com/vuejs/rfcs/blob/function-apis/active-rfcs...
Earlier today, there was a "Standard" build and a "Compatibility" build.
The "Standard" build excluded support for "data", "computed", "methods", "watch", "provide/inject", "mixins", "extends", and all lifecycle hooks.
In the updated document, the old "Compatibility" build became the "Standard" build, and the old "Standard" build became the "Lean" build.
It would be easy to just say "yes, I got a bit carried away with the naming and my big future plans, but the community reaction made me realise perhaps it was not a great idea"
Insead he's like: "what? it was the plan all along :)"
That's a clue for where the Vue team's mind is regarding the current API. Compatibility to me reads like legacy. That's in contrast with the claims above that this is just a new optional API to serve a broader range of use cases.
"This API is so different, shouldn't you rename the project?"
Scroll down in the comment threads here and you'll see this question raised over and over again; I think it's fair to say that it is "frequently asked" and belongs in a FAQ.
There seems to be an overall trend towards more reactivity and I applaud Vue for taking a creative approach to that. Will it stay, and become the da facto paradigm to do webdev? Only time will tell, but I don’t think we should be afraid to experiment with it.
The Vue team have always been excellent stewards of the project. I’m sad to see so much negativity here :(
I still get answers for Vuejs 1.0, with suggestions to use 'partials' for example, only to find out that there exists no such thing in Vue 2.0.
This would be very bad for developers if they still call it Vue with another version number.
Even if they call it VueThree, VueNext or similar then the problem can be easily mitigated I think.
Being able to find answers quickly is a big win for beginners.
I want a JS framework simple enough that even hobbyist devs can understand in an afternoon.
React syntax is an overly complicated mess; like reactivity forcing itself onto HTML.
Current Vue syntax is neat, simple and clear; like HTML with added reactivity.
What now? Are you talking about JSX? If so, it's pretty straightforward (and optional).
I've been meaning to start a project with Svelte 3, but I'm not sure what tools to use. Is Sapper ready for v3 or is it still mostly on v2?
I've also somewhat been hoping that Svelte 3 will get TypeScript support so I can have a typed interface between my Svelte frontend and my Rust backend...
Svelte 3 was released 2 months ago, but TypeScript support is still in the works: https://github.com/sveltejs/svelte/issues/1639#issuecomment-...
We in the Svelte world love it so much, it seems highly unlikely there will be any drastic switch from what we've all grown to love. (It's truly fantastic, give it a whirl: https://svelte.dev/repl/hello-world?version=3.5.3)
(Side note: I actually clicked on this link hoping Vue was learning a similar lesson, only to be disappointed.)
I support all the choices you make, but there are those of us who have good reason to value useful complexity. <3
Change isn’t a bad thing but nor is change for changes sake.
I can understand that the changes here might not be worth it to some, but to call them "for change's sake" is disingenuous and unfair to the Vue team, I think. The linked page clearly motivates the changes. Whether those motivations weigh strong enough for you is a different matter.
iOS is far and away the saner of the two if you wanna pick just one, plus it's an easy gateway to the whole Apple family of devices (watch, TV) including, soon, macOS itself. Android's broadly less pleasant and any devices outside phones that happen to be running it are likely to be batshit insane to work on, but it's still way better than the web, and a ton better than it was back in the 4.x days (let alone the 2.x/3.x split days—oof, it was hot garbage back then)
I can actually handle the churn and the random rewrites, a lot of them have been marked improvements, that doesn't bother me. What bothers me is when things change in ways that make them more complex than they were before, which also happens constantly.
Not only that but I'm sick and tired of tool developers pandering to noobs. Nobody should ever be learning to use a library like React before understanding the programming language they're working with. For the React team to come out and say something as stupid as 'classes are too hard', in the context of the sheer wall of accidental complexity around the front end space, is a joke.
All the problems with PHP back in the day are going to come back with a vengeance when our new generation of coders that don't understand basic language constructs all graduate to tool making.
Here's the problem: when Vue was released, people jumped on board because its design was incredibly simple when compared to React, which at the time was heavily focused on the functional, performance based approach to UI development (and to this day, still is.)
If you've got a team that's super focused on performance and loves FP, React is always going to be the better choice. Facebook continues to invest heavily into performance improvements. I can appreciate that you guys care about performance too, but you're now stepping on the toes of the guys who really only care about that one thing.
Performance is not the selling point of Vue, nor is functional programming or any of the other weird changes that have been introduced in this RFC. Nobody looked at Vue and was like, "wow, thank god Vue is 2ms faster than React when you render this benchmark component a thousand times."
The people who adopted Vue are the ones who had first rejected the complexity introduced by React. And now your team is saying "well, this approach is for more advanced users" -- what an insult, honestly. Many of us had the foresight to recognize that the complexity introduced in React was not worth it for our teams, or we had already experienced the problems that such complexity introduces, and we chose Vue because it managed in general to be as effective as React without the fuss.
What Vue 3 seems to be is an answer to the question: how can we beat React at its own game? And congratulations if you've done it, but that's not what your users are here for. That's not what we pitched to our teams, our bosses, our stakeholders, etc.
My question to you is: honestly, how am I supposed to manage this? The long term answer seems to be that I have to change my code base to this new syntax (beyond or during Vue 3), at which point I'll be right back where I started when I decided to leave React for Vue. Do you think this is fair to ask of your users? Are you sure this is what we want?
Second, I think it is over-simplifying the issue by equaling the new API with Complexity. The RFC can be tough to grok because it is dense; but actually looking at some examples will probably show you that the new API really isn't about "complexity": https://gist.github.com/yyx990803/762ec427882a61be3e4affe02f...
Vue has a wide range of users. I honestly don't quite get how introducing an optional API can be an insult - because we clearly see some use cases we ran into can be more elegantly solved with the new API. Maybe you haven't run into them personally, but that doesn't mean your use case is "inferior" - we are all dealing with different types of applications. However, I think it would be a real insult if you think Vue will never have a use case that is complex enough to warrant these advanced APIs.
Regarding your question: feel free to stay with the current API for as long as you wish. As long as the community feels there's a need for the old API to stay, it will stay. The only one that can make the decision to switch to the new API is yourself.
Meteor.js, another project with which you are familiar, started with a similar promise of developer simplicity, but it was subsumed and abandoned in favor of the "Facebook-level scalability for all apps and at all costs" mantra that has swept through the JS community.
Regardless of the nuances of this RFC, please remember the value of simplicity as Vue evolves.
I dont know if that's true, I think react is super easy, but I prefer the template approach of vue. I think a lot of people are just searching for a modern angularjs that's not the monstrosity angular 2+ is.
This will require one hell of a migration path to support and I imagine lots of people will be on that "Compatibility Build" for a long time. I'm very, very curious whether folks who have large-scale Vue apps have had a look at this proposal, and if they've had any input on it.
Even the decorator thing was problematic. Remember that the core Vue library is supposed to work both with and without build tools, but in case of TypeScript it's not possible. There is a decorator proposal for JavaScript but it works differently than the TypeScript one so there would be a clash.
In the meanwhile we found out a new solution that not only solves these but also some other problems (composability).
The primary change seems to just be merging most of the keys/options (data, computed, watchers, etc) of the module into various functions within setup() which itself may require from coding best-practice guidelines since setup() is going to get pretty big.
I’d love to see a largish component converted to be able to compare the two instead of the small examples with one or two functions within it.
I should have never left C.
Did you read the linked motivations?
Now Vue is maturing and becoming more Angular/React like...so it's only a matter of time before another framework comes out that replicates VueJS2/AngularJS in being super easy to jump into and just write code and the cycle repeats.
I can recall the time when I moved past Angular when they introduced so many breaking change on their next version. I started using React but was not comfortable enough to keep pace with its progression. Then I found Vue which was a breath of fresh air as this framework has allowed me to deliver end products faster yet being simple enough to allow for easy scalability & enhancements.
With these upcoming enhancements, I hope that it wouldn’t introduce major changes that would require for me to rewrite large portions of my applications.
I have a lot of trust and confidence with Evan and the Vue Community and I guess all these changes are in line with best practices and better productivity rather than following a path because another framework is doing things like that.
"Is this like Python 3 / Do I have to rewrite all my code? No. The new API is 100% compatible with current syntax and purely additive. All new additions are contained within the new setup() function. 3.0 standard build will support 2.x options plus the new APIs, but you can optionally use the lean build which drops a number of options while providing a smaller and faster runtime. Details
2.x options compatibility will be kept through the entire 3.x lifecycle."
https://github.com/vuejs/rfcs/blob/function-apis/active-rfcs...
https://www.youtube.com/watch?v=95haj8RqR5o
This is what Vue 3 is using -- Proxy support enables really easy and natively supported observables (as well as enabling a bunch of other crazy stuff), and it's actually pretty impressive.
I think the reactivity system is Vue's biggest wart -- I've been surprised by it way more than I would expect. I strongly dislike the complexity react seems to encourage, I'm not a fan of hooks, but I am coming around to seeing this as a way that Vue gets closer to KnockoutJS -- not as a way that it gets closer to react. Knockout had the simplest reactivity model you could ask for -- make an observable object and you're done -- it's observable, no surprises, very predictable interactions/behavior. I'm choosing to think of this as Vue going in this direction, although by more complicated means (Proxy vs a simple souped up observable wrapper).
That said, at this point I feel it's up to Vue to bungle my high opinion of the project -- they made it this far by being the simplest component frontend library with the best features, and the day they stop being that I'll be moving on. Already warming up to MithrilJS in my own projects, it's wonderfully minimal, performant, and light.
But if I had to find a new framework for some reason, I'd probably go with Vue.
In case it wasn't clear, I still think Vue is the best minimal component library all things considered -- simple syntax, simple and mostly clear usage, support for typescript, not too much overbearing tooling (they're trying to "fix" this with vue-cli though), and a large community & ecosystem. I'm just scared they're going to blow it and start putting in , but I'm well aware I'm just a hanger-on to the project (I don't contribute to it).
Mithril[0], on the other hand is almost allergic to change, in the linux kernel way, which is great until you have a problem with how it works or think it should work differently. Mithril is also the most complete though -- it has routing, AJAX, all that stuff built in (context: normally when people say "vue/react" they mean "vue/react + vue/react-router + vuex/flux"). I also particularly like how Mithril uses the hyperscript syntax and just calls it a day -- full "single file components" without the transpilation hassle. Mithril also passes one of the key indicators for high quality software, a comparisons page[1].
Shameless plug -- I wrote a short guide[2] on how to get started with mithril & parcelJS (ignore the link URL, I started with rollup and then quit because it was too inconvenient to use, I write about it in Step 5):
[1]: https://mithril.js.org/framework-comparison.html
[2]: https://vadosware.io/post/mithril-systemjs-and-rollup-gettin...
(just like Evan did when Angular went rogue)
Js template strings insert any text as is, rather than encoding HTML special characters to avoid injection exploits
I decided to pick up front-end JavaScript a year ago and chose Vue. Although I'm a fan of that specific framework, one thing that I found annoying about the ecosystem (and the great JavaScript family in general) is the "unsteadiness". When I go on StackOverflow and look at questions related to, say, Flask and I see answers dated 2012, I have a sense that although Python has mostly migrated to version 3 now, the answers that I get are likely still relevant today. It's not because Flask has always made the right design choices. But the maintainers stick to their decisions, because people have already invested time to learn to do stuff that way. It's not the best approach, it's not the worst either. You just learn it like this and when you have a problem, you ask on StackOverflow and someone will tell you what hoops to jump through. You'll scratch your head for a minute, but then be on your way to get shit done.
When I look for an answers related to Vue, everything seems to have an expiry date attached to it. Anything dated 2017 raises flags in my mind. Things seem in a constant state of flux. It's like trying to learn to walk on quicksand.
I saw the list of improvements/simplifications/deprecation. Not bad. If Vue was a fresh new framework these changes might have had more value, but it's not. A lot of time and efforts have already been invested to learn to do things the Vue 1 way and the Vue 2 way (not to count the accessory libraries and tooling). So I don't know if after tallying up all the pros and cons (which go beyond the technical concerns listed in the specs) whether this change might actually be more costly than helpful.
Because of libraries are working around javascript's limitation, it is inevitable that they will be as fast and ever-changing as js and js ecosystem is
About a year ago, my team rebuilt a large solar power plant prediction modeling Angular 1 application with Vue.js 2.0. It was the only big bang rewrite I've heard of that was a massive success. I work in Vue.js everyday and swear by it. Mr. Evan You, don't do this to us.
My big question is how does this approach scale, and does it need a more fleshed out set of helpers, a la the mappers they have in the current API. Won’t really know until I work with it. Would also love to see how this approach works into, for example, Vuex.
I moved to Inferno + MobX because the cognitive overhead is practically nil. You can architecture your application and specially your state in any way you wish since your reactive data is made of objects, classes, or whatever you want to use.
MobX also makes your React/Inferno components much more enjoyable. No need to use setState() anymore since your component state is reactive much like Vue or Svelte do.
After using that for a while and coming back to an old Vue/Vuex project I realized how many conventions and ad-hoc abstractions it has which was quite oppressive.
A couple of weeks ago I discovered mobx-jsx[1] which is pretty interesting. It's a very thin rendering library that compiles JSX to imperative DOM instructions and relies on MobX for tracking state changes which makes the virtual dom irrelevant. It adds loops and conditionals which IMO are the biggest annoyances of using JSX. This is probably what I'll be moving on in future projects.
(Actually what converts JSX to DOM instructions is a babel plugin from the same author)
Edit: Might as well give it a completely new name.
Here's a rule for framework creators... if your framework is changing more than jQuery has in its entire 13 years of existence, save everybody the pain/frustration and just start a new framework.
People want to build UI. They don't want to migrate from function components to class components. They don't want to migrate from mixins to HOC. They don't want to migrate from Hooks, to whatever comes next. They just want to build UI by writing code once such that it stays performant and maintainable for as long as possible.
Now is a good time to switch to Svelte / Elm / Whatever. Something that helps me declare my UI layout and behavior with a minimal API, but has a deeper understanding of my intentions. Such that, whatever that is better is eventually a compiler advancement - not an userland API change.
If you have comments, this is where to tell the vue team: https://github.com/vuejs/rfcs/pull/42
(And also: with not that much pressure to adopt it. Having a "Standard" and a "Compatibility" build does result in that pressure.)
The syntax proposed here is much more imperative, making it more difficult to read and understand components.
I think this undoubtedly means that Vue's private prototype they've been working on will be thrown out and they'll be starting from scratch again, which means Vue 3 probably won't be out for at least another year or more. If Evan and the team proceed with these proposed changes, it'll be the end of Vue.
To give a timeframe, this is the first major rework of this web based UI in nearly a decade. I wish these JS libraries had longer support timelines.
We don't all work as freelance webdevs or in some startup. I work in a bloated, slow, soulless financial services firm; depreciating now or depreciating in 3-4 years as part of Vue 4 time might as well mean you're depreciating next week; it'd be the height of irresponsibility for me to use Vue for a new project knowing I would need to refactor everything, I'm going to have enough code to rewrite as a result of this as it is.
But.....that's not a sufficiently compelling reason to change. Even with backwards compatibility, it still adds confusion to the mix, requires a huge effort in new/updating documentation, etc.
I can't really see how the benefits justify the effort.
Plus, at a glance, it seems very easy to pick up and very intuitive.
I also appreciate that you stay away from "javascript classes"
I don’t yet have an opinion on the wider changes but this is great. Tree-shaking really helps bring down file sizes and I’m not in the camp of “it only loads once and caches” group that disregard file size these days. And not just because that’s no longer true with async component loading depending on the route/page.
This gain will be visible for all Vue developers regardless of which API they use because we all want to have the best quality libraries in our ecosystem.
Thinking about transitioning (from AngularJS) to Vue, but prefer FP to OOP, and I’m glad that these new value wrapper things can be passed or used as partially applied arguments, as well as the other functional composition support changes.
IMHO, composition functions are an elegantly simple and well thought through addition to Vue brought about by a good consultative process. I think this demonstrates that Vue is in good hands with intelligent and wise counsel steering the ship. This small change is nothing like the Angular v1 => V2 experience! No one is breaking backward compatibility!!
Vue is all about coding simplicity ... and although reading through this RFC is at times heavier reading (meaning Evan's team thought through this addition very thoroughly), the final outcome is not! It's uses syntax that is very similar to existing Vue components so if you needed to refactor existing larger components into smaller composition functions, the coding experience is fast and would feel very natural and familiar with minimal to learn. No one is forcing this additional on you ... its just there if you needed it.
So please before getting spun up on any further misinformation in this thread please read the RFC from Evan You or this very thorough explanation of the RFC which has some nice coding examples.
- https://dev.to/danielelkington/vue-s-darkest-day-3fgh
Is it just React Hooks? ... here's a Comparison
- https://github.com/vuejs/rfcs/blob/function-apis/active-rfcs...
My personal journey
I've coded Angular/Ionic, ExtJS & Sencha Touch, Knockout/jQuery in the past. Learning Vue was nothing like learning and keeping up with these! I was highly productive in Vue in 3 days and the learning curve and documentation was much simpler and lighter so more time to stay focused on the code. I've refactored a legacy boostrap/jQuery web site into nice Vue components in a few hours (impossible with the others!).
I'm absolutely loving the super productive Quasar Framework built on Vue 2.x/3.x which now delivers 130 components, directives and boot plugins with builders for ALL platforms: Web or SPAs (Desktop & Mobile), PWAs, SSR, SSR + PWA, Cordova iOS/Android mobile, Desktop/Electron and dream documentation.
- Check it out: https://quasar.dev
We also have our own Redux/Vuex-inspired uni-directional state management solution that uses immer under the hood.
The next step, largely motivated by the fact it's hard to find developers who want to work with older frameworks, is to convert the app into Vue from the inside-out using ng-vue as glue, and when all components are Vue, remove the outer angular shell.
So we have been tracking these proposals. The original class-based RFC looked perfect for us, since that was 95% matching how our current (class-based) components look like. Seeing it get abandoned was a cold shower, but okay, not the biggest problem. Our components are as dumb as possible anyway, and we have all business logic in services. It'll just be some additional manual text-wrangling work.
The new proposal looks okay. I guess, just as React hooks made classes unusable in React, they had to go from Vue as well (though honestly, I don't really see the fascination with hooks, but maybe that's because we don't do anything like the Hooks examples I've seen in our app). I do really like the idea of the reactivity system being completely separate from the rest of the framework.
I personally never liked the original JS-only API either, with the { props:, methods:, computed:, } etc. "separation" (commenters here call it "simple", but I think it's far from that), so in my Vue 2.x projects I used vue-class-component.
Overall, the motivations and reasoning in this RFC seem sound to me.
However, here I come to my three biggest problems I have with this API:
1) The fact that you have to return the render props from the setup() function. It's annoying repetition, and I foresee people forgetting to add a newly added prop here. It also makes the definition of the component feel procedural instead of declarative. You have to read/mentally run the setup function to know the shape of the component. Hopefully maybe you can notate the setup() function return type to match a TS interface without breaking editor support?
2) The fact that they couldn't come up with a better-looking way to declare a prop with a complex TS type other than `prop: (null as any) as PropType<SomeComplexType>`. I guess I could make a noop generic helper function for this, though.
3) props are optional per default. I feel this is the completely wrong default for a TS project (mentioned as a consideration in the RFC though)
// expose bindings on render context
return {
count,
plusOne,
increment
}
No, this here is why you want classes. On a large project you are going to have multiple people touching contiguous code. This block is going to have several pages of code between it and half of the declarations and that kind of ping pong is no big deal for a limited percentage of the Dev population but is NOT trivial for everyone else.There’s a difference between having a problem and admitting you have a problem and lots of devs trip up on code constructs like this on a regular basis. It’s double data entry and that is bad. It also hamstrings editors, adding friction to discoverability. All things I shouldn’t have to explain to a framework writer but constantly find myself having to soapbox.