Remove Vue 2 and its packages
What does this MR do and why?
Merge request stack
These are merged:
- !265419 (merged): Mark every Vue 3 migration as migrated
- !269141 (merged): Mark the authentication and Geo Vue 3 migrations as migrated
- !269142 (merged): Mark the merge request pages Vue 3 migration as migrated
- !265428 (merged): Build and test with Vue 3 by default
Merge the rest in order. Each one targets the branch of the one before it.
- !265429 (merged): Remove Vue 2 and its packages (this MR)
- !267971 (merged): Remove the Vue 3 CI jobs
- !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
vuechanges to3.5.43. The build already aliasesvueto Vue 3, so the Vue 2 package is not used.- These packages go, because they exist only for Vue 2:
vue-template-compilervue-loader15@vitejs/plugin-vue2@vue/vue2-jest- Vue Test Utils 1
- the Vue 2 versions of
vuex,vue-router,vue-apollo,portal-vueandvue-virtual-scroll-list. The build already aliases each one to its Vue 3 replacement.
- Vue Test Utils 2 is added as
@vue/test-utilsat2.4.6. Specs import@vue/test-utils, andimport-x/no-extraneous-dependenciesmust find it. The exact version matches the@vue/test-utils-vue3alias, so both share one resolution and no second copy is installed. - The vendor DLL no longer lists
vuex. The Vue 2vuexis 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_sfcfixtures. No Vue 2 runtime is left to mount.
Commit 2: remove the VUE_VERSION switch
config/vue3migration/version.jsgoes. Without Vue 2, the2side 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_VERSIONchecks in specs go, so their Vue 3 code always runs. This includes the integration setups for boards and repository inee/spec/frontend/integration. Before, they readprocess.env.VUE_VERSION, whichversion.jsset. Without this fix, the specs took the Vue 2 path whenVUE_VERSIONwas unset and failed locally. They would also fail in CI after !267971 (merged) removes the variable. scripts/frontend/jest_ci.jsno longer checks that--vue3matchesVUE_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.jsstays skipped. TheVueRenderer.updatePropslimitation 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 --immutablepasses. The installedvueis 3.5.43 and@vue/test-utilsis 2.4.6.yarn jest spec/frontend/lib/utils/vue3compat spec/frontend/vue3migration spec/frontend/content_editor/extensions/suggestions_responses_spec.jspasses.yarn jest:integration ee/spec/frontend/integration/boards ee/spec/frontend/integration/repositorypasses: 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
- Part of the plan to remove Vue 2: #634491 (closed)
- Proof of concept this MR is split from: !263207 (closed)
- Stacked on: !265428 (merged)
- Verification plan for the compiler switch, which must run on GitLab.com before this MR: #640487 (closed)
- Parent epic: &6252
- Next in the stack: !267971 (merged)
- Duo review, integration setups: !265429 (comment 4302998957)
- Duo review,
@vue/test-utilsversion: !265429 (comment 4302999070) - Follow-up that removes the unreachable Vue 2 branches: !273624