- What is nesk/rialto and what does it do?
- Rialto is a PHP package that builds a bidirectional bridge between PHP and Node.js. PHP spawns a Node.js child process and exchanges messages over stdio using Rialto's own framing protocol, letting PHP call Node resources synchronously. It powers PuPHPeteer and works with custom Node.js processes, but it is not a conventional Laravel package.
- How do I install nesk/rialto in a Laravel application?
- Install it with Composer, then provide a Node bridge script plus a compatible Node.js runtime and the npm dependencies that script requires. There is no service provider, facade, or config file, so you must wire it into your application manually. In Laravel, wrap it behind your own contract or singleton so application code never touches Rialto types directly.
- Does nesk/rialto support Laravel 10 or Laravel 11?
- Rialto has no Laravel integration layer, so it has no Laravel version constraints or official support matrix. It is a plain PHP library and can be autoloaded in any Laravel version that runs a compatible PHP version. However, the package is archived, so PHP and Laravel compatibility with newer releases is not maintained upstream.
- How does Rialto call Node.js functions from PHP?
- A PHP process starts a Node.js child process, and both sides communicate over the child's stdio pipes using Rialto's framing protocol. Node-side modules or functions are registered as resources that PHP can invoke through a simple synchronous API. The bridge is orthogonal to Laravel's container, config, and queue systems.
- Is nesk/rialto safe to use in production?
- It carries high technical risk because the package is archived and has no security patches, bug fixes, or upstream issue triage. The subprocess-plus-pipe design has a wide failure surface including Node crashes, protocol desynchronization, console output polluting the channel, hung promises, and orphaned child processes. Use it only behind your own adapter, with pinned Node and npm dependencies, strict timeouts, and no untrusted input influencing which Node resource is loaded.
- Can I use Rialto with Laravel Octane or Swoole?
- Rialto was not designed for long-lived PHP workers, and sharing a Rialto child process under Octane or Swoole creates cross-request state and concurrency hazards. The library does not address worker reuse, request isolation, or shutdown semantics for those runtimes. If you must use it, manage process lifecycle per request or isolate the bridge outside the web worker.
- What are alternatives to nesk/rialto for PHP and Node.js integration?
- Depending on the goal, you can call a Node microservice over HTTP or a queue, use symfony/process to run a Node CLI script, or replace the Node-only capability with a native PHP library. For browser automation specifically, PuPHPeteer depends on Rialto, but a maintained service boundary is usually safer. Wrapping Rialto behind your own interface lets you swap implementations later.
- Is nesk/rialto still maintained?
- No, the package is archived, so there are no bug fixes, compatibility updates, security patches, or issue triage. Adopting it means forking or vendoring it and taking ownership of maintenance. Treat it as a throwaway spike or an implementation detail you can replace, not as long-term infrastructure.
- How do I test a Laravel feature that uses Rialto?
- Because Rialto spawns a real Node.js child process, unit tests should mock your own NodeBridge or JsRenderer contract rather than Rialto itself. Integration tests need a Node.js runtime and the bridge script's npm dependencies available in CI. Also test failure paths such as Node crashes, timeouts, and malformed protocol messages.
- What deployment requirements does Rialto add to a Laravel app?
- Every environment that serves the feature needs a compatible Node.js runtime plus the npm dependencies required by the bridge script, including local development, CI, staging, production containers, and every FPM host. Your deployment artifact becomes a polyglot image, and your build pipeline needs npm lockfile handling. Pin Node and npm versions and bake them into the image.