github zoonru/puphpeteer v3.0.0-beta1

pre-release7 hours ago

v3.0.0-beta1

Puphpeteer v3 replaces the Rialto/Node.js bridge with Puppeteer running inside PHP through QuickJS. Node.js is no longer required at runtime.

Highlights

  • Native PHP concurrency with Amp: v3 introduces asynchronous execution through Amp\async(), allowing multiple Puppeteer operations and PHP callbacks to run concurrently without manually starting an event loop. By default all operations automatically awaited, so php code looks the same.
  • Reduced CPU and RAM overhead: due to absence of proxy node.js process.
  • Broader API support: locators, static methods, writable properties, PHP callbacks and event handlers.
  • Plugin support: bundled stealth plugin and build-time registration of custom plugins.
  • PHP browser installer: installs the pinned Chrome version into the application's .chrome directory, with environment variables for cache paths and skipping downloads.
  • Docker environments: base and Chrome images, plus Browserless support.

Breaking changes

Requires PHP 8.4+ and the [php-quickjs fork](https://github.com/xtrime-ru/php-quickjs).

Update these imports:

// v2
use Nesk\Puphpeteer\Puppeteer;
use Nesk\Puphpeteer\Resources\Page;
use Nesk\Rialto\Data\JsFunction;

// v3
use Nesk\Puphpeteer\Puppeteer\Puppeteer;
use Nesk\Puphpeteer\Puppeteer\Page;
use Nesk\Puphpeteer\JsFunction;
  • Legacy Nesk\Puphpeteer\Resources\… aliases remain available on a best-effort basis.
  • tryCatch was removed. Methods throw exceptions directly; catch RuntimeException.
  • Node.js-specific options and js_extra are rejected. Use plugin configuration instead.
  • JsFunction now accepts JavaScript source. Legacy static factories and fluent configuration remain supported.
  • Browser installation is separate from launch(). Composer does not automatically execute installation scripts belonging to dependencies.

See the README’s Upgrade from v2 section for migration examples.

Installation

After installing the required PHP extension:

composer require zoon/puphpeteer:3.0.0-beta1
php vendor/bin/console browser:install

Skip browser installation when connecting to Browserless or using an existing Chrome executable.

Known limitations

This beta supports Chrome over CDP. Firefox, pipe transport, Node.js writable streams, symbol-based API members and followSymlinks: false are not supported.

Full Changelog: v2.4.3...v3.0.0-beta1

Don't miss a new puphpeteer release

NewReleases is sending notifications on new releases.