Uncomment bad examples, cross-link guides#28323
Conversation
…k related guides Show bad code examples as real code (matching DO/Workflows style) instead of commented-out blocks. Each bad example uses a const handler pattern so it remains valid TypeScript while clearly labeled with 🔴 Bad. Also adds Related resources cross-links between Workers Best Practices, Rules of Durable Objects, and Rules of Workflows so users can discover all three guides.
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
src/content/docs/durable-objects/best-practices/rules-of-durable-objects.mdx
Outdated
Show resolved
Hide resolved
|
Done. Here is a summary of what was fixed and reviewed: Changes madeFixed indentation across all 30 code examples in
Both issues are now fixed — all code examples use consistent tab indentation matching the repository's style. TypeScript reviewAll 30 code examples were reviewed for correctness. No TypeScript issues found. All examples use correct:
Validation
|
|
I've reviewed - this is mostly style. Code format changes did not break the examples. |
Here is a summary of all changes:
Workers Best Practices (
workers-best-practices.mdx)Uncommented 9 bad code examples — each now shows real, runnable TypeScript instead of commented-out code. The bad examples use a
const badHandler = { ... } satisfies ExportedHandler<Env>pattern so they are valid TypeScript while clearly labeled with// 🔴 Bad:badHandlerctxexample is now a realbadHandlerbadHandlerbadHandlerlet currentUser+badHandlershown as real codefetch()call is now uncommentedMath.random()token is now assigned tobadToken===comparison is now a realverifyTokenInsecurefunctionpassThroughOnException()call is now a realbadHandlerconsole.logis now a realbadHandlerCross-links added
Validation
npm run checkpasses with 0 errors and 0 warnings.Closes #28322
github run