Repository navigation
Commit ff88bad
[Docs] add go snippets to reference pages (#2667)
# why
Missing go snippets in the reference files. Also adding the vitest
change so this is prevented in the future
# what changed
# test plan
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds Go snippets to the missing v4 reference pages, adds a dedicated
WebMCP reference, and exports public v4 TypeScript types. Tightens the
`vitest` docs checker to keep TypeScript, Python, and Go in sync, and
clarifies key defaults and options across the docs. Completes Linear
STG-2801 by adding Go to `locator`, `page`, `context`, `stagehand`, and
`clipboard`.
- New Features
- Added Go tabs with quick starts and API examples to the pages above;
examples include `defer` cleanup and `Page.URL()`. Clarified Go locator
scoping and types: use `*PageLocator` for `Locator`/`IgnoreLocators`;
CSS/XPath only for `observe`/`extract` snapshot scoping (no `text=`
yet).
- Documented `Stagehand.ExperimentalBatch` for Go, including worker
execution model, passing JSON input, page targeting via options, and
timeouts.
- Added a new WebMCP reference (`/v4/reference/webmcp`), linked it from
the WebMCP basics page, and added it to navigation.
- Exported public v4 TypeScript reference types from the SDK (e.g.,
`LocatorClickOptions`, `PageReloadOptions`, `LoadState`, `Caching`) and
added contract tests to verify consumers can import them.
- Strengthened the `vitest` checker: parses Go, validates shared SDK
surface and exact headings/params, enforces one TypeScript/Python/Go tab
per page, flags missing snippets, verifies Go `ParamField` types
(including nested fields) match exported struct fields, and enforces
docs coverage for exported public types.
- Clarified docs: `LoadState` allowed values and defaults,
`context.addInitScript` accepts function/string or `{ path | content }`,
cookie `expires` semantics (`-1` for session), and updated WebMCP links
into Page tools and WebMCP API cards.
- Bug Fixes
- Corrected Go docs for `Response.HeaderValue()` to show `(string, bool,
error)` and clarified header lookup behavior.
- Formatted Go `Clipboard.Paste` shortcut options for readability.
<sup>Written for commit 761afa9.
Summary will update on new commits.</sup>
<a
href="https://cubic.dev/pr/browserbase/stagehand/pull/2667?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by: Sean McGuire <seanmcguire1@outlook.com>1 parent 693e2ea commit ff88bad
14 files changed
Lines changed: 3943 additions & 139 deletions
File tree
- packages
- docs
- tests
- v4
- basics
- reference
- sdk-ts
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
0 commit comments