Add Vite support to the GDK
What does this merge request do and why?
This adds support for vite to the gdk. vite is an alternative to webpack and with: gitlab!135714 (merged) we gain support to use it in development and testing (feature specs).
See also: gitlab-org/frontend/rfcs#106
Closes: #1991 (closed)
How to set up and validate locally
Setup
- If you already run
vite
locally, make sure it is stopped. - Do a
gdk update
- Run
git checkout leipert-add-vite-support
in the gdk folder. - Inside
gitlab/
folder: Rungit merge-base --is-ancestor 0e35808bc7c HEAD && echo 'vite supported' || echo 'oh NOES'
to double-check that your GitLab contains gitlab!135714 (merged) - Run
gdk start
to ensure your gdk is running - Run
echo "Feature.enable(:vite)" | gdk rails c
to enable the vite feature flag. This is needed for some older branches. - Run
gdk stop webpack rails-web
to stop the rails app / webpack - Run
gdk config set webpack.enabled false
to disable webpack - Run
gdk config set vite.enabled true
to enable vite - Run
gdk reconfigure
to update the config files - Run
gdk restart vite rails-web
to restart the rails app and vite as the developer server.
Verification
- Visiting pages in the GDK should work
- You should be able to run any feature spec, e.g.
bin/rspec spec/features/commit_spec.rb
GDK specific things
In order to minimize confusion, vite
and webpack
cannot be enabled at the same time. So the following should print a nice error:
gdk config set webpack.enabled true
gdk config set vite.enabled true
gdk reconfigure # => Error
# ERROR: Running vite and webpack at the same time is unsupported.
# Consider running `gdk config set webpack.enabled false` to disable webpack.
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by Lukas Eipert