Last 12 weeks · 0 commits
2 of 6 standards met
Vue 3: Mid 2020 Status Update Many of our users have been asking this question: when will Vue 3 be ready? We have refrained from giving a definitive answer because predicting software delivery time is hardly ever accurate. As a non-profit-driven project, we wanted to focus on writing good software instead of hitting deadlines. However, it's been a long wait, and we know the uncertainty can make it difficult to make plans with Vue 3. So here we would like to provide some general guidance and detailed status updates to help our users adjust their expectations and plans accordingly. The majority of the time spent on Vue 3 has been invested into designing and building a solid core, which brings about many exciting improvments (you can read more about it here). However, in order to mark the whole framework "ready", it's not just about the core. We also need to have compatible versions of the supporting libraries (Vue Router, Vuex, test utils), tools (CLI, eslint plugin, browser devtool extensions, IDE extensions), and documentation (both for new users and migration). While we have been working hard on all of these parts, it is very difficult to accurately predict a timeline given the amount of effort and coordination it takes to have all the pieces fit together. We originally hoped to have Vue 3 released in the first half of 2020, but we have to adjust it given the current progress. Our current target dates are mid July for the RC (release candidate) and early August for the official release of 3.0. Decision Tree It doesn't mean you cannot start using Vue 3 today though. Most of the framework parts are now in either beta or alpha, and the core itself has been extensively tested by our early adopters. The only thing that blocks us from going into RC is the browser devtools extension (which is being actively worked on at this moment). All the significant changes have been landed and documented in RFCs and there are no more planned breaking changes. If you've been waiting to get onboard with Vue 3, here is a decision tree to help you plan accordingly: Status of Major Framework Parts Vue 3 Core Github RFCs Vue 3 core has been in beta for over two months now. We have merged all planned breaking change RFCs, and there are no further breaking changes planned before official 3.0 release. Thousands of early adopters have been using it for new projects and have helped us identify and fix many bugs and behavior inconsistencies with Vue 2. At this stage, we believe Vue 3 core is quite stable and ready for RC. Vue Router Github RFCs We still have a few minor router hook behavior consistency issues with , but these are the only things that is blocking the router from being marked as Beta. The router is usable for new, non-critical projects. Vuex Github The only difference between Vuex 4.0 and 3.x is that it's Vue 3 compatible! It is ready to enter RC together with Vue 3 core. Vue CLI Vue 3 support in Vue CLI is currently provided via the vue-cli-plugin-vue-next plugin. You can scaffold a new project and then run to switch to Vue 3. Vue 3 will become a option in the project creation process when it reaches RC. Note if you are not particularly attached to webpack and IE11 support, you can also start a Vue 3 project with Vite. JSX Support There are currently two JSX transform implementations for Vue 3 with slightly differing syntax (for Vue specific features): vueComponent/jsx HcySunYang/vue-next-jsx We are using this thread to unify the design and land on an official specification of how Vue features should be handled in JSX. If you use Vue with JSX, please provide your feedback in that thread. Other Projects [epv-badge]: https://img.shields.io/npm/v/eslint-plugin-vue/next.svg [epv-npm]: https://www.npmjs.com/package/eslint-plugin-vue/v/next [epv-code]: https://github.com/vuejs/eslint-plugin-vue [vtu-badge]: https://img.shields.io/npm/v/@vue/test-utils/next.svg [vtu-npm]: https://www.npmjs.com/package/@vue/test-utils/v/next [vtu-code]: https://github.com/vuejs/vue-test-utils-next [jsx-badge]: https://img.shields.io/npm/v/@ant-design-vue/babel-plugin-jsx.svg [jsx-npm]: https://www.npmjs.com/package/@ant-design-vue/babel-plugin-jsx [jsx-code]: https://github.com/vueComponent/jsx [vcc-badge]: https://img.shields.io/npm/v/vue-class-component/next.svg [vcc-npm]: https://www.npmjs.com/package/vue-class-component/v/next [vcc-code]: https://github.com/vuejs/vue-class-component/tree/next [vl-badge]: https://img.shields.io/npm/v/vue-loader/next.svg [vl-npm]: https://www.npmjs.com/package/vue-loader/v/next [vl-code]: https://github.com/vuejs/vue-loader/tree/next [rpv-badge]: https://img.shields.io/npm/v/rollup-plugin-vue/next.svg [rpv-npm]: https://www.npmjs.com/package/rollup-plugin-vue/v/next [rpv-code]: https://github.com/vuejs/rollup-plugin-vue/tree/next
This is not a proposal per se but I would like to raise some points about always calling on the value returned by (return value that I'm gonna name in this issue). Code is right here: https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/component.ts#L355 Intro: what it achieves Calling on the return value of enables: (deep) reactivity on every scope field, even those that aren't in . reactivity on field addition/removal. unwrapping values for easy consumption in template. (impl. detail) turns the scope into a proxy. 1. Missed optimizations makes every field and property deeply reactive by default. This can be counter-intuitive and misses some optimization opportunities. Consider: I would expect to be a reactive property, while is a non-reactive array. Maybe some read-only objects I got from server and I don't intend on modifying. This gives me total control over the reactivity, and only what I intend on modifying is actually reactive. But the scope will actually be fully reactive. This means every object in is gonna get wrapped in a proxy. Every UI binding is gonna create change listeners. All this work could have been avoided. Of course there's that enables me to avoid that if I really want to, but the default behavior doesn't feel intuitive. It's also slightly inconsistent. Why create reactive data in , if it'll be reactive anyway? Answer: you need to create reactive data if you intend to use it inside , e.g. in or . Otherwise you don't have to. It feels weird and arbitrary. 2. To value or not value? Speaking of inconsistency, Whether you have to use or not is also a bit inconsistent. Some users may deviate just slightly from the recommended pattern and do this: Using in kind of works, but cannot work everywhere. Inside , if you create a for example, works if you do , because is and is a . In the template on the other hand, works if you do because is and the has been unwrapped. Of course, the solution is to not use but refer to directly. You can be sure some users will fall into this trap. Using doesn't solve everything either, as we fall back into the inconsistencies of 1. If I declare something without a inside , say then event handlers that set it on will escape the change tracking, despite everything I said in 1 (since they would access the target of the proxy directly). 3. Unwrap refs ourselves Point 2 shows that usage can become confusing. History (I'm referring to Knockout here) also shows that devs don't like having accessors everywhere: they're verbose and it's easy to forget or misuse them if you don't have a type system (e.g. you write plain JS). So you may be tempted to do this: And now you can use all you want without ever writing a . This works great, but at this point doing on the returned value is a noop. If we go back to 1, and you want to have easy, fine control over what property is reactive and which one is not, you may be tempted to write your own function, say that either transform every field holding a ref into a getter/setter that unwraps them; or wrap the thing behind a proxy that does the same. In theory this is a great solution but the automatic will uselessly wrap this into a proxy. Additionally, every access (read/write) to will be double-tracked, once by the proxy, and once by the hidden inside. 4. Class-based components I totally understand why Vue 3 is gonna stay away from decorators, at least until they advance to a further stage. That said, some users may still think using decorators in their project is ok. They might like the following syntax: It's not very complicated to write the decorators that make this work. It won't be long before someone publishes them and that's fine. There are two issues here: The result of this code pattern suffers the same problem as the technique described in 3. Should users use private fields (they're becoming a thing); and should the proxy + private fields incompatibility not get addressed by TC39; then the pattern will fail miserably. As far as I can tell, if was not called on the scope automatically, this would work perfectly. Conclusion I _love_ the explicit control given by and the new Composition API ❤️ In fact, I've been wanting this in a modern framework since the day I stopped using Knockout. I feel like the automatic call on the scope is removing a lot of that explicit control -- or making it a lot more verbose to reclaim ( and co.). First idea that comes to mind is that users should be responsible for the precise shape of their scope, i.e. they need to call themselves if they want to. It means you can access the same object (proxy or not) in the template and in . Many people will often call anyway, because it's more convenient than doing lots of and . Conceptually, it's not harder than explaining ... Also: I think the (actual name to be defined) function I mentionned above should probably in Vue core. It's a better choice to call on the scope than .
Repository: vuejs/rfcs. Description: RFCs for substantial changes / feature additions to Vue core Stars: 4944, Forks: 537. Open PRs: 25, open issues: 30. Last activity: 1y ago. Community health: 37%. Top contributors: yyx990803, posva, wenfangdu, antfu, dobromir-hristov, xPaw, petr001, chenxsan, smolinari, CyberAP and others.
This is a follow up to a discussion in @yyx990803's workshop yesterday. Specifically I wanted to register a vote for an ability to break up and organize template "chunks" along with reorganized functions/options in Vue 3's composition API. Use case.. here is the code for the landing page you see at fiction.com As you can see, the code is nearly 1000 lines long. The composition API will definitely help with this. However, the template alone clocks in at 150 lines. In this there are discrete areas of functionality like figures vs grids, etc.. The initial suggestion was to break things out into multiple components, however, this comes at a cognitive cost in jumping around to different files. As well as what you might call "file bloat"... Im not sure of suggestions for the direct implementation details, however please consider its feasibility if you haven't already.
Creating an issue out of this ⬇ hoping for more discussion! Discussed in https://github.com/vuejs/rfcs/discussions/433 Originally posted by athewsey February 25, 2022 I recently came across https://github.com/vuejs/vue/issues/12433 because I have a use case for this feature too - and saw that the original requester was asked to bring it here to the RFCs process but couldn't find any such issue/PR/discussion yet. Essentially, I'm using Vue to build some Custom Elements / native web components which emit events. As noted in the 'Events' section of the Vue Web Components doc: Events emitted via or setup are dispatched as native CustomEvents on the custom element. Additional event arguments (payload) will be exposed as an array on the CustomEvent object as its property. The challenge here is that, because params are fed directly through to on the CustomEvent constructor, I don't see any way to set other Event options - particularly and . These are important features for native/DOM event handling, and it seems to me like it's not sufficient to just assume one setting always holds because presumably developers using this feature are doing so because (like me) their architecture is not vanilla "Vue-all-the-way-down". It seems possible to work around my specific bubbling requirement by manually raising a CustomEvent and setting composed , to allow it to bubble out of the shadow root and up through parents: ...But I don't see how it can be done today without the option (which I guess could be a problem for users with multiple nested shadow roots in their page?). I'm new to Vue's codebase and RFC process, but hopefully we can find a way to support this extra configuration that's still consistent-enough with what users are familiar with in normal Vue ?
Summary Support , allow to specify the match target, there are two available values: : use component name to match. : use the of the component to match. Cache management, provide a new prop called , users can provide custom caching strategy. Add two new lifecycle hooks: and , and the corresponding options API and . Links /rfcs/blob//active-rfcs/0000-my-proposal.md You can find this link by navigating to this file on your branch. Full Rendered Proposal Discussion Thread Important: Do NOT comment on this PR. Please use the discussion thread linked above to provide feedback, as it provides branched discussions that are easier to follow. This also makes the edit history of the PR clearer.**