Skip to content

BP reference update (first draft)#413

Draft
codingfrog27 wants to merge 1 commit into
mainfrom
Browserpod-reference-updates
Draft

BP reference update (first draft)#413
codingfrog27 wants to merge 1 commit into
mainfrom
Browserpod-reference-updates

Conversation

@codingfrog27
Copy link
Copy Markdown
Contributor

No description provided.

Co-authored-by: Copilot <copilot@github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying labs-browserpod-previews with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6b8ce2c
Status: ✅  Deploy successful!
Preview URL: https://8433ebbb.labs-browserpod-previews.pages.dev
Branch Preview URL: https://browserpod-reference-updates.labs-browserpod-previews.pages.dev

View logs

- **nodeVersion (`string`, _optional_)** - The version of node to use. Currently only "22" is allowed.
- **nodeVersion (`string`, _optional_)** - The version of Node.js to use. Currently only "22" is allowed.
- **storageKey (`string`, _optional_)** - An arbitrary string used to support multiple pods on the same origin or multiple tabs in parallel. For example, `boot({ apiKey: "...", storageKey: "vite" })` and `boot({ apiKey: "...", storageKey: "app-12345" })` allocate two completely independent disks.
- **userImage (`string`, _optional_)** - A URL pointing to a custom WebAssembly binary to load into the pod environment. When specified, this WebAssembly module will be loaded and made available within the pod instead of using the default environment.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a WebAssembly binary, it's an ext2 image.

@@ -0,0 +1,22 @@
---
title: onOpen
description: Set up a callback that will be invoked when a file or resource is opened in the pod
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file or URL

Please also clarify that this maps to the use of xdg-open utility.

@GabrielaReyna GabrielaReyna changed the title first draft BP reference update (first draft) May 18, 2026
Copy link
Copy Markdown
Contributor

@GabrielaReyna GabrielaReyna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job documenting these!

In addition to my comments on the code, I will add some bullet points as to-do's:

  • Please document Terminal and Process, even if they are opaque or minimalistic. Please sync with Yuri and Alessandro for any questions. These are first-class, so they go at the same level as BinaryFile, TextFile etc.
  • Please add links where Terminal and Process are mentioned in the text, referring to their documented page.
  • There is a nice explanatory page for BinaryFile, this is a good chance to do something similar for BrowserPod in the reference, given an instance of BrowserPod we call it a "Pod" and it can be confusing for some users. This is an opportunity to link to this page when we call it like so.

@@ -0,0 +1,22 @@
---
title: onOpen
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's sort the reference in alphabetical order, or any other order that makes sense. For example, onPortal and onOpen are far apart in the API list, and both setup a callback. The same for the "create" APIs


## Parameters

- **opts (object)** - Terminal configuration options passed as an object.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **opts (object)** - Terminal configuration options passed as an object.
- **opts (_object_)** - Terminal configuration options passed as an object.


- **cols (`number`, _optional_)** - The number of columns (width) for the terminal display. If not specified, a default width will be used.
- **rows (`number`, _optional_)** - The number of rows (height) for the terminal display. If not specified, a default height will be used.
- **onOutput** (`function(buffer: Uint8Array | ArrayBuffer, vt?: unknown) => void`) - Callback function invoked whenever the terminal produces output. The buffer contains the raw terminal data, and vt contains optional VT escape sequence information.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **onOutput** (`function(buffer: Uint8Array | ArrayBuffer, vt?: unknown) => void`) - Callback function invoked whenever the terminal produces output. The buffer contains the raw terminal data, and vt contains optional VT escape sequence information.
- **onOutput (`function(buffer: Uint8Array | ArrayBuffer, vt?: unknown) => void`)** - Callback function invoked whenever the terminal produces output. The buffer contains the raw terminal data, and vt contains optional VT escape sequence information.


## Returns

`createCustomTerminal` returns a [Promise] which is resolved when the terminal has been created successfully. The promise resolves to a `Terminal` object that can be used to interact with the custom terminal.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please link Terminal to its page once documented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants