Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 - Remove `mutable` class properties plus other misc changes #781

Merged
merged 16 commits into from Mar 23, 2019

Conversation

Projects
None yet
2 participants
@owenconti
Copy link
Contributor

commented Mar 5, 2019

Lot's of stuff here, apologies for the large size. I can break pieces out to individual PRs if needed.

I'll try to summarize the changes:

Select component

  • Remove mutableValue and mutableOptions in hopes of simpler and less code in Select.vue
  • Added two new computed properties which take the place of mutableValue and mutableOptions: selectedValue and optionList
  • selectedValue is always an array (regardless of the multiple prop). This makes working with it easier because we'll always know the type
  • optionList is the combination of the options prop plus any pushed tags

Tests:

  • I've updated all the tests to pass. However, because we no longer mutate an internal prop when a value is passed, most of the tests were updated to not pass a value prop. By not passing a value prop, vue-select knows it has to manage the selected value internally. There is an internalValue data value which is used to manage the internal value (very much like mutableValue was before, only internalValue is only used in two places)
  • Removed the unused karma test

Dev sandbox:

  • I've added two more example usages of vue-select to the sandbox. I wanted to have examples of the three ways you can pass the selected value to the component: v-model, :value with @input, and no value (managed internally).

screen shot 2019-03-04 at 11 27 44 pm

Show resolved Hide resolved src/components/Select.vue Outdated
Show resolved Hide resolved src/components/Select.vue Outdated
@owenconti
Copy link
Contributor Author

left a comment

Removed the onInput prop and replaced with a method: updateValue

Show resolved Hide resolved src/components/Select.vue Outdated
Show resolved Hide resolved src/components/Select.vue Outdated
Show resolved Hide resolved build/webpack.prod.conf.js
Show resolved Hide resolved src/components/Select.vue Outdated

@sagalbot sagalbot merged commit f972591 into sagalbot:release/v3.0 Mar 23, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on ft/remove-mutableValue at 0.0%
Details
@sagalbot

This comment has been minimized.

Copy link
Owner

commented Mar 23, 2019

Huge thanks for this one @owenconti I think it's a big improvement!

sagalbot added a commit that referenced this pull request Apr 14, 2019

Merge remote-tracking branch 'origin/release/v3.0'
* origin/release/v3.0: (67 commits)
  ensure #222 stays closed (#828)
  add guide for reduce and taggable (#827)
  Remove foo bar (#826)
  WIP: v3 – remove onSearch callback prop (#811)
  doc content updates
  overhaul selecting docs, updated navigation and URL structure
  bump vue-server-renderer (#807)
  WIP: V3 - Remove index prop, add reduce prop (#800)
  V3/update list items slot (#799)
  update vuepress (#797)
  Update sandbox
  Add patch from #787
  update package deps, remove extra dev options
  V3 - Remove `mutable` class properties plus other misc changes (#781)
  refactor deselect method (#768)
  Sass & Class Renames (#759)
  fix coveralls coverage reporter (#766)
  remove: - express - gitbook - json-loader - markdown-loader - normalize.css - prismjs - vue-resource
  use test-utils beta-20
  fix failing test
  ...

# Conflicts:
#	docs/gitbook/README.md
#	docs/homepage/home.html
#	src/components/Select.vue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.