This document describes various guidelines to ensure consistency and quality across GitLab's frontend team.
GitLab is built on top of Ruby on Rails using Haml with Hamlit. Be wary of the limitations that come with using Hamlit. We also use SCSS and plain JavaScript with modern ECMAScript standards supported through Babel and ES module support through webpack.
We also utilize webpack to handle the bundling, minification, and compression of our assets.
Working with our frontend assets requires Node (v4.3 or greater) and Yarn (v0.17 or greater). You can find information on how to install these on our installation guide.
jQuery is used throughout the application's JavaScript, with Vue.js for particularly advanced, dynamic elements.
For our currently-supported browsers, see our requirements.
- Before writing code guarantee your vision of the architecture is aligned with GitLab's architecture.
- Add a diagram to the issue and ask a Frontend Architecture about it.
- Don't take more than one week between starting work on a feature and sharing a Merge Request with a reviewer or a maintainer.
- Follow the steps in Vue.js Best Practices
- Follow the style guide.
- Only a handful of people are allowed to merge Vue related features. Reach out to one of Vue experts early in this process.
How we go about making fundamental design decisions in GitLab's frontend team or make changes to our frontend development guidelines.
How we write frontend tests, run the GitLab test suite, and debug test related issues.
Common JavaScript design patterns in GitLab's codebase.
Vue specific design patterns and practices.
Axios specific practices and gotchas.
How we use SVG for our Icons.
We use eslint to enforce our JavaScript style guides. Our guide is based on the excellent Airbnb style guide with a few small changes.
Our SCSS conventions which are enforced through scss-lint.
Best practices for monitoring and maximizing frontend performance.
Frontend security practices.
Our accessibility standards and resources.
Frontend internationalization support is described in this document. The externalization part of the guide explains the helpers/methods available.
Our internal DropLab
dropdown library.