Written by Brent on January 22, 2025 — Back
It took a bit longer than anticipated, but Tempest alpha 5 is out. This release gets us an important step closer towards Tempest 1.0: support for PHP 8.4! Apart from that, Enzo has made a significant effort to improve our console component, and many, many other things have been added, fixed, and changed; this time by a total of 14 contributors.
Let's take a look!
composer require tempest/framework:1.0-alpha.5
The main goal of this alpha release was to lay the groundwork for PHP 8.4 support. We've updated many of our interfaces to use property hooks instead of methods, which is a pretty big breaking change, but also feels very liberating. No more boring boilerplate getters!
interface Request { public Method $method { get; } public string $uri { get; } // … }
Supporting PHP 8.4 as the minimum has been a goal for Tempest from the start. While it's a bit annoying to deal with at the moment, I believe it'll be good for the framework in the long run.
Besides property hooks, we now also use PHP's new DOM parser for tempest/view
, instead replying on third-party userland implementations. Most likely, we'll have to update a lot more 8.4-related tidbits, but the work up until this point has been very productive. Most importantly: all interfaces that should use property hooks now do, which I think is a huge win.
Something we noticed while upgrading to PHP 8.4: the biggest pain point for us isn't PHP itself, it's the QA tools that don't support PHP 8.4 from the get-go: Tempest relies on PHPStan, Rector, and PHP CS Fixer, and all these tools needed at least weeks after the PHP 8.4 release to have support for it. PHP CS Fixer, in fact, currently still doesn't support 8.4: running CS Fixer on an 8.4 codebase results in broken PHP files. PHP 8.4 specific feature support will, most likely, have to wait a lot longer.
This is by no means a critique on those open source tools, rather it's a call for help from the PHP community: so much of our code and projects (of the PHP community as a whole) relies on a handful of crucial QA tools, we should make sure there are enough resources (time and/or money) to make sure these tools can thrive.
Apart from PHP 8.4, what I'm most excited about in this release are the features that Enzo worked on for weeks on end: he has made a tremendous effort to improve tempest/console
, both from the UX side, the styling perspective, and architecturally.
~ php tempest // TEMPEST This is an overview of available commands. Type <command> --help to get more help about a specific command. // GENERAL install Applies the specified installer routes Lists all registered routes serve Starts a PHP development server tail Tail multiple logs // CACHE cache:clear Clears all or specified caches cache:status Shows which caches are enabled // …
Besides many awesome UX changes — you should play around with them yourself to get a proper idea of what they are about — Enzo also reworked many of the internals. For example, you can now pass enums into the ask component:
$this->console->ask( question: 'Pick a value', options: MyEnum::class, default: MyEnum::OTHER, );
│ Pick one or more │ / Filter... │ → Foo │ Bar │ Baz │ Other (default)
There's a new key/value component:
$this->console->keyValue('Hello', 'World');
Hello ....................................................... World
And finally, the task component:
$this->console->task('Working', fn () => sleep(1));
Of course, there's also a non-interactive version of the task component:
~ php tempest test --no-interaction Step 1 ........................................ 2025-02-22 06:07:36 Step 1 ....................................................... DONE Step 2 ........................................ 2025-02-22 06:07:37 Step 2 ....................................................... DONE
I'm really excited to see how tempest/console
is growing. For sure there are a lot of details to fine-tune, but it's going to be a great alternative to existing console frameworks. If you didn't know, by the way, tempest/console
can be installed on its own in any project you want, not just Tempest projects. You can learn more about it here.
tempest/view
An important part of Tempest's vision is to think outside the box. One of the results of that outside-box-thinking is a new templating engine for PHP. I'm of course biased, but I really like how tempest/view
leans much closer to HTML than other PHP templating engines. I would say that tempest/view
's goal is to make PHP templating more like HTML — the OG templating language — instead of the other way around.
Here's a short snippet of what tempest/view
looks like:
<x-base title="Home"> <x-post :foreach="$this->posts as $post"> {!! $post->title !!} <span :if="$this->showDate($post)"> {{ $post->date }} </span> <span :else> - </span> </x-post> <div :forelse> <p>It's quite empty here…</p> </div> <x-footer /> </x-base>
While this alpha release brings a bunch of small improvements and bugfixes, I'm most excited about something that's still upcoming: only recently, I've sat down with a colleague developer advocate at JetBrains, and we decided to work together on IDE support for tempest/view
. This is huge, since a templating language is only as good as the support it has in your IDE: autocompletion, code insights, file references, … We're going to make all of that happen. It's a project that will take a couple of months, but I'm looking forward to see where it leads us!
Tempest now comes with optional Vite support. Simply run php tempest install
, choose vite
, and Tempest will take care of setting up your frontend stack for you:
I've shared the three main highlights of this release, but there have been a lot more features and fixes over the past two months, just to name a few:
make:
commandsstatic:clean
now also clears empty directoriesDespite this release taking a bit longer than anticipated, I'm super happy and proud of what the Tempest community has achieved. Let's continue the work, I'm so looking forward to Tempest 1.0!
I wanted to share some clarification why alpha 5 took longer to release. Mainly, it had to do with a number of real-life things: I went to some conferences, I got really sick with the flu, then my kids got really sick with the flu, and then I've been unfortunately dealing with severe heating problems in my house. There's lots of damage and costs, and insurance/the people involved still need to figure out who has to pay.
All of that lead to little time and energy to work on Tempest. I was really moved to see so many people still keeping up the work on Tempest, even though I had been rather unresponsive for a month or more. So here's hoping for a very productive Spring season! Thank you everyone who contributes!