Loading
Add single repository Vue app mount behind a feature flag
What does this MR do and why?
Beginning of gitlab-org#23817. This MR adds:
- The
repository_single_vue_appwipfeature flag (project actor, default off) TreeHelper#repository_single_vue_app_enabled?(project), the one flag check shared by both views.TreeHelper#vue_repository_app_data(project, repository, ref, ref_type, blob: nil). It builds one payload from the existing building blocks and outputs each value once.projects/_repository_app.html.haml, which renders only#js-repository-appwith a loading icon._files.html.hamlandblob/show.html.hamlrender it when the flag is on.#js-file-browserand its 320px reserved width stay where they are, to avoid layout shift.
Some notes for reviewers:
spec/spec_helper.rbturns the flag off by default. The frontend doesn't read#js-repository-appyet (#630951 (closed)), so leaving it on would break the existing repository feature specs and frontend fixtures. Specs that need the flag on turn it on explicitly.
References
- #630950 (closed)
- Frontend follow-up: #630951 (closed)
Screenshots or screen recordings
Not applicable. When the flag is on, the page shows a loading icon in the repository region until the frontend from #630951 (closed) lands.
| Before | After |
|---|---|
How to set up and validate locally
- In a Rails console, run
Feature.enable(:repository_single_vue_app, Project.find_by_full_path('<path>')). - Open a tree page and a blob page of that project. In the page source, check that
#js-repository-appis rendered with itsdata-*attributes, and that#js-tree-list,#js-view-blob-appand#js-repository-blob-header-appare not. - Run
Feature.disable(:repository_single_vue_app)and check that the legacy mount points come back.
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.
Edited by Chaoyue Zhao