shentao / vue-multiselect

Universal select/multiselect/tagging component for Vue.js
https://vue-multiselect.js.org/
MIT License
6.65k stars 990 forks source link

v4.0 Roadmap #963

Open shentao opened 5 years ago

shentao commented 5 years ago

Vue-Multiselect v3 Roadmap

Reasoning for the v3 Rewrite

The current 2.x version has become pretty complicated, especially on the template side. The way it currently behaves, makes it very hard to implement any accessibility improvements. Additionally, it limits the customisation options, especially on the interaction part. Adding more slots and props is sadly not a reliable long-term solution, since it will lead to further increased complexity and thus making it even harder to maintain.

Goals for the Rewrite AKA the New Architecture

The idea behind v3 is to simplify the library by breaking it apart into smaller, self-contained components responsible for fragments of the functionality (like options list, input, container, selected options), which can be replaced with developer-provided components for more control. To accomplish this, the whole “logic” part has to be extracted into an unopinionated UI-free component. This can be done by constructing a renderless component that exposes its state and methods to child components through scoped slots.

Then, the renderless component along with the smaller components can be composed and wired together to form the component that is required be the developer.

This should make it possible for developers to have almost complete control over the component and add their own functionalities on top of it, without requiring any changes within the library itself. This should lower the amount of feature-requests and thus help reduce feature-creep.

For example, you will be able to put a searchable table inside the dropdown. Or not have a dropdown at all and make it permanently open.

Here’s the visualization of the new architecture.

If this looks complicated to you – don’t worry. To keep the same, easy-to-use/just-works experience known from the current 2.x version, the rewrite will also ship with a default composition that mimics the current feel and look as well as API interface you got used to. That means, as long as you import the component import VueMultiselect from ‘vue-multiselect, you will use the that default composition.

This brings us to the breaking changes / migration part.

Breaking Changes / Migration from v2.x

Due to shipping with a pre-existing, default composition that mimics the current look and feel of the v2, there shouldn’t be that many breaking changes when migrating to the new version. Ideally, you should be able to just bump the package version and everything should work as it did, as long as you used the most popular features.

Possible breaking changes

Roadmap

All the changes are available on the v3 branch for you to try out.

How you can help?

For the questions part, a survey will follow shortly.

ztomaz commented 5 years ago

<button> inside MultiSelectWrapper should include type="button" otherwise it emits the event for form submition

shentao commented 5 years ago

@ztomaz Thanks! That is a great a catch (must have missed it while prototyping).

marktnoonan commented 5 years ago

Hi Damian, I am struggling with this error when I try to run npm run dev in v3:

mark:vue-multiselect marknoonan$ npm run dev

> vue-multiselect@3.0.0 dev /Users/marknoonan/Sites/open-source/vue-multiselect
> vue-cli-service serve

 INFO  Starting development server...
 98% after emitting                                                            

 ERROR  Failed to compile with 2 errors                                                                                                                      22:29:16

This relative module was not found:

* ./src/main.js in multi (webpack)-dev-server/client?http://10.0.0.23:8087/sockjs-node (webpack)/hot/dev-server.js ./src/main.js, multi (webpack)-dev-server/client?h
ttp://localhost (webpack)/hot/dev-server.js (webpack)-dev-server/client?http://10.0.0.23:8087/sockjs-node ./src/main.js

Maybe this is not something I should expect to be able to do at this point? If you can point me in a better direction to take this for a spin I'm excited to check it out. I didn't get far on debugging the error and it's time for bed! But I tried the top solutions I could find to similar errors. Nothing seemed too make much of a difference. Maybe the solution will be obvious to you.

I'm keen to help with docs and examples for v3. I really want to learn the strengths and weaknesses of the architecture you've chosen and get comfortable with the renderless stuff. Any pointers are appreciated.

shentao commented 5 years ago

Hey @marktnoonan, sorry for the late reply. I appreciate you giving it a try! The task to run to preview the library and the docs is npm run docs:dev / yarn docs:dev.

DmitrySkibitsky commented 5 years ago

Still waiting.

 :reduce="item => item.property"
abhilashtg commented 5 years ago

Was required to have an extra icon in the listed or selected entry if some condition is satisfied. On clicking the icon a popup has to come for capturing some extra details.

Is this possible currently?

DmitrySkibitsky commented 5 years ago

@abhilashtg What about slot?

DmitrySkibitsky commented 5 years ago

@abhilashtg https://github.com/DmitrySkibitsky/laravel-vue-spa-shopping-cart/blob/f29309cb17a7dc9f07f16798bffdc6d3da1de86f/resources/assets/js/components/public/catalog/Filters.vue#L27 Here add a new button to the selected items

abhilashtg commented 5 years ago

@DmitrySkibitsky Thanks! Let me try on it.

DmitrySkibitsky commented 5 years ago

@abhilashtg Look in the issue there are more examples of how these slots to write.)

abhilashtg commented 5 years ago

@DmitrySkibitsky Sure, Thank you.

abhilashtg commented 5 years ago

I have created a fiddle for my usecase: https://jsfiddle.net/abhilashtg/rq3twhbg/10/

The button is displayed. Even it can be an icon. I added a Bootstrap button. But the style seems not appearing.

The close icon in each selected option is dispapeared after adding the button. I need the button to visible conditionally.

andreasvirkus commented 4 years ago

@shentao has there been any progress on v3?

coolfarmer commented 4 years ago

@shentao , I'm about to use your component on a very large scale project, is there any news about the V3?

shentao commented 4 years ago

@coolfarmer The work has been restarted and we were able to make some really nice progress. If everything goes well, we might be able to ship an alpha release in the next 2 weeks. 🤞

guilhermeaiolfi commented 3 years ago

Just to confirm, the v3 development paused, right? I don't know what version should I use for a new project, or even if the recommendation would be look something else. Any news on this would be welcome. Thanks.

shentao commented 3 years ago

Sadly yes. Feel free to use the current version as it is mostly stable. The new version was supposed to be 95% backward compatible, so once it finally ships, it shouldn’t be a big problem to update.

guilhermeaiolfi commented 3 years ago

Since v3 is in an usable state, couldn't you publish an alpha version to npm? Maybe other would be interested in supporting it and maybe it would see a brighter future. Mostly because it seems that so much work went into it, it would be a shame to lost all the effort. It really looks like a very thought out project.

shentao commented 3 years ago

I could try doing that over the weekend. Will ping you here once it's done! :)

skjnldsv commented 3 years ago

Also, maybe pin this issue so people can see it first ! Thanks for everything you do @shentao :hugs:

sky-code commented 3 years ago

@shentao do this alpha release will contains feature for reduce value?

mseele commented 3 years ago

Is the renderless component approach still the way to go for v3? Because i find MultiselectCore.js only in the v3 branch and NOT in the next branch. In my understanding the v3 branch is obsolete and the next branch will be the v3 release, but maybe i'm wrong!?

Why i'm asking: We are evaluating different vue select libraries that we need to style at our own - some clarification would be cool. Thanks.

hisuwh commented 2 years ago

vue 3 is now the default version of 3. How is this progressing?

Anoesj commented 1 year ago

What's the progress on the v3 version of VMS? There's been an v3.0.0-alpha.2 out for quite some time now, how about finalizing the upgrading to v3 soon?

mattelen commented 1 year ago

For version 3, since a rewrite is a major task, and so much with Vue has changed since this roadmap was created, we're currently focused on getting a stable version of VMS working on Vue 3 based on the current VMS v2 codebase. A discussion on the direction we are heading with VMS has been opened here: https://github.com/shentao/vue-multiselect/discussions/1589