Loading
Remove unused roadmapShellEl from milestones list section
What does this MR do and why?
Removes the unused roadmapShellEl data field from both roadmap list sections.
ee/app/assets/javascripts/roadmap/components/epics_list_section.vueroadmapShellElindata()- its assignment from
this.$root.$el.querySelector('.js-roadmap-shell')ininitMounted()
ee/app/assets/javascripts/roadmap/components/milestones_list_section.vueroadmapShellElindata()- its assignment from
this.$root.$el.firstChildininitMounted()
Nothing reads the field in either component or in their specs.
Why it went out of use
- 2019-11, !19875 (merged): buffered rendering for the roadmap.
roadmapShellElheld the roadmap shell element and was passed as:scrollelementtovue-virtual-scroll-listinepics_list_section.vue, behind theroadmap_buffered_renderingflag. - 2020-01, !22748 (merged): milestones added to the roadmap.
milestones_list_section.vuewas modelled on the epics section and copied the field and the assignment, but it never rendered a virtual list. The field was unused in this file from day one. - 2020-08, !40243 (merged): the epics section changed the lookup from
firstChildtoquerySelector('.js-roadmap-shell')becausefirstChilddid not return the shell. The milestones copy was not updated. - 2021-03, !57486 (merged): the
roadmap_buffered_renderingflag and the<virtual-list>element were removed because buffered rendering had been broken for a while. That removed the only reader ofroadmapShellEl. The field and its assignment stayed in both files.
The firstChild lookup was the reason this came up: under Vue 3 it can return a text or comment node instead of an element. Since the field is unused, removing it is the fix.
How to set up and validate locally
yarn jest ee/spec/frontend/roadmap/components/epics_list_section_spec.js ee/spec/frontend/roadmap/components/milestones_list_section_spec.jsThe roadmap page has no visible change.
References
- Found while reviewing !251472 (comment 3853520260) (reviewer listed the
firstChildline as a second occurrence) - Related fix for the other occurrence: !256325 (merged)
- Introduced the field: !19875 (merged)
- Copied it to the milestones section: !22748 (merged)
- Changed the epics lookup to
querySelector: !40243 (merged) - Removed its only reader: !57486 (merged)
Edited by Miguel Rincon