Skip to content

Retire config.vite.__safe_enabled and config.vite.__set_vue_version

The following discussions from !4068 (merged) should be addressed:

  • @toon started a discussion:

    Technically we could get rid of this and move the logic of this config setting to here. The only other thing that needs to change is calling service(:Vite).enabled? in support/templates/gitlab/config/vite.gdk.json.erb. But I'm happy to postpone that to a future MR.

  • @toon started a discussion:

    I also like to retire config.vite.__set_vue_version at some point.

Implementation plan

We’re looking to remove two boolean settings from lib/gdk/config.rb following Populate Vite Procfile entry from service (!4068 - merged) being merged.

  1. vite.__set_vue_version, which checks that vite.vue_version is equal to 3. We want to just check this directly in the env method of lib/gdk/services/vite.rb.
  2. vite.__safe_enabled, which checks that Vite and Webpack are not enabled at the same time. We want to also move this to the enabled? method of lib/gdk/services/vite.rb.

To do this, for each setting:

  1. Remove the bool(:...) setting from lib/gdk/config.rb in the settings :vite section.
  2. For __safe_enabled, remove the __safe_enabled test from spec/lib/gdk/config_spec.rb in the describe 'vite' section.
  3. In support/templates/gitlab/config/vite.gdk.json.erb, replace config.vite.__safe_enabled? with service(:Vite).enabled?. (That is the method you just updated!)

To test that it all still works, enable Vite by running gdk config set vite.enabled true and disable Webpack gdk config set webpack.enabled true. Then run gdk reconfigure and start the GDK with gdk start and open it in the browser.

Edited by Kev Kloss