Add tutorials for cloudflare workers with wrangler#3055
Conversation
fibibot
left a comment
There was a problem hiding this comment.
Thanks for the contribution. A few blockers before this can land:
- Line 85:
[esbuild tutorial](https://www.google.com/search?q=/examples/esbuild/)is a Google search URL — likely an LLM artifact. There's also no/examples/esbuild/page in this repo. Either link to a real internal page or drop the sentence. - The new page isn't registered in
examples/_data.ts. The existing CF tutorial sits at line 557 (/examples/cloudflare_workers_tutorial/); add a sibling entry for/examples/cloudflare_workers_wrangler_tutorial/so it shows in the sidebar. deno wrangler dev/deno wrangler types(tasks at lines 52–54) anddeno --allow-env --allow-run wrangler deploy(line 51) aren't valid invocations — Deno has nowranglersubcommand. Afterdeno add npm:wrangler, run it viadeno run -A npm:wrangler dev(or use the binary thatdeno installexposes). Please fix these so a reader runningdeno task devactually starts Wrangler.- Line 76:
satisfies ExportHandler<Env>— Cloudflare's exported type isExportedHandler<Env>(with the "ed"). Can you confirm this compiles against thecf-typegenoutput?
- nit:
devandstarttasks (lines 52–53) are duplicates — pick one. - nit: title doesn't follow
docs: ...lowercase format the repo uses, but maintainer can squash.
|
@fibibot |
fibibot
left a comment
There was a problem hiding this comment.
Thanks for confirming. The existing request-changes review still applies until a new commit updates the invalid Google link, the missing sidebar entry, the Wrangler command invocations, and ExportedHandler<Env> type; I’ll re-review the changed revision when it lands.
lunadogbot
left a comment
There was a problem hiding this comment.
Several examples on this page are not runnable yet, and the new tutorial is not wired into the examples navigation.
"dev": "deno wrangler dev"/"cf-typegen": "deno wrangler types"use a nonexistent Deno subcommand; on Deno 2.7.14 this resolveswrangleras a local file and exitsModule not found ".../wrangler". Usedeno run -A npm:wrangler ...or document thenode_modules/.binpath that makes the binary available.} satisfies ExportHandler<Env>;should beExportedHandler<Env>;cf-typegenemits Cloudflare'sExportedHandler, so the copied sample will not type-check as written.[esbuild tutorial](https://www.google.com/search?q=/examples/esbuild/)is a search URL, and there is no/examples/esbuild/page in this repo. Link to a real page or remove the sentence./examples/cloudflare_workers_wrangler_tutorial/is not added toexamples/_data.ts, so the page will not show in the examples sidebar next to the existing Cloudflare Workers tutorial.
fibibot
left a comment
There was a problem hiding this comment.
These blockers are still on the current head, so the previous request-changes review still applies.
"dev": "deno wrangler dev"/"cf-typegen": "deno wrangler types"are not valid Deno invocations. On Deno 2.7.14,deno wrangler --versionexits withModule not found ".../wrangler"; usedeno run -A npm:wrangler ...or a documented installed binary path.} satisfies ExportHandler<Env>;should be Cloudflare'sExportedHandler<Env>; otherwise the copied sample will not type-check against the generated worker types.[esbuild tutorial](https://www.google.com/search?q=/examples/esbuild/)is a Google search URL, and this repo has no/examples/esbuild/page. Link to a real page or remove the sentence./examples/cloudflare_workers_wrangler_tutorial/is not added toexamples/_data.ts, so the page is not discoverable in the examples sidebar.
fibibot
left a comment
There was a problem hiding this comment.
The new commit changed the head SHA, but the earlier runnable-sample and navigation blockers are still present.
"deploy": "deno --allow-env --allow-run wrangler deploy","dev": "deno wrangler dev", and"cf-typegen": "deno wrangler types"are not valid Deno task invocations;deno wranglerlooks for a localwranglermodule. Usedeno run -A npm:wrangler ...or document an installed binary path that exists after setup.} satisfies ExportHandler<Env>;should use Cloudflare'sExportedHandler<Env>, otherwise the sample will not type-check against the generated Worker types.[esbuild tutorial](https://www.google.com/search?q=/examples/esbuild/)is a Google search URL, and this repo has no/examples/esbuild/page. Link to a real page or remove the sentence./examples/cloudflare_workers_wrangler_tutorial/is still not added toexamples/_data.ts, so the new tutorial is not discoverable in the examples sidebar.
|
@fibibot Sorry for making confusion. I'm still on working on fixing those points and the SHA change was just a rebase to merge main branch. I'll notify you when fixed. Thank you! |
fibibot
left a comment
There was a problem hiding this comment.
Thanks for the update. Since this was only a rebase and you are still working through the fixes, the existing request-changes review remains the current action item; I will re-review after the next fixing commit.
Add a tutorial on deploying to Cloudflare Workers using wrangler.