Remove Vue 2 and its packages

What does this MR do and why?

Merge request stack

These are merged:

Merge the rest in order. Each one targets the branch of the one before it.

  1. !265429 (merged): Remove Vue 2 and its packages (this MR)
  2. !267971 (merged): Remove the Vue 3 CI jobs
  3. !268002 (merged): Remove the Vue 3 migration tooling

This one targets the branch of !265429 (merged) and does not depend on 3 or 4:

  • !273624: Remove the unreachable Vue 2 branches

After !265428 (merged), Vue 3 is the default runtime and the Vue 3 compiler is the default compiler. Vue 2 and the VUE_VERSION switch are now dead weight, so this MR removes them.

Merge this MR only after !265428 (merged) has run on GitLab.com for about two weeks. This MR removes vue-template-compiler, so after it a revert of the compiler switch also needs the Vue 2 packages back.

Commit 1: remove Vue 2 and its packages

  • vue changes to 3.5.43. The build already aliases vue to Vue 3, so the Vue 2 package is not used.
  • These packages go, because they exist only for Vue 2:
    • vue-template-compiler
    • vue-loader 15
    • @vitejs/plugin-vue2
    • @vue/vue2-jest
    • Vue Test Utils 1
    • the Vue 2 versions of vuex, vue-router, vue-apollo, portal-vue and vue-virtual-scroll-list. The build already aliases each one to its Vue 3 replacement.
  • Vue Test Utils 2 is added as @vue/test-utils at 2.4.6. Specs import @vue/test-utils, and import-x/no-extraneous-dependencies must find it. The exact version matches the @vue/test-utils-vue3 alias, so both share one resolution and no second copy is installed.
  • The vendor DLL no longer lists vuex. The Vue 2 vuex is gone.
  • The patches for the removed packages go. Nothing is left to patch.
  • The spec that mounts the Vue 2 runtime next to Vue 3 goes, with its shared_sfc fixtures. No Vue 2 runtime is left to mount.

Commit 2: remove the VUE_VERSION switch

  • config/vue3migration/version.js goes. Without Vue 2, the 2 side of every check cannot build. Webpack, rspack, Vite, Storybook and Jest now always use the Vue 3 setup.
  • The infection loaders and plugins for rspack, webpack and Vite go. They only redirected imports away from Vue 2, and did nothing under Vue 3.
  • The VUE_VERSION checks in specs go, so their Vue 3 code always runs. This includes the integration setups for boards and repository in ee/spec/frontend/integration. Before, they read process.env.VUE_VERSION, which version.js set. Without this fix, the specs took the Vue 2 path when VUE_VERSION was unset and failed locally. They would also fail in CI after !267971 (merged) removes the variable.
  • scripts/frontend/jest_ci.js no longer checks that --vue3 matches VUE_VERSION. Every run is Vue 3, so a mismatch is not possible. !267971 (merged) removes --vue3.
  • The build cache keys and the Vite cache directory no longer name a Vue version. Each cache is rebuilt once.
  • content_editor/extensions/suggestions_responses_spec.js stays skipped. The VueRenderer.updateProps limitation that it records is still there.

config/vue3migration/compilers/vue2_template.js and spec/frontend/__helpers__/vue2_jest_transformer.js are no longer loaded. !268002 (merged) removes them with the rest of the migration code.

The VUE_VERSION variables in the CI YAML stay. !267971 (merged) removes them with the Vue 3 CI jobs.

How this was verified

All of these ran on the branch after the rebase onto master, with VUE_VERSION and VUE_COMPILER_VERSION unset:

  • yarn install --immutable passes. The installed vue is 3.5.43 and @vue/test-utils is 2.4.6.
  • yarn jest spec/frontend/lib/utils/vue3compat spec/frontend/vue3migration spec/frontend/content_editor/extensions/suggestions_responses_spec.js passes.
  • yarn jest:integration ee/spec/frontend/integration/boards ee/spec/frontend/integration/repository passes: 17 suites, 78 tests. The fixtures came from a master pipeline.
  • With the old conditional integration setups, the boards and repository specs fail: 12 of 12 tests. This proves the integration fix is needed.
  • The same change passed the full pipeline of the proof of concept, E2E included: https://gitlab.com/gitlab-org/gitlab/-/pipelines/2981954991.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

References

Edited by Miguel Rincon

Merge request reports

Loading
Loading