No code is the best way to write performant software. Write nothing, deploy nowhere.
Currently, large package based PHP projects (like Magento) suffer from long build times. Some of this is due to bad code, some is due to over-allocation to higher levels of the testing pyramid, and some is attributable to the sheer volume of the codebase.
Fortunately, the last problem of "the codebase is large" is a solved problem. Tools like NX and Bazel leverage topological sorting of the dependency graph along with an intelligent build cache to only build, test, lint, and (insert your job here) the particular subgraph of the package graph that has changed.
This demo uses Nx
to highlight what graph-build tools do, and how they can be used with php
.
git clone https://github.com/damienwebdev/demo-nx-php && cd demo-nx-php
npm ci
composer install
# This is the first run, you have no cache.
npx nx run demo-nx-php/package-c:test
# This is the second run, you have cache.
npx nx run demo-nx-php/package-c:test
demo-nx-php_Trim.mp4
This showcases the flexibility of Nx across PHP, a currently undocumented language.