owner
stringclasses
14 values
repo
stringclasses
14 values
id
int64
116k
4.61B
issue_number
int32
1
181k
author
stringlengths
1
39
body
stringlengths
1
262k
created_at
timestamp[us]date
2000-06-06 02:40:44
2026-06-02 20:16:18
updated_at
timestamp[us]date
2000-06-06 02:40:44
2026-06-02 20:22:56
reactions
unknown
author_association
stringclasses
5 values
vuejs
core
645,238,217
1,380
haishengXie0712
@huangfengya ``` watch( () => msg1.val, (val, oldVal) => { msg1.isOldEqualNew = val.val === oldVal.val console.log(val === oldVal) // true? console.log(`new val: ${val}, old val: ${oldVal}`) } ) ```
2020-06-17T08:38:35
2020-06-17T08:38:35
{}
NONE
vuejs
core
642,534,848
1,344
rigor789
Here's a list of the different builds you can use, and when to use which: https://github.com/vuejs/vue-next/tree/master/packages/vue#from-cdn-or-without-a-bundler
2020-06-11T09:38:56
2020-06-11T09:38:56
{}
CONTRIBUTOR
vuejs
core
642,543,090
1,342
underfin
@lawvs .That scene is under`v-if` create comment.This issues really is inconsistent with 2.x.
2020-06-11T09:56:20
2020-06-11T09:56:45
{}
MEMBER
vuejs
core
642,758,618
1,262
yyx990803
I did a similar fix in https://github.com/vuejs/vue-next/commit/f3623e4d1ea83d552b5ab29955dead6c36a87723 but should be more efficient to avoid double filtering calls.
2020-06-11T15:48:22
2020-06-11T15:48:22
{}
MEMBER
vuejs
core
642,879,584
1,340
yyx990803
This is expected. `vnodeXXX` hooks is not equivalent to directives. In this case `vnodeXXX` hooks are **invoked on whatever vnode they are used on** - i.e. if it's used on a component, it will be invoked with the **component vnode**. Directives, on the other hand, are always invoked on the final rendered DOM vnode.
2020-06-11T19:17:59
2020-06-11T19:17:59
{}
MEMBER
vuejs
core
643,849,613
1,367
buns-li
hello, in you test case and the result I get .... : ![image](https://user-images.githubusercontent.com/13376387/84608518-744a6d80-aee5-11ea-876a-f25c371cb317.png)
2020-06-15T00:52:13
2020-06-15T00:52:13
{}
NONE
vuejs
core
643,895,475
1,363
cuixiaorui
> I think this change would affect the readability. It's not as clear as the original. why? This refactoring step comes from the book 《Refactoring》 There are clear reasons for this in Chapter 9.5 of The second edition of Refactoring
2020-06-15T04:28:51
2020-06-15T04:28:51
{}
CONTRIBUTOR
vuejs
core
642,429,226
1,339
haoqunjiang
It's a legit question. Some of the compatibility layers are not yet implemented in the current beta.
2020-06-11T06:06:26
2020-06-11T06:06:26
{}
MEMBER
vuejs
core
642,543,602
1,344
macdevign
Hi rigor789, thank for the link. Just to clarify:: "From CDN or without a Bundler vue(.runtime).global(.prod).js: For direct use via <script src="..."> in the browser. Exposes the Vue global. Note that global builds are not UMD builds. They are built as IIFEs and is only meant for direct u...
2020-06-11T09:57:32
2020-06-11T09:57:32
{}
NONE
vuejs
core
642,921,188
1,195
yyx990803
Should be fixed after #1106. Thanks for the PR though!
2020-06-11T20:49:43
2020-06-11T20:49:43
{}
MEMBER
vuejs
core
643,467,908
1,197
CyberAP
@yyx990803 there are two kinds of buffer right now: one for `renderToString` and another for `renderToStream`. The methods that renderers expose (`renderComponentSubtree` for example) are bound to buffer constructor and only `renderToString` methods are exposed. That means when runtime helpers are executed they will us...
2020-06-12T20:23:02
2020-06-12T20:24:38
{}
CONTRIBUTOR
vuejs
core
643,601,550
1,168
5onderling
Got fixed in beta 15.
2020-06-13T10:07:17
2020-06-13T10:08:00
{}
NONE
vuejs
core
644,133,598
1,370
yyx990803
I think Vue 3 exports the types you need, but note the types are not backwards compatible and may have different names. Please do read the `.d.ts` to make sure.
2020-06-15T13:25:36
2020-06-15T13:25:36
{}
MEMBER
vuejs
core
644,865,572
1,379
yyx990803
I happened to remove this in e68209bf - actually, based on the test it *should* be removed so that the update is indeed a self update in the child instead of a parent -> child update.
2020-06-16T16:17:04
2020-06-16T16:17:04
{}
MEMBER
vuejs
core
645,193,163
1,386
posva
FYI the same happens with arrays that get pushed/pop/spliced and this is consistent with Vue 2
2020-06-17T07:05:31
2020-06-17T07:05:31
{}
MEMBER
vuejs
core
645,363,518
1,240
reaink
@yyx990803 @underfin @haishengXie0712 I want to use v-model on [web-components](https://developer.mozilla.org/en-US/docs/Web/Web_Components) Instead of vue-components E.g [here](https://blog.bitsrc.io/9-web-component-ui-libraries-you-should-know-in-2019-9d4476c3f103) Framework UI instead of vue-components, please h...
2020-06-17T13:10:10
2020-06-17T13:10:10
{}
NONE
vuejs
core
642,409,417
1,338
Jinjiang
> The second argument provides a context object which exposes a selective list of properties that were previously exposed on `this` in 2.x APIs: https://composition-api.vuejs.org/api.html#setup
2020-06-11T05:06:06
2020-06-11T05:06:06
{}
MEMBER
vuejs
core
642,453,505
1,339
tangjinzhou
close it. I can use beforeUnmount、unmounted replace all beforeDestroy、destroyed.
2020-06-11T07:02:36
2020-06-11T07:02:36
{}
CONTRIBUTOR
vuejs
core
642,542,981
1,345
jacekkarczmarczyk
related? https://github.com/vuejs/vue-next/issues/574
2020-06-11T09:56:06
2020-06-11T09:56:06
{}
CONTRIBUTOR
vuejs
core
643,358,384
1,320
yyx990803
We shouldn't have DOM-specific special cases in `runtime-core`. Actually, we just need to mount children before setting the props (which is Vue 2's behavior)
2020-06-12T16:15:24
2020-06-12T16:15:24
{}
MEMBER
vuejs
core
643,486,292
1,197
yyx990803
> always use a buffer that returns an array and await on deep promises at unroll stage, the same way it's done in renderToStream. I think that is better - if both use the same buffer implementation then there's also no need to create bound versions of the render methods.
2020-06-12T21:15:28
2020-06-12T21:15:28
{}
MEMBER
vuejs
core
643,764,664
1,362
yyx990803
并不觉得心智负担比 ref 少... 甚至可以说更多,因为 1. 有时候能当普通 string 用(+),有时候又不行(===),因为疏忽造成奇怪 bug 的概率大了很多。2. 对静态分析和类型推导不友好。
2020-06-14T13:10:24
2020-06-14T13:10:24
{}
MEMBER
vuejs
core
643,924,425
1,311
tangjinzhou
@underfin I had to reopen this issue. I updated the code, I think it is a bug of vue3.
2020-06-15T06:11:55
2020-06-15T06:11:55
{}
CONTRIBUTOR
vuejs
core
644,078,460
1,370
underfin
https://github.com/vuejs/vue-next/blob/ee60a0967f56ebd1ff10572f5a506f9d82f4b14c/packages/runtime-core/src/index.ts#L186 Maybe it is helpful for you.
2020-06-15T11:44:02
2020-06-15T11:44:02
{ "+1": 1 }
MEMBER
vuejs
core
644,766,883
1,380
yyx990803
^ This is expected behavior.
2020-06-16T13:30:23
2020-06-16T13:30:56
{}
MEMBER
vuejs
core
642,324,798
1,335
mokeyish
@yyx990803 Here is my implemention of `angular like ioc` for vue 2.6x. My freinds and I think it can replace the `vuex`,It is more simplely for using. https://github.com/mokeyish/vue-ioc-di How can I implement it in vue3.0? vue 3.0 create a new intance internal. vue3.0 `provide/inject` implemention is too sim...
2020-06-10T23:50:46
2020-06-10T23:50:46
{}
NONE
vuejs
core
642,392,141
1,102
milewski
... I have added `"skipLibCheck": true,` temporarily to my tsconfig.json until this issue is sorted out
2020-06-11T04:01:54
2020-06-11T04:01:54
{}
NONE
vuejs
core
642,450,863
1,339
tangjinzhou
I can use beforeMount、mounted、updated ...... but beforeDestroy、destroyed .... Is there a plan to do compatibility ? @sodatea
2020-06-11T06:56:14
2020-06-11T06:56:14
{}
CONTRIBUTOR
vuejs
core
642,576,951
1,344
rigor789
@macdevign these files are published to npm - and you can already find them on cdn's like [jsdelivr](https://cdn.jsdelivr.net/npm/vue@3.0.0-beta.14/dist/) and [unpkg](https://unpkg.com/browse/vue@3.0.0-beta.14/dist/)
2020-06-11T11:14:10
2020-06-11T11:14:10
{}
CONTRIBUTOR
vuejs
core
642,685,687
1,342
underfin
I track this with 2.x.Find some inconsistent behavior with the blew.It's has a bit of weird. ``` // "" return this.$createElement("div", [true]); // "true" return this.$createElement("div", true); ```
2020-06-11T14:16:41
2020-06-11T14:16:41
{}
MEMBER
vuejs
core
643,221,319
1,350
posva
this one should be changed because `spellcheck` is not a boolean attribute (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck) It does work properly on Vue 2 by leaving the value to `false`. The relevant code is at https://github.com/vuejs/vue/blob/dev/src/platforms/web/util/attrs.js#L20
2020-06-12T11:28:25
2020-06-12T11:32:16
{ "+1": 4 }
MEMBER
vuejs
core
643,258,946
1,342
yyx990803
Your user doesn't inspect your DOM.
2020-06-12T13:03:47
2020-06-12T13:03:47
{ "+1": 4, "-1": 2, "confused": 1, "laugh": 4 }
MEMBER
vuejs
core
643,336,770
1,351
yyx990803
When you directly watch a reactive object, it is implicitly deep because it would be pointless if it's not a deep watch.
2020-06-12T15:31:21
2020-06-12T15:31:21
{ "+1": 2 }
MEMBER
vuejs
core
643,392,631
1,235
ozguruysal
I see, thanks for the tip @yyx990803, I got it now and thanks for fixing the issue @underfin.
2020-06-12T17:19:03
2020-06-12T17:19:03
{}
NONE
vuejs
core
643,593,126
1,352
underfin
Look like it is intentional. I fixed other warn for invalid expression with `v-else` on beta.15.
2020-06-13T08:48:34
2020-06-13T08:48:34
{}
MEMBER
vuejs
core
643,865,132
1,367
shengxinjing
forget it . It's not important logic.
2020-06-15T02:10:26
2020-06-15T02:10:26
{}
CONTRIBUTOR
vuejs
core
644,527,185
1,380
HcySunYang
This is consistent with the behavior of Vue2, because the old and new values have the same reference.
2020-06-16T04:42:01
2020-06-16T04:42:01
{}
MEMBER
vuejs
core
644,607,588
1,366
pikax
That's something I do quite a lot, as you said it can be done quite easily on userland. My only concern here is the naming `RValue`, I don't think `RValue` is good enough name to be exported from the library.
2020-06-16T08:10:47
2020-06-16T08:10:47
{}
MEMBER
vuejs
core
644,608,537
1,359
pikax
This will add quite more complexity to the template code, the solution for your problem would be better type inference in the template, with tools such as `vetur` and others.
2020-06-16T08:12:42
2020-06-16T08:12:42
{ "confused": 2 }
MEMBER
vuejs
core
428,390,278
4
yyx990803
@chrisvfritz static class fields are not in the spec yet. Currently in plain ES you can only do static getters. > Is there a way we can keep everything top-level? Maybe. Having the options as an object is easier for compatibility reasons. Making them flat involves extracting these flat properties back into an obj...
2018-10-09T23:45:03
2018-10-09T23:45:03
{}
MEMBER
vuejs
core
428,653,477
4
chrisvfritz
> static class fields are not in the spec yet. Currently in plain ES you can only do static getters. @yyx990803 I might have misunderstood, but I thought we were waiting to release Vue 3 until class features had stabilized. [Field declarations](https://github.com/tc39/proposal-class-fields) and [static class fields]...
2018-10-10T17:08:57
2018-10-10T17:08:57
{}
CONTRIBUTOR
vuejs
core
429,067,454
5
johnleider
I like all of these changes. I felt `nativeOn` made things confusing for users. The fall-through will make it easier to construct components.
2018-10-11T18:25:34
2018-10-11T18:25:34
{ "hooray": 1 }
NONE
vuejs
core
429,649,294
7
yyx990803
It looks quite fragile/hacky to me, and is essentially rendering the whole app twice... which means it decreases performance significantly... not sure if it's worth it at all. That said it's totally possible in v3.
2018-10-14T18:19:15
2018-10-14T18:20:31
{}
MEMBER
vuejs
core
429,974,290
9
yyx990803
I just edited my proposal a bit. When used without an argument the generated props should not care about what key it is. When used without an argument: ``` html <input v-model="foo"> ``` ``` js h('input', { modelValue: this.foo, 'onUpdate:modelValue': value => { this.foo = value } }) ``` ...
2018-10-15T19:00:02
2018-10-15T19:08:33
{}
MEMBER
vuejs
core
432,002,469
5
blake-newman
In that case I think we should mimic React keeping class name and style merging but not passing through attributes on spread to element nodes. This means that you get best of both worlds. Easy merging of classes and styles and explicit passing of props.
2018-10-22T21:50:45
2018-10-22T21:50:45
{}
MEMBER
vuejs
core
434,883,034
13
LinusBorg
Great, that's what I hoped for 😁
2018-10-31T23:35:00
2018-10-31T23:35:00
{}
MEMBER
vuejs
core
437,508,687
16
yyx990803
No, definitely not. Shared reactive state should be using the explicit `observable` API.
2018-11-09T22:01:41
2018-11-09T22:01:41
{}
MEMBER
vuejs
core
429,180,038
5
yyx990803
Oh, that's only needed if you have your own data that you want to merge into.
2018-10-12T02:07:58
2018-10-12T02:07:58
{ "+1": 1 }
MEMBER
vuejs
core
429,590,565
9
yyx990803
Actually with v3's flat vnode data implementation, declaring props is unnecessary. When you pass data down it doesn't matter if it's a prop or not. So the wrapper can simply do ``` vue <input v-bind="$attrs"> ``` Regarding the input event re-emit, I kinda want to avoid this event vs. value mismatch altogethe...
2018-10-14T02:17:41
2018-10-14T02:21:50
{}
MEMBER
vuejs
core
429,887,073
9
yyx990803
@chrisvfritz yeah, I agree regarding emitting `update:value` instead. #8 also makes sense. Making `v-model` smart can be tricky, because we can't know at compile time what element the `$attrs` will be spread on in the child component. One possible implementation: `v-model` generates code like this: ``` html <...
2018-10-15T14:56:15
2018-10-15T19:07:21
{}
MEMBER
vuejs
core
431,997,144
5
yyx990803
Right, but I think in those cases you are probably better off declaring the props explicitly.
2018-10-22T21:35:31
2018-10-22T21:35:31
{}
MEMBER
vuejs
core
432,662,268
5
blake-newman
Yes i agree, that is why you must still explicitly ask for `$attrs` to fall through for style and class merging. This is what I propose which follows React following 2.x API as i'm unsure on the structure for 3.x: This should be consistent for component fallthrough and element fallthrough ## Case 1 JS: ```j...
2018-10-24T13:45:23
2018-10-24T13:49:33
{}
MEMBER
vuejs
core
442,398,028
8
Jinjiang
I have another idea. Not quite sure it's good enough, but just an idea. 😅 ``` js class Foo extends Vue { props, data, model() { return { value, ...others } }, ... } ``` In another word, because the update event must be defined in the component to make sense. So maybe it's good ...
2018-11-28T10:29:22
2018-11-28T10:29:22
{}
MEMBER
vuejs
core
443,073,835
9
Jinjiang
Sorry for my bad description. 😅 As we discussed above, now ``` vue <input v-model="foo"> ``` will equal to: ``` js h('input', { modelValue: this.foo, 'onUpdate:modelValue': value => { this.foo = value } }) ``` not: ``` js h('input', { value: this.foo, 'onUpdate:value': value...
2018-11-30T02:57:54
2018-11-30T02:58:25
{}
MEMBER
vuejs
core
429,063,166
4
phanan
> do we actually need a special API for non-reactive properties? When you don't want a property to be reactive, couldn't you just avoid initializing it in data and do so in created/mounted instead? That's a very good point. IMHO reactivity should be opted-in instead of opted-out.
2018-10-11T18:14:05
2018-10-11T18:14:05
{}
MEMBER
vuejs
core
429,649,551
7
yyx990803
Also, it seems it cannot have nested components with queries. The walker stops when any component has async data. Still quite a limitation IMO.
2018-10-14T18:22:42
2018-10-14T18:22:42
{}
MEMBER
vuejs
core
431,500,753
5
yyx990803
@blake-newman not entirely sure if I understand your point... but is the concern about spreading `$attrs` would overwrite existing class and style? In response to that: - `$attrs` does contain `class` and `style` - When you do the following, `class` and `style` are automatically merged (same for `v-bind`): `...
2018-10-19T21:13:36
2018-10-19T21:14:31
{}
MEMBER
vuejs
core
442,395,119
8
Jinjiang
> Should we consider renaming the `input` event to `update:value` when no argument is provided? It would be another breaking change So how could we bind an event named `update:value` in template without `v-model`? Is `<MyComponent @update:value="xxx" />` or `<MyComponent v-on:update:value="xxx" />` (two colons?) a v...
2018-11-28T10:19:44
2018-11-28T10:19:44
{}
MEMBER
vuejs
core
428,636,935
2
chrisvfritz
> I'm not sure if there will be such use cases that the author want to hand-pick all allowed attributes and declare them inside props so nothing in $attrs will be touched. Technically it is a valid usage but users may come across the warning. @Justineo Beyond the unnecessary clutter this would add to the component d...
2018-10-10T16:20:07
2018-10-10T16:20:07
{ "+1": 1 }
CONTRIBUTOR
vuejs
core
429,979,827
8
Jinjiang
May I have a question about `v-model` and `.sync` here? 😅 IMO, both `.sync` and `v-model` are a little limited when use case becomes complicated. Because it often require you to do some validation or conversion during the two ways. When the value is a primitive type, that's OK. But when it's an array like multiple...
2018-10-15T19:17:55
2018-10-15T19:17:55
{}
MEMBER
vuejs
core
433,405,444
7
Akryum
BTW react-apollo switched to rendering the app multiple times: https://github.com/apollographql/react-apollo/pull/2533
2018-10-26T13:22:19
2018-10-26T13:22:19
{}
MEMBER
vuejs
core
433,910,830
12
yyx990803
@HerringtonDarkholme Hooks are stateful under the hood. A functional component with hooks is no longer a stateless functional component, it is internally represented as a stateful instance. It actually works fine in a class. On the other hand, not making it available in the idiomatic API makes it useless to a large gro...
2018-10-29T13:32:21
2018-10-29T13:33:28
{ "+1": 1 }
MEMBER
vuejs
core
434,928,471
13
KaelWD
:+1: we use provide/inject pretty much everywhere in vuetify, so keeping the 2.x API (or something like it) is vital for us to be able to update to 3 without a massive rewrite. Also like @znck, most of our usage is in computed properties.
2018-11-01T04:39:21
2018-11-01T04:40:36
{}
CONTRIBUTOR
vuejs
core
435,482,658
12
chrisvfritz
> Could there be a setter for `useComputed`? @Jinjiang I think it would make sense for `useComputed` to work the same as current computed properties, where they can accept a function or object with `get` and `set` methods: ```js const double = useComputed({ get: () => data.count * 2 set: newValue => { data...
2018-11-02T19:22:24
2018-11-02T19:22:24
{}
CONTRIBUTOR
vuejs
core
440,409,354
17
posva
I also think the term doesn't completely fit those components. Regarding removing render, I think, it's almost never done except for components having side effects, so it's better to not have it by default. Usually people writing these kind of components do have a very advanced knowledge on Vue
2018-11-20T19:56:34
2018-11-20T19:56:34
{}
MEMBER
vuejs
core
435,555,190
8
Justineo
> So I'm still in favor of option 2. What do you think? Not quite sure about it…it also disables usage like `v-bind.sync="obj"`.
2018-11-03T02:57:38
2018-11-25T01:48:19
{}
MEMBER
vuejs
core
428,413,462
2
Jinjiang
> I think the solution is making it a best practice to always spread `$attrs` if you intend to ship your component as a library. I guess there would be quite amount of mis-operations when: * write a component which is designed to accept `style` but forget `$attrs`, or * use a `class` to a fragment component or "...
2018-10-10T02:08:27
2018-10-10T02:20:43
{}
MEMBER
vuejs
core
437,121,993
11
Akryum
PR is up: https://github.com/vuejs/vue/pull/9017
2018-11-08T19:17:00
2018-11-08T19:17:00
{}
MEMBER
vuejs
core
428,397,155
4
yyx990803
**Edit: changed options to be flat static properties on the class**
2018-10-10T00:26:37
2018-10-10T00:26:37
{}
MEMBER
vuejs
core
428,818,561
4
chrisvfritz
@yyx990803 As I understand it, one of the main reasons we're defaulting to a class-based API is to prevent the schism where TypeScript users have to use a significantly different interface from everyone else. I agree that's a problem worth solving. However, if we're unable to sell the benefits of the class-based API...
2018-10-11T04:41:22
2018-10-11T04:41:22
{ "+1": 2 }
CONTRIBUTOR
vuejs
core
429,599,488
9
chrisvfritz
> Actually with v3's flat vnode data implementation, declaring props is unnecessary. When you pass data down it doesn't matter if it's a prop or not. Yay! 😄 > Regarding the input event re-emit, I kinda want to avoid this event vs. value mismatch altogether. Maybe the code `v-model` generates should just handle ...
2018-10-14T06:08:35
2018-10-14T06:08:35
{}
CONTRIBUTOR
vuejs
core
430,015,272
9
chrisvfritz
> I don't think it makes sense to use v-model with arguments on a plain element, it seems the use case is really for two-way binding on component only. So the runtime special handling will only apply to modelValue and onUpdate:modelValue. @yyx990803 I agree it doesn't make sense to use `v-model` with arguments on pl...
2018-10-15T21:13:46
2018-10-15T21:13:46
{}
CONTRIBUTOR
vuejs
core
433,404,246
7
Akryum
Maybe we could make `renderToString` asynchronous with ways to hook into it and do data prefetching and eventual secondary re-rerenders of components that prefetched some data?
2018-10-26T13:18:09
2018-10-26T13:18:09
{}
MEMBER
vuejs
core
433,436,205
5
yyx990803
@blake-newman I'm not sure if I can understand your proposal. A few notes regarding v3: Because VNode data is now flat, there's no longer the difference between `data`, `props` and `attrs` when you look at a VNode. - On a plain element: `class` and `style` has special treatments. Fields that start with `on` ar...
2018-10-26T14:55:45
2018-10-26T20:50:04
{}
MEMBER
vuejs
core
433,780,251
12
HerringtonDarkholme
Even as a traditional `class` fan, I believe hooks are superior and will prevail frontend development. Great to see it integrated in Vue-next! My only concern is that should we mix hook with normal class? They are two different mental model and it might be difficult for users to switch between...
2018-10-29T03:46:59
2018-10-29T03:46:59
{}
MEMBER
vuejs
core
440,388,968
17
LinusBorg
I agree with Evan here, I know the term referring to components that render a scoped slot, and usually no markup of their own. They only provide functionality through the slot props and don't render any markup of their own. The term is not perfect and I think it was coined by the React community when using renderPro...
2018-11-20T18:51:29
2018-11-20T18:51:29
{ "+1": 1 }
MEMBER
vuejs
core
428,632,607
2
Justineo
I'm not sure if there will be such use cases that the author want to hand-pick all allowed attributes and declare them inside `props` so nothing in `$attrs` will be touched. Technically it is a valid usage but users may come across the warning.
2018-10-10T16:07:38
2018-10-10T16:07:38
{}
MEMBER
vuejs
core
428,687,388
4
yyx990803
@chrisvfritz Ideally, we want to wait until class fields become part of the spec before releasing 3.0. I'm thinking somewhere around mid 2019, and with them being currently stage 3, it's unlikely for them to make it into ES2019. However, it's hopeful that they are stage 4 around that point, and that would be safe e...
2018-10-10T18:46:55
2018-10-10T19:04:45
{}
MEMBER
vuejs
core
428,885,960
4
Jinjiang
How about removing `data()` and move the job into `constructor` function? now: ``` js class App extends Component { // data data() { return { count: 0 } } } ``` new: ``` js class App extends Component { constructor() { // data this.count = 0; } } ``` Does it do the sam...
2018-10-11T09:26:47
2018-10-11T09:26:47
{ "+1": 1 }
MEMBER
vuejs
core
428,916,028
4
HerringtonDarkholme
> Constructors can, and often, do more than just initializing the data. Constructors in general can do a lot of things. But component class isn't general purpose, it is for binding view with data. For component constructors, most of them should do few things (or be dumb). React advises users only initialize state ...
2018-10-11T11:12:40
2018-10-11T11:13:40
{}
MEMBER
vuejs
core
429,053,832
4
yyx990803
Ok I've managed to make both `data` AND initializers work: ``` ts // plain ES2015, use `data()` for more concise code class Foo extends Component { data() { return { count: 1 } } } // TS or with Babel, use initializers for the nice syntax class Foo extends Component { count: number =...
2018-10-11T17:49:23
2018-10-11T17:53:43
{ "+1": 1, "hooray": 1 }
MEMBER
vuejs
core
430,113,944
4
DanielRosenwasser
Sorry, just to clarify for myself, is the idea that plain property declarations with initializers would automatically be marked as reactive? I think that would be **way** better from a UX POV, as well as a type system POV. I guess the downside is that this really could only work in a Proxy-based reactivity model; you c...
2018-10-16T06:14:51
2018-10-16T06:15:12
{}
CONTRIBUTOR
vuejs
core
430,245,730
4
yyx990803
@DanielRosenwasser yeah, plain initializers would become reactive. I think it's possible to work in older model too, as we are already doing that in `vue-class-component`.
2018-10-16T13:52:39
2018-10-16T13:52:39
{}
MEMBER
vuejs
core
434,154,293
12
HerringtonDarkholme
Mapping current API to hooks looks fantastic 😍 It feels like authentic Vue in hooks and type checks better! (lest lifecycle renaming fuss 😄 ). I'll try with Vue2 to see if it works well. @posva About minimizing, if we cannot rename properties on object in most compressor, but hooks expose themselves as local var...
2018-10-30T02:58:14
2018-10-30T02:59:45
{}
MEMBER
vuejs
core
434,755,605
12
Jinjiang
Could there be a setter for `useComputed`? And `useData` seems only accept an object or array which is a little constraint for that I think.
2018-10-31T16:30:01
2018-10-31T16:30:01
{}
MEMBER
vuejs
core
434,840,155
13
znck
I share your concerns, I checked all the places I have used provide/inject and in most the injected state is used either in a method or in a computed property.
2018-10-31T20:41:13
2018-10-31T20:41:39
{}
MEMBER
vuejs
core
441,580,408
12
Jinjiang
> > `useData` seems only (to) accept an object or array which is a little constraint for that I think. > > @Jinjiang I'm a bit lost here – why is it a constraint? The only other option for `data` is a function, which is, as far as my understanding goes, not relevant or necessary anymore in a hook context as the stat...
2018-11-26T09:54:23
2018-11-26T09:54:23
{}
MEMBER
vuejs
core
434,162,111
8
Justineo
https://github.com/vuejs/vue/issues/4946 This is where we decided to bring `.sync` back for 2.x and the original feature request was `v-model` for multiple values. Here are some potential problems I can think of: With the current syntax being `v-model="val"`, the actual prop in the binding is encapsulated, esp...
2018-10-30T03:48:00
2018-10-30T03:51:31
{}
MEMBER
vuejs
core
441,550,118
4
Jinjiang
> Update: don't know since when but latest Chrome Canary now enables class fields by default, so we can already play with the following API without a transpiler: So the `Data` interface in TS could be removed if it already works, right? ``` ts import { h, Component, ComponentWatchOptions } from '@vue/renderer-do...
2018-11-26T08:04:33
2018-11-26T08:04:33
{}
MEMBER
vuejs
core
443,069,593
8
chrisvfritz
> So how could we bind an event named update:value in template without v-model? Is <MyComponent @update:value="xxx" /> or <MyComponent v-on:update:value="xxx" /> (two colons?) a valid syntax? I don't see why we couldn't make it valid, if it isn't already. 🙂 I don't _think_ we currently allow for multiples arguments...
2018-11-30T02:34:30
2018-11-30T02:34:30
{}
CONTRIBUTOR
vuejs
core
428,624,499
2
chrisvfritz
> Maybe it's better to make `$attrs` implicit and print warnings when its a fragment/portal/closed component IMO. @Jinjiang I really like the idea of a warning for users, but with any implicit pass-through, I really think we're only _delaying_ pain by allowing users to rely on an unstable API that the component auth...
2018-10-10T15:45:40
2018-10-10T15:46:41
{}
CONTRIBUTOR
vuejs
core
429,017,449
2
yyx990803
Open separate issue for attrs fallthrough behavior: #5
2018-10-11T16:12:15
2018-10-11T16:12:15
{}
MEMBER
vuejs
core
429,030,574
5
chrisvfritz
Great overview! > Or maybe $attrs should just point to $props in this case? I think that makes sense. Then users never have to refactor `v-bind="$props"` to `v-bind="$attrs"` when they start defining props.
2018-10-11T16:46:48
2018-10-11T16:46:48
{}
CONTRIBUTOR
vuejs
core
429,630,312
7
Akryum
Well, that's the approach taken by the official [react-apollo](https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree) ([source](https://github.com/apollographql/react-apollo/blob/master/src/getDataFromTree.ts)). BTW it seems so much easier to do in React :sob:
2018-10-14T14:20:42
2018-10-14T14:20:42
{}
MEMBER
vuejs
core
433,432,456
11
yyx990803
The current `renderToString` implementation actually already handles async component (i.e. waiting on a component before it resolves) so it should be simple to use similar logic to wait on data fetching. We just need to have a convention or internal mechanism for a component to signal that it needs to wait for a preFet...
2018-10-26T14:44:42
2018-10-26T14:44:42
{ "+1": 1 }
MEMBER
vuejs
core
433,907,663
12
posva
Funny thing, the latest version I released for vue-promised uses named imports so it could also export a hook version. The pattern seems powerful but as you said it's hard for beginners so we have to be careful not to replace existing patterns that are much easier to grasp for newcomers because that's one of Vue goo...
2018-10-29T13:22:27
2018-10-29T13:22:27
{}
MEMBER
vuejs
core
434,101,356
12
yyx990803
@chrisvfritz yeah, I think we would introduce hooks as an advanced feature for code reuse. Re `count/setCount`: you are right, if you create an object with `useState()`, you can still directly mutate it and it will work. I added a new paragraph showing how we can provide hooks that maps Vue's current API (and I thin...
2018-10-29T22:16:28
2018-10-29T22:16:28
{ "+1": 2 }
MEMBER
vuejs
core
437,121,824
7
Akryum
Closing in favor of https://github.com/vuejs/vue-next/issues/11
2018-11-08T19:16:34
2018-11-08T19:16:34
{}
MEMBER
vuejs
core
440,473,573
17
chrisvfritz
@yyx990803 @LinusBorg @posva I think you're thinking of "container" components, but I'm referring to components that use the `provide`/`inject` interface to render non-XML (e.g. Canvas, WebGL, Audio, etc). For example: ```vue <MapboxMap> <MapboxMarkers :items="cities" /> <MapboxNavigation /> </MapboxMap> ``...
2018-11-20T23:59:21
2018-11-21T00:02:02
{ "+1": 2 }
CONTRIBUTOR
vuejs
core
428,415,356
2
yyx990803
> write a component which is designed to accept style but forget $attrs The best/common practice would be always merging `$attrs` in its entirety. It would be a conscious decision to only allow `style` falling through so I don't think it's possible to "forget". > use a class to a fragment component or "closed (wi...
2018-10-10T02:20:39
2018-10-10T02:20:39
{}
MEMBER