Skip to content

This repo demonstrates using NX and PHP to build PHP libraries and packages.

Notifications You must be signed in to change notification settings

damienwebdev/demo-nx-php

Repository files navigation

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.

About

This repo demonstrates using NX and PHP to build PHP libraries and packages.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published