[Browser Run] Add pre-rendering tutorial#31209
Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
There was a problem hiding this comment.
2 issues need attention before merge.
- MEDIUM
src/content/docs/browser-run/how-to/pre-render-pages.mdx(lines 134–139): The catch block returns HTTP 400 for all errors, including upstream Browser Run failures. Upstream errors should return 502 or 503 so callers know to retry. - LOW
src/content/docs/browser-run/how-to/pre-render-pages.mdx: The numbered procedure sections should be wrapped in<Steps>to follow the procedures style guide.
Existing Browser Run how-to pages also omit <Steps>, but new content should follow the current style guide.
| } catch (error) { | ||
| return Response.json( | ||
| { error: error instanceof Error ? error.message : "Unknown error" }, | ||
| { status: 400 }, | ||
| ); | ||
| } |
There was a problem hiding this comment.
Return 502 for upstream Browser Run failures instead of 400:
| } catch (error) { | |
| return Response.json( | |
| { error: error instanceof Error ? error.message : "Unknown error" }, | |
| { status: 400 }, | |
| ); | |
| } | |
| } catch (error) { | |
| const message = error instanceof Error ? error.message : "Unknown error"; | |
| const status = message.startsWith("Browser Run failed") ? 502 : 400; | |
| return Response.json({ error: message }, { status }); | |
| } |
|
Completed the review on PR #31209. Labels applied: Summary of changes: This PR adds a new Browser Run tutorial ( Issues flagged:
Posted 1 inline suggestion via the review. No build-breakers or incorrect API usage were found — the |
|
Preview URL: https://8977989b.preview.developers.cloudflare.com Files with changes (up to 15)
|
Summary
Adds a Browser Run tutorial that shows how to use a Worker and the
/contentQuick Action to pre-render JavaScript-heavy pages for crawlers or integrations. The tutorial focuses on a minimal implementation with hostname validation and notes caching as a production improvement.Screenshots (optional)
Documentation checklist