GitHub
PHP 8 · Laravel 13 Pagelets render in parallel →

Pages that arrive
in pieces.

BigPipe sends the page at once and every part of it as soon as it is ready. Update the DOM, open dialogs and call JavaScript modules from PHP: an application that feels fast, without becoming a single-page app.

See it stream → Get started
$composer require richarddobron/bigpipePHP
$npm install bigpipe-utilbrowser
demo.test/app/dashboard 0 ms
RevenuePagelet
ActivityPagelet
ReportPagelet
layout30 ms
revenue600 ms
activity900 ms
report1200 ms
How it works

Stop waiting for the slowest query to show anything.

The dashboard of this demo has three parts that call slow APIs. Rendered the usual way, the browser gets nothing until all of them are done. With BigPipe the layout is flushed first and the parts are rendered at the same time.

A regular response

one after another
revenue600 ms
activity900 ms
report1200 ms
layout2.7 s
2.7 suntil the first pixel
2.7 suntil it is complete
app/Pagelets/RevenuePagelet.php
class RevenuePagelet extends Pagelet
{
    protected mixed $fallback = 'Revenue is not available right now.';

    protected function content(): string
    {
        // A slow API: waiting here does not hold up the other pagelets.
        $orders = $this->api->orders();

        // Call a JavaScript module once the pagelet is on the page.
        $this->call('Dashboard/Chart', 'draw', [$orders->daily()]);

        return view('dashboard._revenue', ['total' => $orders->total()])->render();
    }
}

Pagelets

Independent parts with their own CSS, JavaScript and a fallback when they fail.

Lazy pagelets

Load a part when it becomes visible, and infinite scroll.

Async responses

Links and forms that set, append, replace or remove content by a selector.

Dialogs

Open, stack and close dialogs from the server.

Page transitions

Load the next page into the layout instead of in full.

Poller & bootloader

Polling the server controls, and modules loaded only when called.

Tutorials

Learn it one feature at a time.

Every tutorial is a working example with its code, and a panel that shows what the server sent back. Page transitions, infinite scroll and uploads are in the demo app below.

Demo app

Recipes for a real application.

A blog and a shop built the way an application is, with a database, validation, tests and expired sessions. Every page is a page transition.