vue-multiselect icon indicating copy to clipboard operation
vue-multiselect copied to clipboard

v4.0 Roadmap

Open shentao opened this issue 5 years ago • 25 comments

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

  • Advanced features that could be easily implemented on top of the new architecture, that when removed from the library core could hugely simplify its internals. (I look at you option groups)
  • Slight changes to props, events emitted and slots that could improve the overall developer experience and flexibility.
  • Changes in the UX of the component.
  • Changes to the internals of the library. Relying on them right now might require further changes in your code.

Roadmap

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

  • [x] Extracting the functionality into a set of smaller, presentation components and a renderless component that controls them all.
  • [x] Move some of the functionalities to those smaller components, if they are opinionated and specific to the default composition and would hinder the customization when using the renderless component.
  • [ ] Removal of the features that would hinder users from fully customizing the user experience.
  • [ ] Collecting a list of recurring feature requests and issues, that could be solved with the rewrite.
  • [ ] Tests
    • [x] Migrate current suite
    • [ ] New tests for the new use cases that are now possible
  • [ ] User tests and feedback.
  • [ ] New docs.
    • [x] Migrate current docs to VuePress
    • [ ] New guide for composing the
  • [ ] Accessibility improvements for the default composition (through the partial components).
  • [ ] Exploration of ways that would further simplify the usage, even for complex cases.

How you can help?

  • Take the current v3 for a spin, leave your feedback here. Would love to hear your feedback on the architecture changes and the overall direction.
  • What you feel works well in v2 and what does not?
  • Which features do you think can be dropped from the library, given those could be implemented easily by the developer on top of the new architecture?
  • Any help with getting the docs and tests migrated would help a lot.
  • Any help with building new examples using the new architecture to find the limits would be much appreciated.
  • If you’d like to get involved in the development of the new version – send me a message on Vue’s Official Discord or on Twitter.

For the questions part, a survey will follow shortly.

shentao avatar Apr 06 '19 12:04 shentao

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

ztomaz avatar Apr 14 '19 15:04 ztomaz

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

shentao avatar Apr 15 '19 10:04 shentao

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

> [email protected] 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.

marktnoonan avatar Apr 22 '19 02:04 marktnoonan

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.

shentao avatar Apr 27 '19 09:04 shentao

Still waiting.

 :reduce="item => item.property"

DmitrySkibitsky avatar Jun 05 '19 08:06 DmitrySkibitsky

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?

abhilashtg avatar Jun 10 '19 11:06 abhilashtg

@abhilashtg What about slot?

DmitrySkibitsky avatar Jun 10 '19 11:06 DmitrySkibitsky

@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

DmitrySkibitsky avatar Jun 10 '19 11:06 DmitrySkibitsky

@DmitrySkibitsky Thanks! Let me try on it.

abhilashtg avatar Jun 10 '19 11:06 abhilashtg

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

DmitrySkibitsky avatar Jun 10 '19 11:06 DmitrySkibitsky

@DmitrySkibitsky Sure, Thank you.

abhilashtg avatar Jun 10 '19 12:06 abhilashtg

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.

abhilashtg avatar Jun 12 '19 12:06 abhilashtg

@shentao has there been any progress on v3?

andreasvirkus avatar Nov 18 '19 19:11 andreasvirkus

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

coolfarmer avatar Apr 15 '20 20:04 coolfarmer

@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. 🤞

shentao avatar May 15 '20 20:05 shentao

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.

guilhermeaiolfi avatar Nov 11 '20 12:11 guilhermeaiolfi

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.

shentao avatar Nov 11 '20 17:11 shentao

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.

guilhermeaiolfi avatar Nov 11 '20 17:11 guilhermeaiolfi

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

shentao avatar Nov 11 '20 17:11 shentao

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

skjnldsv avatar Nov 13 '20 06:11 skjnldsv

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

sky-code avatar Dec 11 '20 10:12 sky-code

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.

mseele avatar May 28 '21 06:05 mseele

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

hisuwh avatar Feb 16 '22 09:02 hisuwh

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?

Anoesj avatar Dec 29 '22 11:12 Anoesj

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

mattelen avatar Dec 29 '22 12:12 mattelen