[[ This document is still a work in progress; expect changes ]]
== What is the problem or opportunity? ==
Enable WMF developers to automatically compile front-end assets (scripts, styles, templates, etc) as part of the deployment or CI process for skins and and extensions.
== What does the future look like if this is achieved? ==
Achieving this means that developers can rely on an automated build step in production.
The benefits include flexibility and improved developer experience (allowing developers to write code in Typescript or more modern versions of JS) as well as performance optimizations (tree-shaking of external dependencies, Vue template pre-compilation) to send more efficient payloads to the user’s browser. A given extension or skin could specify a build script in a place like its package.json file, without the need for developers to commit compiled code into version control.
== What happens if we do nothing? ==
Doing nothing means that we give up some opportunities to improve the site performance for users and continue shipping unnecessary code in many places. We also will continue to limit developers in that the code they write must be the exact code that is run in all browsers. This means no ability to rely on tools like Typescript (very useful for reducing bugs in software) or to automate the process of supporting legacy browsers. Developers in the wider web community are increasingly used to having these tools, so this will be one way that we continue to separate ourselves from wider trends and best practices.
== Any additional background or context to provide? ==
This work should be seen as the next stage in the larger Vue.js migration / front-end modernization project. The original Vue.js [[ https://phabricator.wikimedia.org/T241180 | RFC ]] mentioned this task as one potential follow-up. The original Build Step [[ https://phabricator.wikimedia.org/T241180 | RFC ]] from 2018 is also still valid and provides good background on why this is important to have.
== Why are you bringing this decision to the technical forum? ==
This problem cuts across the concerns of many different teams (product teams, security, release engineering, etc); similarly, any solutions we adopt will impact many teams downstream – enabling or limiting some of their options in terms of development tooling. It is essential to have input from all impacted groups to come up with an adequate solution here.
**One example that is worth noting in particular**: the Release Engineering team is preparing to roll out some new container-based infrastructure to support the deployment process. It is possible that a front-end build step could "piggyback" on this new infrastructure, providing improved developer experience across all teams without requiring a huge amount of additional work.
== Additional resources ==
- [Draft] [[ https://docs.google.com/document/d/1dRJyu_4PqBOkUEkEOG3NxEhieKSnGI3lOmKwbEnQNKI/edit?usp=sharing | Decision Statement Overview document ]] (WMF staff only; includes the above problem statement)
- Vue.js RFC (resolved): https://phabricator.wikimedia.org/T241180
- Original frontend build step RFC (open, stalled): https://phabricator.wikimedia.org/T199004