POC: Add rollup in order to be able to write modern Vue and JavaScript.
The Why
Different parts of the www-gitlab-com repository have been built with Vue now:
- The SDLC comparison tabs
- The Compensation calculator
All this features have been built with Directly in hand-crafted JavaScript files which are then sent to the browser. This comes with considerable downsides:
- It makes testing a bit harder
- It doesn't allow to write Single File Components which are a big feature of Vue
- It is easy to introduce browser specific bugs, because the developer might forget to test in browsers
- Development comfort is a bit better if Frontend engineers want to help out
The What
-
This adds a new folder to the repository, called
frontend/. This is where new and modern JavaScript parts can find their new home. -
The folder has a new sub-folder called
frontend/bundles/. These files will be rolled-up and built. The built files will be added tojavascripts/bundles/via an external pipeline. -
Say you have a bundle called
frontend/bundles/example.js, you can use it by adding:extra_js: - bundles/tech-stack.jsto the frontmatter of the file you want to add it to.
Closes #2157 (closed)
Edited by Lukas Eipert