vuejs / vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
http://v2.vuejs.org
MIT License
207.12k stars 33.64k forks source link

2.0 Changes #2873

Closed yyx990803 closed 7 years ago

yyx990803 commented 8 years ago

This is a live document. Last update: 08/17/2016 as of 2.0.0-rc.2

General Notes

  • A checked item means it has been implemented in the 2.0 development branch.
  • Features subject to change during development.
  • The breaking change list is not guaranteed to be complete during development.
  • There are some upgrade tips at the end.

    High Level Changes

  • The template parser no longer relies on the DOM (unless you are using the real DOM as your template), so as long as you are using string templates (<script type="text/x-template">, inline JavaScript strings, or compiled via single-file components), you are no longer subject to any of the template parsing limitations in 1.x. However, if you are relying on mounting to an element with existing content as template (using the el option), you will still be subject to those limitations.
  • The compiler (the part which converts a template string to a render function) and the runtime can now be separated. There will be two different builds:
  • Standalone build: includes both the compiler and the runtime. This functions basically exactly the same Vue 1.x does.
  • Runtime only build: since it doesn't include the compiler, you need to either pre-compiled templates in a compile step, or manually written render functions. The npm package will export this build by default, since when consuming Vue from npm, you will likely be using a compilation step (with Browserify or Webpack), during which vueify or vue-loader will perform the template pre-compilation.

    Global config

  • [x] Vue.config.silent
  • [x] Vue.config.optionMergeStrategies
  • [x] Vue.config.devtools
  • [x] Vue.config.errorHandler new - global hook for handling uncaught errors during component render and watchers (default behavior is logging the error stack throwing in place)
  • [x] Vue.config.keyCodes new - configure custom key aliases for v-on.
  • Vue.config.debug deprecated, no longer useful since warnings come with stack traces by default now
  • Vue.config.async deprecated, async is required for rendering performance
  • Vue.config.delimiters reworked as a component-level option
  • Vue.config.unsafeDelimiters deprecated, use v-html

    Global API

  • [x] Vue.extend
  • [x] Vue.nextTick
  • [x] Vue.set
  • [x] Vue.delete
  • [x] Vue.directive
  • [x] Vue.component
  • [x] Vue.use
  • [x] Vue.mixin
  • [x] Vue.compile new (only in standalone build)
  • [x] Vue.transition
  • stagger deprecated, set and access data-index on el instead
  • [x] Vue.filter
  • Vue.elementDirective deprecated, just use components
  • Vue.partial deprecated, use functional components

    Options

    data
  • [x] data
  • [x] props
  • [x] prop validation
  • [x] default value
  • coerce deprecated. If you want to convert a prop, setup a local computed value based on it.
  • prop binding modes deprecated (v-model can work on components)
  • [x] propsData new, instantiation only
  • [x] computed
  • [x] methods
  • [x] watch
    DOM
  • [x] el
  • [x] template
  • [x] render new
  • replace deprecated, components now must have exactly one root element.
    Lifecycle Hooks
  • [x] init beforeCreate
  • [x] created
  • [x] beforeDestroy
  • [x] destroyed
  • [x] beforeMount new
  • [x] mounted new
  • [x] beforeUpdate new
  • [x] updated new
  • [x] activated new (for keep-alive)
  • [x] deactivated new (for keep-alive)
  • [x] ready deprecated, use mounted (there's no longer the guarantee to be in-document)
  • activate deprecated, moved into vue-router
  • beforeCompile deprecated, use created
  • compiled deprecated, use mounted
  • attached deprecated, use custom in-dom check in other hooks
  • detached deprecated, same as above
    Assets
  • [x] directives
  • [x] components
  • [x] transitions
  • [x] filters
  • partials deprecated
  • elementDirectives deprecated
    Misc
  • [x] parent
  • [x] mixins
  • [x] name
  • [x] extends
  • [x] delimiters new, replacing the original global config option. Only available in standalone build.
  • [x] functional new, makes the component stateless and instance-less (just a render function that returns virtual nodes)
  • events deprecated, since no more event propagation

    Instance Properties

  • [x] vm.$data
  • [x] vm.$el
  • [x] vm.$options
  • [x] vm.$parent
  • [x] vm.$root
  • [x] vm.$children
  • [x] vm.$refs
  • vm.$els deprecated, merged with $refs

    Instance Methods

    data
  • [x] vm.$watch
  • vm.$get deprecated, just retrieve values directly
  • vm.$set deprecated, use Vue.set
  • vm.$delete deprecated, use Vue.delete
  • vm.$eval deprecated, no real use
  • vm.$interpolate deprecated, no real use
  • vm.$log deprecated, use devtools
    events
  • [x] vm.$on
  • [x] vm.$once
  • [x] vm.$off
  • [x] vm.$emit
  • vm.$dispatch deprecated, use global event bus or Vuex. (see below)
  • vm.$broadcast deprecated, same as above
    DOM
  • [x] vm.$nextTick
  • vm.$appendTo deprecated, just use native DOM API on vm.$el.
  • vm.$before deprecated
  • vm.$after deprecated
  • vm.$remove deprecated
    Lifecycle
  • [x] vm.$mount
  • [x] vm.$destroy

    Directives

  • [x] v-text
  • [x] v-html but {{{ }}} shorthand has been deprecated
  • [x] v-if
  • [x] v-show
  • [x] v-else
  • [x] v-for
  • [x] key (replacing track-by)
  • [x] Object v-for
  • [x] range v-for
  • [x] argument order updates: (value, index) in arr, (value, key, index) in obj
  • $index and $key deprecated
  • [x] v-on
  • [x] modifiers
  • [x] on child component
  • [x] custom keyCodes (now avaiable via Vue.config.keyCodes instead of Vue.directive('on').keyCodes)
  • [x] v-bind
  • [x] as prop
  • [x] xlink
  • [x] bind object
  • [x] v-bind:style
  • [x] prefix sniffing
  • [x] v-bind:class
  • [x] v-model
  • [x] lazy (as modifier)
  • [x] number (as modifier)
  • [x] ignoring composition events
  • debounce deprecated, use v-on:input + 3rd party debounce function
  • [x] v-cloak
  • [x] v-pre
  • [x] v-once new
  • v-ref now just a special attribute as ref
  • v-el deprecated (merged with ref)

    Special Components

  • [x] <component>
  • [x] :is
  • [x] async components
  • [x] inline-template
  • [x] <transition>
  • [x] <transition-group>
  • [x] <keep-alive>
  • [x] <slot>
  • partial deprecated

    Special Attributes

  • [x] key
  • [x] ref
  • [x] slot

    Server-side Rendering

  • [x] renderToString
  • [x] renderToStream
  • [x] client-side hydration

    Other Breaking Changes

    v-for iteration syntax change

  • Deprecating $index and $key

Both of these are being deprecated in favor of more explicit named indices and keys. This syntax is a bit magical and has limitations in nested loops. As a bonus, there will be two fewer points of syntax for newcomers to learn.

In general, in 2.0 directives have a greatly reduced scope of responsibility: they are now only used for applying low-level direct DOM manipulations. In most cases, you should prefer using Components as the main code-reuse abstraction.

Directives no longer have instances - this means there's no more this inside directive hooks and bind, update and unbind now receives everything as arguments.

Note the binding object is immutable, setting binding.value will have no effect, and properties added to it will not be persisted. You can persist directive state on el if you absolutely need to:

<div v-example:arg.modifier="a.b"></div>
// example directive
export default {
  bind (el, binding, vnode) {
    // the binding object exposes value, oldValue, expression, arg and modifiers.
    binding.expression // "a.b"
    binding.arg // "arg"
    binding.modifiers // { modifier: true }
    // the context Vue instance can be accessed as vnode.context.
  },

  // update has a few changes, see below
  update (el, binding, vnode, oldVnode) { ... },

  // componentUpdated is a new hook that is called AFTER the entire component
  // has completed the current update cycle. This means all the DOM would
  // be in updated state when this hook is called. Also, this hook is always
  // called regardless of whether this directive's value has changed or not.
  componentUpdated (el, binding, vnode, oldVNode) { ... },

  unbind (el, binding, vnode) { ... }
}

You can use destructuring if you only care about the value:

export default {
  bind (el, { value }) {
    // ...
  }
}

In addition, the update hook has a few changes:

  1. It no longer gets called automatically after bind.
  2. It now always gets calls when the component is re-rendered, regardless of whether the value it's bound to has changed or not. You can compare binding.value === binding.oldValue to skip unnecessary updates, but there are also cases where you'd want to always apply updates, e.g. when the directive is bound to an Object that might have been mutated instead of replaced.

elementDirective, directive params and directive options such as acceptStatement, deep etc. are all deprecated.

Filter Usage and Syntax Change

In Vue 2.0, there are several changes to the filter system:

  1. Filters can now only be used inside text interpolations ({{}} tags). In the past we've found using filters with directives such as v-model, v-on etc. led to more complexity than convenience, and for list filtering on v-for it is more appropriate to move that logic into JavaScript as computed properties.
  2. Vue 2.0 will not ship with any built-in filters. It is recommended to use standalone libraries dedicated for solving problems in a specific domain, e.g. moment.js for formatting dates and accounting.js for formatting financial currencies. You are also welcome to create your own filter pack and share it with the community!
  3. The filter syntax has changed to be more inline with JavaScript function invocation, instead of taking space-delimited arguments:

    {{ date | formatDate('YY-MM-DD') }}

    Transition System

Transition CSS class changes:

The always-on v-transition class is no longer added and Vue now uses the same classes Angular and React CSSTransitionGroup does:

keep-alive is no longer a special attribute: it is now a wrapper component, similar to <transition>:

  <keep-alive>
    <component :is="view"></component>
  </keep-alive>

This makes it possible to use keep-alive on multiple conditional children (note the children should eventually evaluate to a single child - any child other than the first one will be ignored):

  <keep-alive>
    <comp-a v-if="a > 1"></comp-a>
    <comp-b v-else></comp-b>
  </keep-alive>

When used together with <transition>, make sure to nest it inside:

  <transition>
    <keep-alive>
      <component :is="view"></component>
    </keep-alive>
  </transition>

Slots

The reason that we are deprecating $dispatch and $broadcast is that event flows that depend on the components tree structure can be hard to reason about when the components tree becomes large (simply put: it doesn't scale well in large apps and we don't want to set you up for pain later). $dispatch and $broadcast also do not solve the communication between sibling components. Instead, you can use a pattern similar to the EventEmitter in Node.js: a centralized event hub that allows components to communicate, no matter where they are in the components tree. Because Vue instances implement the event emitter interface, you can actually use an empty Vue instance for that purpose:

var bus = new Vue()
// in component A's method
bus.$emit('id-selected', 1)
// in component B's created hook
bus.$on('id-selected', this.someMethod)

And don't forget to use $off to unbind the event.

// in component B's destroyed hook
bus.$off('id-selected', this.someMethod)

This pattern can serve as a replacement for $dispatch and $broadcast in simple scenarios. But for more complex cases, it is recommended to introduce a dedicated state management layer using Vuex.

How to Deal with the Deprecation of Array Filters?

For list filtering with v-for - one of the more common usage of filters - it is now recommended to use computed properties that return a processed copy of the original Array (see updated data grid example). The benefits is that you are no longer limited by the arbitrary filter syntax/API - it's just plain JavaScript now, and you naturally have access to the filtered result because it is a computed property.

Also see this discussion thread.

How to Deal with the Deprecation of debounce for v-model?

Debouncing is used to limit how often we execute Ajax requests and other expensive operations. Vue's debounce attribute parameter for v-model makes this easy, but it also debounces state updates rather than the expensive operations themselves, which comes with limitations.

These limitations become apparent when designing a search indicator. Take a look at that example. Using the debounce attribute, there'd be no way to detect a dirty input before the search begins, because we'd lose access to the input's real-time state. By decoupling the debounce function from Vue, we're able to debounce only the operation we want to limit.

There will be other times when debouncing isn't quite the right wrapper function. In the very common example of hitting an API for search suggestions, waiting to offer suggestions until after the user has stopped typing isn't an ideal experience. What you probably want instead is a throttling function. Now since you're already using a utility library like lodash for debounce, refactoring to use throttle instead takes only a few seconds!

rekateka commented 8 years ago

I just saw that certain features will only be available in the standalone build. Does that mean that this and the NPM version are significantly different?

yyx990803 commented 8 years ago

@rekateka 2.0 standalone build means (compiler + runtime). The default export of the NPM package will be runtime only, because if installing from NPM, you will likely pre-compile the templates with a build tool.

rekateka commented 8 years ago

Thanks, @yyx990803. I still have a couple more questions regarding the compiler and other features, but I've used the forum for that.

roblav96 commented 8 years ago

Are there any worrisome changes made to docs I should review by any chance? Great work! Keep it up man. You're redefining web development. Thank you!

banrikun commented 7 years ago

Can I get this.arg of my directive?

I see vnode.data.directives has arg, but when I have two or more directives, I can not know the index.

<!-- show @ 0, img @ 1-->
<img v-show="true" v-img:200*200="imgSrc">
<!-- img @ 0, show @ 1-->
<img v-img:200*200="imgSrc" v-show="true">

Should I use forEach? Thank you!

yyx990803 commented 7 years ago

@banricho good point, that's been overlooked! See updated directive function signature.

andyyou commented 7 years ago

First of all, sorry for I am not quite sure that could I ask this problem here, and I have a little bit requirements want to say. The requirement is I hope I can design my component's usage like this

<carousel>
  <img src="..." alt="..." desc="..." is="argument">
  <img src="..." alt="..." desc="..." is="argument">
</carousel>

I hope the children can be as some kind of arguments, not only limit in attributes For now I can make a component, the usage like

<carousel items="[{}, {}, {}]"></carousel>

But I think it's not quite good, I hope it can like this one I made before in React coverflow

smolinari commented 7 years ago

@andyyou - that question is probably best posted on the forum, since it isn't an issue, nor a clear suggestion, nor any real help to this issue.

http://forum.vuejs.org/

If you find out that your requirements can't be met with Vue in your forum thread, then you can open a new issue here.

Scott

andyyou commented 7 years ago

@smolinari Thanks

judocode commented 7 years ago

"But for more complex cases, it is recommended to introduce a dedicated state management layer using Vuex." This seems to imply that state should be used over events. I see them as completely separate - an event is a moment in time, whereas state does not change. You could say that you could watch the state, but that also does not convey a specific moment, but instead anytime something changes. I'm interested in the meaning behind this recommendation.

fnlctrl commented 7 years ago

@jrenton Generally, we can consider the event system simply as component A telling component B to change it's state, or A telling B to do something else. So for the first case, we can use state management (managing a shared state for A and B) instead of using event system to let A tell B to change state. For the second case, I think it can be handled with the 'event bus' approach pretty well.

simplesmiler commented 7 years ago

@jrenton instead of a soup of components talking to each other Vuex suggest a single channel for components to express "intentions" with actions, and record "facts" with mutations.

gholol commented 7 years ago

I'm using Twig along with Vue.

Until now (vue 1.0) I've been passing data into my components like this:

<my-component data="{{ DATA }}"><my-component>

(Note that {{ and }} are twig tags - for vue I've been using custom delimiters ${ and })

If I'm understanding things correctly, in Vue 2.0 I should do it like this:

<my-component :data=" '{{ DATA }}' "></my-component> right?

yyx990803 commented 7 years ago

@gholol no it's just

<my-component :data="{{ DATA }}"></my-component>

Actually it seems your old usage shouldn't work in the first place.

gholol commented 7 years ago

Well it worked fine...

Like I said, the data are coming from twig templating engine. Now in Vue 2.0 it doesn't work. I've been trying to pass it like you said (without single apostrophes) but data property gets undefined.

Error: SyntaxError: missing } after property list

EDIT: It works, I forgot to mention that the DATA variable is a string

andyyou commented 7 years ago

@jrenton My idea and motivation is quite simple seems Vue doesn't like React that compel us to use JSX. We can choose a lot of template.

I hope I can use children element syntax as a parameter(arguments) pass args to parent because in some template language like slim if you have a bit many attributes or say the attr's name is quite long then we have to put all the things in one line. it's easier make code of one line over 80 characters.

oskarkrawczyk commented 7 years ago

@yyx990803 Feeling adventurous today wanted to see how much effort would it take to migrate some 1.0 to 2.0a, unfortunately since it's not possible to use simple interpolation anymore, how would I go about and do something simple as <input type="text" name="account[categories][{{ category.id }}]"> in 2.0?

LinusBorg commented 7 years ago

ES6 inline templates work in binding expressions:

<input type="text" :name="`account[categories][${ category.id }]`">

https://jsfiddle.net/Linusborg/cm4v75xh/

oskarkrawczyk commented 7 years ago

If that's the only way to get this working on 2.0, then don't mind me saying that that's a regression in the lovely syntax 1.0 got us used to – yes I know that's just ES2015.

I assume interpolation was removed for performance reasons? I just hope it's worth the uglier syntax.

simplesmiler commented 7 years ago

@oskarkrawczyk I assume you want to end up with something like name="account[categories][fruits]" in your DOM, because this is what your expression would render.

The 2.0 version (and proper 1.0, in fact) will be :name=" 'account[categories][' + category.id + ']' ".

oskarkrawczyk commented 7 years ago

@simplesmiler Understood. I think {{ }} just spoiled me a bit.

hilongjw commented 7 years ago

@yyx990803 can I dynamically insert component, like this?

    render () {
        return this.$createElement('div', { staticClass: 'list-container' }, this.list)
    },
    data () {
         return {
               list: []
         }
    },
    method: {
         a () {
               this.list.push(this.$createElement('myComponent', {}))    
         }
    }
nervgh commented 7 years ago

How I can bind few values for an attribute which depend on expression? For example:

new Vue({
  el:'body',
  data:{
    flag: true
  }
})
<input type="text" v-bind:placeholder="{test: flag, test2: !flag}" />

I expect next result:

<input type="text" placeholder="test" />
<!-- or -->
<input type="text" placeholder="test2" />
simplesmiler commented 7 years ago

@nervgh this is not the right place to ask this question. Use ternary expression, v-bind:placeholder="flag ? 'test' : 'test2'".

nervgh commented 7 years ago

@simplesmiler , thanks for your answer. I try to say that Object-Syntax will be useful in these cases, but is does not work as I expect.

simplesmiler commented 7 years ago

@nervgh object syntax is only applicable to attributes that take a list of strings. Of native attributes the only such attribute is class, and for the components there would be no way to detect from the child side whether you meant to send a list of strings or a proper object.

JasonWoof commented 7 years ago

Re: .once and .sync are deprecated.

Doesn't this break really common design patterns?

I can't think how you'd be able to have simple components for handling form fields without these.

I have simple components for different form field types, eg here's my "textbox" component template::

<label>{{type.caption}}:<input type="text" v-model="data"></label>

...and also a more complex component for lists which provides a ui to add and remove elements from arrays in the data structure

Then I use these components eg like so:

<div v-for="field in type.fields">
    <component :data.sync="data[field.name]" :is="field.ctype" :type="field">

Note: All of these components have two props: data and type. data is the node in the data structure being edited that the component is responsible for providend a UI for editing, and type is the node in the (massive, static) data structure which contains the types/fields hierarchy.

How can stuff like that work without .sync?

It seems to me that it would severely complicate things to create some sort of messaging system between these components where the sub-components can somehow communicate to the parent which sub-component they are, and the parent can then figure out what part of its data structure to modify.

I really hope I'm missing something.... because it looks like you're saying that using components to create editors for parts of your data structure is an anti-pattern. Whaat? So far that's the only thing I've used Vue for. I'm guessing you think that removing this feature will encourage people to write cleaner code. Maybe it will have that effect on some people, but many people will write much nastier code to work around this limitation. Modifying state is the only useful thing that computers do. Please continue to make this easier.

yyx990803 commented 7 years ago

@JasonWoof v-model in 2.0 can work on custom components. The component simply needs to:

  1. expose a prop named value
  2. emit an input event when the value needs to be synced to parent, e.g. this.$emit('input', value)

See example.

JasonWoof commented 7 years ago

@yyx990803 Thanks for the explanation and link. Now I'm just stuck on:

Why remove .sync?

I don't see the advantage, only disadvantages. The example you linked shows that you can achieve the same thing with either :selected.sync or v-model. I only see disadvantages for the v-model method:

  1. It requires significant boiler-plate on the sub-component side, is more complicated, more to learn, etc.
  2. You can only pass one value with v-model, but you can have multiple .sync props

I don't see how switching to v-model makes anything clearer/cleaner. In both cases, the only indication in the parent that the child component can easily modify parent state is the syntax of the prop in the template. I would even argue that .sync is more clear.

The other thing is that when you pass objects/arrays/etc as props, then they are mutable from the child component. So you can't shield programmers from being able to change the state from the child components in this case (which I assume is very common.) So it seems to me like you are introducing a stumbling block by removing the thing that makes it so passing string values works the same as passing object values. .sync makes my code simpler and more consistent by always having my "data" props writable from the child side, no matter the data type.

I'm new to Vue.js (3 days ago) but from what I can see so far, Vue.js is valuable mainly because of two things:

  1. easy dom manipulation with templates
  2. automatic value/data change propagation, including triggering template changes

At least that's what I've discovered so far.

It seems to me that removing .sync makes it difficult to get Vue.js to consistently do the second.

yyx990803 commented 7 years ago

@JasonWoof because explicit vs. implicit side effects outside of the components own scope makes all the difference in long term maintainability.

LinusBorg commented 7 years ago

... and while one could argue that people simply should learn when to not use .sync, our experience so far is different. people tend to rely too much on this and create code they later can hardly debug.

so this is a design decision to force people to do it right from the beginning.

an example:

...and this becomes even more crazy when you sync more than one level deep.

This is an (anti-)pattern we have seen over and over on the forums and in the gitter chat.

Removing .sync forces people to write clear, explizit, maintainable code from the start, because their code won't stay simple enough for .sync for very long, most of the time.

JasonWoof commented 7 years ago

OK. Thank you for explaining.

It's good to hear what problem you are trying to solve.

I seriously doubt this will help though... Make it so people can't easily break the patters you like and people will do far worse things to work around the limitations.

This reminds me a lot of abstraction. Abstractions get us into so much trouble. They make code hard to read, hard to debug, etc.... But you can't fix this by taking away the ability to make abstractions... that's pretty much the thing that makes programming possible/useful. The solution to this is not at the language or framework level, but in teaching, advice, learning. We encourage people not to make things overly abstract.

It sounds to me like you are talking about such a design philosophy. In many cases, it's a great philosophy to keep in mind while coding. But when it is imposed as a limitation, and the programmer thinks that this limitation stops her from doing what she needs to do, then she's going to work around it, which will result in all the problems you were trying to avoid and worse.

People are not going to stop trying to mutate parent state from the children. You can't force people not to do that.

Your v-model thing is complicated enough that I would work around this problem by passing the parent object/array and a key so that the child can modify it.

I guess this last bit hit's at the heart of what I'm trying to get across: I (personally) see the lack of .sync as a problem, and will work around it or not use your framework. I bet a lot of people will have the same approach.

Perhaps this goes without saying, but it makes me a little angry when people try to impose design philosophies on me. I would much rather build things that go terribly wrong and learn not to do that again than to use systems that purposely withhold power for fear that I might use it badly.

JasonWoof commented 7 years ago

P.S. Sorry, I can't help myself, one more comment, then I'll leave you guys alone. Most programmers write code that they cannot debug. This happens to every programmer in every language with every framework. This is how programmers become better programmers: they make mistakes, they make code they cannot fix, they learn how to write things differently in the future. Please don't dumb down your framework for everybody in an attempt to make it so programmers who abstract themselves into the corner can make their stuff a little bit more confusing/complex before it becomes such a mess that they can't debug it.

yyx990803 commented 7 years ago

@JasonWoof it has nothing to do with "dumbing down", and preventing users from common pitfalls / ensuring better maintainability is by definition part of the job of a framework. We made the decision based on first hand experience designing, using the framwork itself, and observing user behavior in various use cases. If it's an anti-pattern, we will discorage users from using it, and provide guidence on the idiomatic solution. You are free to disagree with that based on your personal opninion, but I find your arguments hardly convincing.

LinusBorg commented 7 years ago

People are not going to stop trying to mutate parent state from the children. You can't force people not to do that.

Sure. And we won't 'force' them, because there may be some edge cases where this might still be nessessary. So you can still access this.$parent, you can pass $data through a prop etc, but quite frankly doing so will be not much more convient that $emiting an event most of the time, so they won't be as attractive as .sync sugar.

Also, $parent et.al. are not part of the official guide, so users who use them are actively working around suggested best practices - which they are free to do, but we don't encourage that behaviour.

Consequently, the framework should not encourage similar behaviour by providing 'magical' syntactic sugar like .sync if we feel that such a feature is misused in most scenarios and opposed to the best practices the framework seeks to establish.

RenShine commented 7 years ago

尤大 有没有中文版的。。

roblav96 commented 7 years ago

What does the compatibility look like for vue-router?

blake-newman commented 7 years ago

@roblav96

There are some changes needed to be compatible, we are hoping to better incorporate the Router into Vue.

roblav96 commented 7 years ago

@blake-newman

Can we get a boilerplate template together on vue-cli? I can't seem to get any of this working 😢

blake-newman commented 7 years ago

@roblav96

There are some currently, there are some change changes needed with vue-loader to make it compatible. Currently 2.0 should be used for experimentation only until all further dependencies for large scale applications are updated.

Evertt commented 7 years ago

Is there an ETA for the beta / release candidates?

blake-newman commented 7 years ago

@Evertt Alpha is due this week. Beta will follow with documentation completed, and maybe more support from core extending libraries (Vue-router ect). Release Candidate when Beta is proven successful.

Evertt commented 7 years ago

@blake-newman thank you for that quick, concise and complete response. Those are the best. :-D

jaouadk commented 7 years ago

Any workaround for replace: false in vue 2.0 ?

reohjs commented 7 years ago

Hi, is JSX already usable?

smolinari commented 7 years ago

@reohjs - No and I would personally see that as a real step backwards for Vue, if it did support JSX.

Scott

dan-gamble commented 7 years ago

@reohjs In Evan's stream last night he mentioned it could be made with a plugin so i imagine once this goes into beta it wouldn't take long for someone to create it. I'm happy that it's not in the core but a JSX plugin sounds like a great idea.

ruiposse commented 7 years ago

I'm happy that it's not in the core

👍 👍 👍 👍

blake-newman commented 7 years ago

Yeah should be a plugin. However, as seen templates have a lot of benefits for standard components.

posva commented 7 years ago

JSX compilation should be easy to achieve with this plugin: https://babeljs.io/docs/plugins/transform-react-jsx/

I think the _h function would be the replacement for React.createElement