Skip to content

Use Vue Router and Vue Apollo in favor of Vuex

Tom Quirk requested to merge vue-router into master

This MR takes us a slight step back in functionality in order to enable better steps forward in the future.

Primarily, we:

  • Use Vue Router for routing within the Vue app
  • Use Vue Apollo, with a single instance of Apollo Client, for graphql things
  • Use Apollo's cache (in tandem with Vue Apollo) for state management

Why get rid of Vuex for Vue Apollo?

tl;dr: We need Vue Apollo for graphql purposes (requesting and caching list of issues, uploading designs, and potentially more things in the future). Given this, it makes sense to also leverage Apollo's cache for global state management in favor of Vuex. If we did adopt Vuex, we would have potentially 2 sources of truth for data, which leads to unnecessary complexity and likely bugs.

There is a lengthy discussion on the topic here, centered around Apollo adoption in gitlab-org/gitlab: gitlab-org/frontend/rfcs#7 (closed).

Edited by 🤖 GitLab Bot 🤖

Merge request reports