0.12 Plan - feedback welcome #158
Comments
👍 I'm not sure on the proposed |
Agree with everything minus removing the inherit option. |
Looks pretty good overall! |
👍 Among them, I agree especially with removing the |
👍 Vue's simple and flexible API is paramount. To be honest, I haven't personally found need for async but I can see it being useful. Looking forward to 0.12! |
Breaking v-with would certainly be a pain to refactor were we to upgrade, but I think it's the right way to go. 👍 |
Looks pretty good. Except maybe inheritance. But I think with proper As I thought one of the partials purposes was to decrease number of complete Vue instances and replace it with something lightweight. Am I wrong? To be honest, didn't use it overall, but it looks useful. Also Vue documentation is great, but sometimes I need it to be more reach. Any plans for it? Waiting for 0.12 too! |
👍 pretty good to see Vue move closer to "real" web components. |
👍 Removing |
👍 This all sounds great to me. |
This is great!!!! Especially async components (which enables lazy loading). I've been spending so many hours to get it work via webpack :D will refactor with pleasure to have lazy loading only from Vue, instead of webpack. Does "one-way props" have performance advantages? Or it's just for better isolation/protection of prop? |
@azamat-sharapov performance will be largely the same, it's for better isolation. In some cases you don't want the component to be able to mutate parent state. |
@yyx990803 thanks. Personally for my projects, if I decide to switch to 0.12, I will have to get rid of |
@yyx990803 I seem to be in the minority when it comes to Love the idea of async components! 👍 |
@young-steveo Agreed, but I think it's just us being stubborn. It's definitely going to be the norm in the future. |
Update:
|
👍 What about naming dynamic components |
Curious what these use-cases are that would require major refactoring? |
async components 这个真的很赞! |
If |
Why is it |
@sjoerdvisscher you can still do |
Agree that name "type" is not very intuitive. On Saturday, May 16, 2015, Evan You notifications@github.com wrote:
|
What would be better though? I don't think |
It tells you what |
I agree that type makes sense. However, might I suggest borrowing |
@RangerMauve Just to get a feeling of what it looks like: <component is="{{view}}"></component> Although personally I still prefer |
+1 for async components and lazy-loading mechanisms. However, I wonder how would that play with webpack? |
@kzima like this: components: {
'my-async-component': function (resolve) {
// require.ensure is webpack's code-splitting point
require.ensure(['./my-async-component.js'], function (require) {
resolve(require('./my-async-component.js'))
})
}
} It could be even simpler using webpack's AMD syntax: components: {
'my-async-component': function (resolve) {
require(['./my-async-component'], resolve)
}
} |
@yyx990803 no passing |
Oh and I use partials a lot. It's very useful sometimes. Definitely don't want to convert them all into components... |
@fullfs It seems you have built a pretty large body of work around a |
@young-steveo true. And I'm aware it. It was a risk to begin with. But I can give some useful feedback :D So I'd like partials to be kept :) |
@fullfs if you really want partials that bad, we can maybe ship it as a standalone directive separately. |
The word "is" is an indicative which is nothing like a noun or verb. An indicative indicates what something is. So its usage is perfect here. |
In async components feature, like this: var Vue = require('Vue')
var _ = Vue.util
new Vue({
...
components: {
// with object
component1: {
...
},
// with url path
component2: 'components/component2.js',
...
},
...
// lazy-loading hook function
loading: function (raw, resolve) {
if (_.isPlainObject(raw) { // component plain object
resolve(raw)
} else if (typeof raw === 'string') { // component url path
// lazy-loading with require.js
require([raw], resolve)
/* lazy-loading with webpack
require.ensure([raw], function (require) {
resolve(require(raw))
})
*/
}
},
...
}).$mount('#app')
... what do you think about it ? |
@kazupon one problem with this is that module bundler like Browserify and Webpack rely on seeing the literal string of module id (e.g. This should work with requirejs though. You can make a helper function: function async (path) {
return function (resolve) {
require([path], resolve)
}
}
Vue.component(async('my-component.js')) |
@yyx990803 by the way, please notice error handling while getting async components. There is a problem with the case while using webpack. |
@fullfs can you elaborate? |
@yyx990803
Then we try to pull the component:
The thing is there is no way we can catch an error if server didn't respond (server may go down or something). The callback just won't fire. I've tried a plugin for the case, but it didn't work properly too. Then my app just will be freezed. So there is a need for some way to catch the error (timeout?) and say something like "oops we couldn't get the component, so lets fall back". It could be a
|
@yyx990803 |
@fullfs it might be helpful to have some warning, but if you failed to resolve an async component, what would you expect as the fallback? There's no component to render, so the app can't really do anything. Calling the callback when the component resolution has failed will just result in an error. You can actually create a generic "oops" component and just |
@yyx990803 When async component's failed to resolve I want a way for my app to react, that's it. Resolving another component is a good thing. It's actually the fallback I'd like to have (for some reason didn't think I could do that :D). |
Some thoughts on improving DOM event and Vue event handling syntax: https://github.com/yyx990803/vue/issues/722#issuecomment-109849898 |
I don't like the proposal concerning As for |
@yyx990803 |
I don't see any benefits for the new event syntax :( |
Looks like most people want to stick with |
|
@nirazul I've decided to just remove it. You can now just pass down parent methods as props and let children call them. |
@yyx990803 All new features inside 0.12.0 are amazing but most of them are breaking changes and for those who are using Vue in production will be painful to update it. |
@fullfs @federicodionisi You guys should collaborate and make one. I don't think it's necessary for a library author of pre-release software to also have to contend with writing migration scripts. |
@yyx990803 Can I ask you for solution about partials? Now it's gone and they need to be replaced by something. |
@fullfs does making |
@yyx990803 I'm afraid it's not. I won't be able to use |
I have the same feeling about |
Yeah, ever since 0.12 I've seen people run into cases where partial just makes more sense. I'll consider adding it back in 0.12.2. |
@yyx990803 That would be absolutely great! Thanks! |
Hi Vue.js users, here is a list of changes I'm planning for the 0.12 release. The goal is to remove some cruft in the API and make things more consistent across the board. The two new features have already been implemented in the
dev
branch, and I will soon start doing 0.12 beta releases so people can try it out. The breaking changes are pretty much just ideas that I'd like to gather feedback for - in particular, let me know how hard do you think it would be for you to migrate your existing app if these changes went live.New Features
prop="{{*onetime}}"
)Breaking Changes
paramAttributes
renamed toprops
.v-partial
and{{>partial}}
syntax. The partial concept is a legacy from string-based templates, and isn't particularly useful when everything should just be components.v-with
syntax.props
(previouslyparamAttributes
).v-with
isn't super precise for what it does now: passing data down to a child. It is also a legacy from string templates that uses {{#with}} blocks to shift the data context.v-component
syntax.v-with
, it doesn't make much sense to have two ways of doing the same thing. Every component should just be a custom tag.<component is="{{view}}"></component>
syntax."component"
is a reserved component name.Intent to remove:replace
option. A component always replaces its placeholder node.Intent to remove:inherit
option. Prefer explicitly passing down props.The text was updated successfully, but these errors were encountered: