--- status: proposed creation-date: "2023-10-10" authors: [ "@iamphill" ] coach: [ "@ntepluhina" ] approvers: [ ] owning-stage: "~devops::create" participating-stages: [] --- # New diffs ## Summary Diffs at GitLab are spread across several places with each area using their own method. We are aiming to develop a single, performant way for diffs to be rendered across the application. Our aim here is to improve all areas of diff rendering, from the backend creation of diffs to the frontend rendering the diffs. ## Motivation ### Goals - improved perceived performance - improved maintainability - consistent coverage of all scenarios ### Non-Goals ### Priority of Goals In an effort to provide guidance on which goals are more important than others to assist in making consistent choices, despite all goals being important, we defined the following order. **Perceived performance** is above **improved maintainability** is above **consistent coverage**. Examples: - a proposal improves maintainability at the cost of perceived performance: ❌ we should consider an alternative. - a proposal removes a feature from certain contexts, hurting coverage, and has no impact on perceived performance or maintanability: ❌ we should re-consider. - a proposal improves perceived performance but removes features from certain contexts of usage: ✅ it's valid and should be discussed with Product/UX. - a proposal guarantees consistent coverage and has no impact on perceived performance or maintainability: ✅ it's valid. In essence, we'll strive to meet every goal at each decision but prioritise the higher ones. ## Proposal ## Design and implementation details ### Workspace & Artifacts - We will store implementation details like metrics, budgets, and development & architectural patterns here in the docs - We will store large bodies of research, the results of audits, etc. in the [wiki](https://gitlab.com/gitlab-com/create-stage/new-diffs/-/wikis/home) of the [New Diffs project](https://gitlab.com/gitlab-com/create-stage/new-diffs) - We will store audio & video recordings on the public Youtube channel in the Code Review / New Diffs playlist - We will store drafts, meeting notes, and other temporary documents in public Google docs ### Definitions #### Maintainability Maintainable projects are _simple_ projects. Simplicity is the opposite of complexity. This uses a definition of simple and complex [described by Rich Hickey in "Simple Made Easy"](https://www.infoq.com/presentations/Simple-Made-Easy/) (Strange Loop, 2011). - Maintainable code is simple (single task, single concept, separate from other things). - Maintainable projects expand on simple code by having simple structure (folders define classes of behaviors, e.g. you can be assured that a component directory will never initiate a network call, because that would be complecting visual display with data access) - Maintainable applications flow out of simple organization and simple code. The old saying is a cluttered desk is representative of a cluttered mind. Rigorous discipline on simplicity will be represented in our output (the product). By being strict about working simply, we will naturally produce applications where our users can more easily reason about their behavior. #### Done GitLab has an existing [definition of done](/ee/development/contributing/merge_request_workflow.md#definition-of-done) which is geared primarily toward identifying when an MR is ready to be merged. In addition to the items in the GitLab definition of done, work on new diffs should also adhere to the following requirements: - Meets or exceeds all metrics - Meets or exceeds our minimum accessibility metrics (these are explicitly not part of our defined priorities, since they are non-negotiable) - All work is fully documented for engineers (user documentation is a requirement of the standard definition of done) ## Alternative Solutions