playwright-go icon indicating copy to clipboard operation
playwright-go copied to clipboard

Feature Request: Support Bun runtime as an alternative to Node.js

Open joeblew999 opened this issue 2 months ago • 1 comments

Title

Feature Request: Support Bun runtime as an alternative to Node.js

Description

Add support for using Bun as the JavaScript runtime instead of Node.js for the Playwright driver. Bun offers significant performance improvements that would benefit playwright-go users.

Motivation

Performance Benefits:

Faster startup time: Bun starts ~4x faster than Node.js Lower memory footprint: Bun uses less memory than Node.js Better subprocess performance: Relevant for the stdio bridge architecture Native TypeScript support: No transpilation overhead

Developer Experience:

Bun is increasingly popular in the JavaScript ecosystem Many developers already have Bun installed Simpler dependency management with Bun's built-in package manager

Current Architecture

As I understand from the codebase, playwright-go uses a Node.js runtime with Playwright that communicates over stdio. The ~50MB bundle includes Node.js + Playwright driver. Proposed Changes

Make it configurable:

gopw, err := playwright.Run(&playwright.RunOptions{
    Runtime: "bun", // or "node" (default)
})

Thank you for maintaining this excellent project! 🎭

joeblew999 avatar Nov 05 '25 01:11 joeblew999

https://github.com/microsoft/playwright/issues/38121

canstand avatar Nov 06 '25 01:11 canstand