Skip to content

Add tutorials for cloudflare workers with wrangler#3055

Open
Tsukina-7mochi wants to merge 1 commit into
denoland:mainfrom
Tsukina-7mochi:main
Open

Add tutorials for cloudflare workers with wrangler#3055
Tsukina-7mochi wants to merge 1 commit into
denoland:mainfrom
Tsukina-7mochi:main

Conversation

@Tsukina-7mochi
Copy link
Copy Markdown

Add a tutorial on deploying to Cloudflare Workers using wrangler.

Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. A few blockers before this can land:

  1. 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.
  2. 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.
  3. deno wrangler dev / deno wrangler types (tasks at lines 52–54) and deno --allow-env --allow-run wrangler deploy (line 51) aren't valid invocations — Deno has no wrangler subcommand. After deno add npm:wrangler, run it via deno run -A npm:wrangler dev (or use the binary that deno install exposes). Please fix these so a reader running deno task dev actually starts Wrangler.
  4. Line 76: satisfies ExportHandler<Env> — Cloudflare's exported type is ExportedHandler<Env> (with the "ed"). Can you confirm this compiles against the cf-typegen output?
  • nit: dev and start tasks (lines 52–53) are duplicates — pick one.
  • nit: title doesn't follow docs: ... lowercase format the repo uses, but maintainer can squash.

@Tsukina-7mochi
Copy link
Copy Markdown
Author

@fibibot
Thank you for taking the time to review this! I am very sorry that some paragraphs were overlooked during the process of translating my text into English.
I will request another review after making corrections based on the other points you mentioned. I am sorry, and thank you!

Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@lunadogbot lunadogbot left a comment

Choose a reason for hiding this comment

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

Several examples on this page are not runnable yet, and the new tutorial is not wired into the examples navigation.

  1. "dev": "deno wrangler dev" / "cf-typegen": "deno wrangler types" use a nonexistent Deno subcommand; on Deno 2.7.14 this resolves wrangler as a local file and exits Module not found ".../wrangler". Use deno run -A npm:wrangler ... or document the node_modules/.bin path that makes the binary available.
  2. } satisfies ExportHandler<Env>; should be ExportedHandler<Env>; cf-typegen emits Cloudflare's ExportedHandler, so the copied sample will not type-check as written.
  3. [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.
  4. /examples/cloudflare_workers_wrangler_tutorial/ is not added to examples/_data.ts, so the page will not show in the examples sidebar next to the existing Cloudflare Workers tutorial.

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