📜 ⬆️ ⬇️

The creator of Vue.js is responsible Habra



All with friday!

As promised, we publish the answers of Evan You (Evan You) to the questions that we have long and painfully collected in the previous post , as well as the Russian-language Vue chat in Telegram.

In general about Vue


Q: What is the most unique killer feature of Vue.js?
O: Progressive adaptability: you can use it as a replacement for jQuery or create applications of any complexity using the CLI, the router and Vuex.
')
Q: What are the weakest points of Vue?
O: At the moment, probably, unfriendly to typing. Our API was developed without scheduling support for typed languages ​​(such as TypeScript), but we made great improvements in 2.5.

Q: React calls itself a library, Angular calls it a framework. Why is Vue positioning itself as a framework?
O: “Progressive framework” means that it can be used as a library OR as a framework, at your request. We have parts of the framework (CLI, router, state control patterns), but no one forces them to use if they are not required. (see more detailed video (eng) - lane comment )

Q: Is Vue a complete replacement for React / Angular or is it a niche framework?
O: Yes, it can be a complete replacement. This is not a niche framework.

Q: What is the expected life cycle of Vue.js? Will Web Components / VanillaJS be able to replace JS frameworks in the near future?
O: We are growing pretty fast, and now we are in a relatively stable / mature state. No, I don't think Web components will ever replace frameworks. They are only low-level building blocks. Even if you use them today, you most likely have to use Polymer, which * is * a framework for Web components. It has its own additional APIs, patterns, libraries, and tools. The advantages of Web components are mainly in compatibility between frameworks or third-party packages (3rd party distribution). Inside the application, they do not give anything new in comparison with existing models of components (in fact, they can be less). VanillaJS only makes sense if you can afford to spend an eternity on developing a project.

Q: What is Vue's policy regarding deprecation, incompatible changes and backward compatibility?
O: We follow semver . We can declare features obsolete in minor releases, but in fact they will not be removed, so your application will not break. We are very cautious about major versions / incompatible changes and do not plan them in the near future.

Q: What is the recommended code structure for Vue: OOP or OP / Declarative approach?
O: Neither the first nor the second. I think it is pointless to pull high-level paradigms on the UI code. Choose good ideas from both. But if you really want to choose the side of Vue, then I think there will be a little more OOP.

Q: Forms are a strong feature in Angular and weak in React. How well does Vue work with complex shapes?
A: Vue has a built-in two-way binding (binding) in the form of a v-model, which is very similar to Angular's ngModel. It is also possible to build Angular-like validation libraries on top of, and several already exist in the ecosystem.

Q: What are the biggest competitors of Vue in China?
O: React and Angular are very popular in China. In addition to them, in fact, there are no others.

Q: It is rumored that Vue determines that the benchmark is running, and specifically inflates the test results (hello, VolksWagen!) Any comments?
O: Rumors without evidence remain only rumors;) The Vue.js code is publicly available, so if you have such a code, you can easily find it.

Third Party Tools


Q: What are the prospects for Weex? Should I start working with Weex now? Or is it better to concentrate on working with NativeScript-Vue?
O: Weex - reliable technology, because It is widely used inside Alibaba. Simply, unlike others, they do not allocate a lot of resources for documentation / developer support. NativeScript-Vue has better documentation and feedback from developers. I will not give unambiguous recommendations, because your choice should be determined by the team / product / environment. To find out the full potential of these technologies, you need to try both.

Q: What do you think about Nuxt?
O: Nuxt is a great thing. If you need SSR under Vue - use it, if you don’t want to customize everything yourself (there are also framework-independent alternatives like Razzle - approx. Lane )

Q: What do you think of the Quasar Framework for Vue.js as an analogue of ReactNative for React.js?
O: No. Quasar is more like Ionic for Vue, since it is based on Cordova / WebView.

Q: What do you think about integration with Logux and distributed data types in general? Is the next revolution going to be here?
O: Sorry, I'm not familiar with Logux.

Q: Will there be support for the Kotlin programming language in Vue (SFC, plug-ins, etc.)?
O: I do not know about anything like that.

Documentation


Q: The examples in the official documentation of Vue.js are not always clear due to the fact that they cannot be launched directly on the page. If plans for integrating CodePen or JSFiddle into official Vue.js documentation?
O: Good suggestion. We may consider it when we have more time.

Q: How to divide the page layout into components before starting development? Is there something like a “Component Criteria List” by Evan Yu?
O: This is impossible, all applications are different.

Q: Is there a single official program style guide like Angular’s ​​John Papa guide?
O: ru.vuejs.org/v2/style-guide

Q: Are there any official instructions for migrating to Vue from other frameworks?
O: It is difficult to answer this question, not knowing with which technologies migration is coming.

Q: How to turn an application on Vue into a Web Component?
O: With the console utility vue-cli version 3

Q: In the official Vue.js documentation, the recommended TypeScript compiler option is “module”: “es2015”. How permissible is the use of “module”: “amd”, “module”: “system”.
A: This recommendation is based on the assumption that an ES module compatible packer is used, such as a webpack or rollup. Personally, I no longer use AMD or System, so I can not answer this question. My general suggestion - do not use them if you do not know what you are doing. Since you still ask this question - use the mainstream (ie, the default settings - approx. Lane. ).

Q: When will the specifications for AST builds for templates be released?
O: I don’t think we have such plans. We will need a very convincing use case to consider such a decision.

Feature requests


Q: Will it be possible to use the compiler for single-file components without modular bundler?
O: Yes, we have an SFC (Single File Component) compiler, we hope that it can be used to create external or internal browser compilers.

Q: Will the template for generating libraries be added to vue-cli?
O: vue-cli 3 can also be used to create libraries .

Q: Fragments from React version 16.2 have proven themselves well. Will there be something similar in Vue.js?
O: Yes, although not in the near future, because Many changes in the current diffing algorithm are required. React required for this to completely rewrite everything for almost 2 years.

Q: Will Vuex support middleware processing between actions and mutation?
O: Unlikely. Most likely, we will get rid of the differences between actions (actions) and mutations (mutations).

Q: When will run the `npm run lint` command support autofix?
O: vue-cli 3 already supports this. You can also change the command yourself by adding the `--fix` flag.

Q: React has recently released the aka Fiber asynchronous rendering. What will be the answer Vue? Is Vue still the fastest of all three frameworks?

O: Asynchrony does not make React faster. It is only used in certain scenarios to prioritize updates for better visible performance. The Vue update engine already has the ability to simulate some of these scenarios, but we need to open the corresponding API to make using them simple.

In short: we do not plan to create the full equivalent of Fiber, but we will provide an API for some of the new features introduced in it.

Q: Will the ability to render the same slot in a component twice in Vue.js be added twice as it allows React to do?

// [ Vue]: Duplicate presence of slot "default" found in the same render tree - this will likely cause render errors. <div> ...content <slot> ...content <slot> ...content </div> 

 //  React    <div> ...content {this.props.children} ...conent {this.props.children} ...content </div> 

O: Although React allows it, I do not think this is a good idea.

Q: Does Vue support a single repository for enterprise-scale applications like Nrwl Extention in Angular?
O: This is a problem of project organization, it is still outside our interests.

Please recommend


Q: Now Vue.js can validate forms in two different ways:
- declarative, when all rules are described as directives in markup;
- imperative, when all the rules are described in the code of the corresponding Vue-instance

Do you plan to make any of these methods a default implementation in Vue.js? Or both ways at once?

O: No, because it's better to have several competing solutions to an ambiguous problem.

Q: What is the best way to test Vue? Avoriaz recommends switching to vue-test-tools, but the latter is still beta.
O: @ vue / test-utils will replace Avoriaz. Use @ vue / test-utils.

Q: State (state) Vuex reactive / observable, like any given Vue component. If it were not for Flux's legacy, would it be possible to manipulate it directly (even if it is a bad idea)?
O: If you need a reactive state of the repository that can be manipulated directly, simply use the non-mounted instance of Vue.

Q: Are there plans or recommendations for components to return several root nodes? Is such a list-based approach possible, at least in theory?
O: Yes, we are planning this, but it will take some time.

Q: What are your ideas about reuse, inheritance, and tuning components at launch time? Are there any proven approaches and solutions?
O: Sorry, but this is too big a topic to answer here :)

Community


Q: Vue has absorbed many Angular and React chips. What is Vue’s relationship with the Angular and React communities?
O: In fact, I often communicate with the React community. I like all their good ideas. However, I am not familiar with so many people from the Angular community.

Q: I want to contribute to the development of Vue. What areas need my help?

O: Start answering the questions of others! These can be discussions on GitHub, chat in Discord or StackOverflow (or Toaster - approx. Lane ). We need to remember that you need to answer as clear as possible. Usually, in order to better understand the problem, you may need to re-read the documentation or even the source code. Being engaged in this for some time, you will begin to understand Vue much better and you will be able to solve more problems on Github, helping with code examples, searching for sources of bugs and even creating fixes and new features.

Q: What are the biggest conferences, meetings and events on Vue that are worth visiting?
O: We just had a Vue.js conference in Amsterdam in February of this year. And we plan to hold it there next year. Also in March this year, a conference of VueConf in the US will take place. There are quite a lot of conferences all over the world - you just have to look near the place where you live ( Vue in Moscow - approx. Lane ).

Future plans


Q: Is work on Vue 3.0 in progress? If so, what are the key changes?
O: We have plans for 3.0, but so far nothing is certain. The nearest big release is the 2.x-next branch, which is fully compatible with 2.x, but in it the internal reactivity system is rewritten to ES2015 Proxy . This will improve performance and allow you to get rid of some of the limitations of the existing implementation (for example, tracking changes in objects and arrays - note. Lane ). We will stop supporting IE11 and lower, but let us use the latest features of ES2015 for more efficient code.

Q: Access to parent components (through $ parent) allows inexperienced developers to make terrible mistakes. What do you think about this? Is it ever planned to remove such access (for example, in version 3.0)?
O: It is unlikely that we will remove it, since it can be useful in certain situations. You can always deny access to the parent using static analysis, for example using a custom rule for ESLint.

About myself


Q: Let's move away from IT-related topics. Summarizing your experience, what knowledge can you share? What are your interests and how are they combined with programming? What advice would you give to people in general and developers in particular?
O: I have an art education, I studied programming, for the most part, on my own. Probably because of this, I tend to appreciate practical and easily studied solutions. Over time, I also realized that most often programming is the choice of the right compromises. I think my advice should not be too categorical - be practical and be prepared for compromise.

Q: How many hours a day do you devote to working on Vue.js?
O: Since it became my main job, I spend the usual average working day from 9 to 5 (well, maybe a little longer)

Q: Tell me about your past experience with Google, Meteor, etc. How was the idea of ​​Vue born?
O: I just finished the podcast episode coming soon on devchat.tv. There I tell about it in detail.

Q: What, in your opinion, is the most important moment in the stack of web technologies for today? In which areas is there a need for change? What is in order and what is not?
O: I can only talk about the frontend. I think the main problem is that the standard APIs provided by the web platform are too low-level. As a result, many libraries solve almost every problem that the platform does not solve. This is both good and bad. The good news is that these innovations (caused by competition) generate great ideas. The negative side is that almost every stack that you see consists of a huge number of rapidly developing dependencies. This will probably continue for several more years.

Personally, I hope that one day the browsers will be quite effective, and we will be able to stop worrying about banding or micro-optimizing the delivery of assets. This will remove all the problems with a temporary (stop-gap) toolkit that usually exist in today's front-end architectures. However, I do not know when this will happen.

Q: What technical solution in View is you most proud of?
O: I made it easy to learn and at the same time quite powerful.

Q: Tony Hoare called null a billion-dollar error. What was the most unfortunate technical decision in your career?
O: It would be nice to use TypeScript initially, even when I started rewriting the code for Vue 2.x.

Q: What is the most complicated feature of Vue that you worked on?
O: Probably, optimization of server rendering in 2.4, which allowed the renderer to process a mixture of VDOM nodes and string nodes (string representation nodes) created during compilation.

PS


Thanks to everyone who helped with the organization and translation (Alex Sokolov, ai_boy , hiperteksto , irsick , z6Dabrata , gbezyuk ) and, of course, to Evan himself.

Pps


See the video of our previous Q & A session with Evan.

Source: https://habr.com/ru/post/350290/


All Articles