vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

0.11 Upcoming changes - Reactions #65

Open ayamflow opened 10 years ago

ayamflow commented 10 years ago

Hi Evan, Very motivating (and exciting) to see the list of upcoming changes - it's good to see that Vue is growing !

Here are some comments (most of them are simple questions/feedback though). Most of the breaking changes really make sense, which will make the transition rather easy !

hook changes

No more attached/detached hooks, but it's cleaner/handier with the new ready hook. Perfect !

Instance methods changes

I'm sad to see $unwatch go: for me it was a pain in the ass with Angular because of the need to keep a reference. With Vue, it means you have to put it into this to unbind it later, which seems like overkill to me (I avoid anonymous functions, and usually call $watch in ready and $unwatch in the $watch listener, so my use-case is kind of a $once + $watch).

Interpolation change

The one time interpolation is brilliant, I think most of the websites (not really web apps) built with Vue rarely need the 2-way binding. Good performance upgrade :)

Transition API

Super happy yo see the done callback in the enter method ! It will make it easier to build plugins using the transition mechanisms (like I mentioned in #61). But sad to see the insert go, I used it a lot to set an initial state on the element (opacity, x/y...) to avoid any FOC.

yyx990803 commented 10 years ago
yyx990803 commented 10 years ago

Update: I've added a beforeEnter hook to the js transition API.

rdsubhas commented 10 years ago

+1 to the separate beforeEnter hook for transitions! Great work and looking forward to the release.

ayamflow commented 10 years ago

$unwatch(keypath, callback) then you need to save a reference anyway.

I've always been doing $unwatch('prop', this.method); - was I improperly unwatching ?

it's trivial to bring it back, or provide it as the beforeEnter hook

Cool! Just one remark: hooks are usually used for vm-related stuff whereas transitions/effects are separated/abstracted from the vm (no this, no access to $emit...). I feel the beforeEnter hook is kind of coupling the transition API - thoughts ?

yyx990803 commented 10 years ago

Oh by beforeEnter hook I mean a js transition hook, just like enter and leave

On Sun, Aug 31, 2014, 4:07 PM ayamflow notifications@github.com wrote:

$unwatch(keypath, callback) then you need to save a reference anyway.

I've always been doing $unwatch('prop', this.method); - was I improperly unwatching ?

it's trivial to bring it back, or provide it as the beforeEnter hook

Cool! Just one remark: hooks are usually used for vm-related stuff whereas transitions/effects are separated/abstracted from the vm (no this, no access to $emit...). I feel the beforeEnter hook is kind of coupling the transition API - thoughts ?

— Reply to this email directly or view it on GitHub https://github.com/vuejs/Discussion/issues/65#issuecomment-53999699.

ayamflow commented 10 years ago

Perfect!