Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 1.55 KB

README.md

File metadata and controls

36 lines (23 loc) · 1.55 KB

NX + PHP Demo

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.

Prerequisites

Show me the code.

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

Comments

This showcases the flexibility of Nx across PHP, a currently undocumented language.