Skip to content

Conversation

@korinne
Copy link
Contributor

@korinne korinne commented Dec 12, 2024

Summary

This PR adds a migration guide for moving from Wrangler v3 to Wrangler v4 and updates the Wrangler docs to reflect Wrangler v4

@korinne korinne requested a review from penalosa December 12, 2024 22:47
@korinne korinne changed the title Wrangler v4 migration Wrangler v4 migration guide Dec 12, 2024
@github-actions github-actions bot added product:workers Related to Workers product size/s labels Dec 12, 2024
Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 1 total issue(s) found.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 12, 2024

Deploying cloudflare-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1439676
Status: ✅  Deploy successful!
Preview URL: https://49174f61.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://wrangler-v4-migration.cloudflare-docs-7ou.pages.dev

View logs


* **Commands default to local mode**: All commands now run in local mode by default, requiring a `--remote` flag for API queries,

* **Changes to KV command output formats**: `wrangler kv list` now outputs data in a format compatible with `wrangler kv bulk delete.`
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove this

Comment on lines 11 to 12
* **Updated Node.js Support Policy:**
Node.js v16, which reached End-of-Life in 2022, is no longer supported in Wrangler v4. Wrangler now follows Node.js's [official support lifecycle](https://nodejs.org/en/about/previous-releases).
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be slightly reworded to make it clear it refers to the versions of Node you can run Wrangler in rather than the version of Node that Wrangler supports (which to me potentially implies that it'd work in a Worker)?

@penalosa penalosa force-pushed the wrangler-v4-migration branch from 1439676 to 1dca406 Compare March 11, 2025 14:00
@hyperlint-ai
Copy link
Contributor

hyperlint-ai bot commented Mar 11, 2025

Howdy and thanks for contributing to our repo. The Cloudflare team reviews new, external PRs within two (2) weeks. If it's been two weeks or longer without any movement, please tag the PR Assignees in a comment.

We review internal PRs within 1 week. If it's something urgent or has been sitting without a comment, start a thread in the Developer Docs space internally.


PR Change Summary

Added a migration guide for transitioning from Wrangler v3 to v4, detailing significant changes and necessary steps for users.

  • Introduced a migration guide draft for Wrangler v4.
  • Updated Node.js support policy to align with official lifecycle.
  • Upgraded esbuild version and its impact on dynamic imports.
  • Changed default command behavior to local mode.

Modified Files

  • src/content/docs/pages/functions/typescript.mdx
  • src/content/docs/workers/languages/javascript/index.mdx
  • src/content/docs/workers/languages/typescript/index.mdx
  • src/content/docs/workers/wrangler/commands.mdx
  • src/content/docs/workers/wrangler/migration/update-v2-to-v3.mdx
  • src/content/docs/workers/wrangler/migration/v1-to-v2/index.mdx

Added Files

  • src/content/docs/workers/wrangler/migration/update-v3-to-v4.mdx
  • src/content/partials/workers/wrangler-commands/runtime-types.mdx

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

What is Hyperlint?

Hyperlint is an AI agent that helps you write, edit, and maintain your documentation.

Learn more about the Hyperlint AI reviewer and the checks that we can run on your documentation.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2025

Preview URL: https://346dce1d.preview.developers.cloudflare.com
Preview Branch URL: https://wrangler-v4-migration.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/workers/languages/typescript/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/languages/typescript/
https://developers.cloudflare.com/workers/wrangler/commands/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/wrangler/commands/
https://developers.cloudflare.com/workers/wrangler/migration/update-v3-to-v4/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/wrangler/migration/update-v3-to-v4/
https://developers.cloudflare.com/pages/functions/typescript/ https://wrangler-v4-migration.preview.developers.cloudflare.com/pages/functions/typescript/
https://developers.cloudflare.com/changelog/2025-03-13-wrangler-v4/ https://wrangler-v4-migration.preview.developers.cloudflare.com/changelog/2025-03-13-wrangler-v4/
https://developers.cloudflare.com/workers/wrangler/configuration/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/wrangler/configuration/
https://developers.cloudflare.com/workers/wrangler/install-and-update/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/wrangler/install-and-update/
https://developers.cloudflare.com/workers/wrangler/deprecations/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/wrangler/deprecations/
https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/configuration/multipart-upload-metadata/
https://developers.cloudflare.com/pages/framework-guides/deploy-a-hono-site/ https://wrangler-v4-migration.preview.developers.cloudflare.com/pages/framework-guides/deploy-a-hono-site/
https://developers.cloudflare.com/workers/observability/logs/logpush/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/observability/logs/logpush/
https://developers.cloudflare.com/workers/observability/logs/workers-logs/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/observability/logs/workers-logs/
https://developers.cloudflare.com/workers/tutorials/github-sms-notifications-using-twilio/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/tutorials/github-sms-notifications-using-twilio/
https://developers.cloudflare.com/workers/wrangler/migration/update-v2-to-v3/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/wrangler/migration/update-v2-to-v3/
https://developers.cloudflare.com/workers/wrangler/migration/v1-to-v2/ https://wrangler-v4-migration.preview.developers.cloudflare.com/workers/wrangler/migration/v1-to-v2/

Comment on lines +14 to +21
### Workers Sites

Usage of [Workers Sites](/workers/wrangler/configuration/#workers-sites) is deprecated. Instead, we recommend migrating to [Workers Static Assets](/workers/static-assets/). Support for using Workers Sites with Wrangler will be removed in a future version of Wrangler.

### Service environments

Usage of [Service Environments](https://blog.cloudflare.com/introducing-worker-services/#services-have-environments), enabled via the `legacy_env` property in Wrangler config, is deprecated. Instead, we recommend migrating to [Wrangler Environments](/workers/wrangler/configuration/#environments). Support for using Service Environments with Wrangler will be removed in a future version of Wrangler.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just thought I'd add these here so that we have somewhere to point to when we say they're deprecated. Both of these have been deprecated for a long time.

@penalosa penalosa marked this pull request as ready for review March 11, 2025 16:16
@penalosa penalosa requested review from a team, ToriLindsay and irvinebroque as code owners March 11, 2025 16:16
- Control the types that Wrangler generates for `vars` bindings.
- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myEnv: 'my dev variable' | 'my prod variable'`).
- If `false`, Wrangler generates generic types (e.g. `myEnv: string`). This is useful when variables change frequently, especially when working across multiple environments.
- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myVar: 'my dev variable' | 'my prod variable'`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Identified issues

  • Vale Style Guide - (cloudflare.LatinTerms-warning) Use 'for example' instead of 'e.g.', but consider rewriting the sentence.

Proposed fix

Suggested change
- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myVar: 'my dev variable' | 'my prod variable'`).
- If `true`, (the default) Wrangler generates literal and union types for bindings (for example, `myVar: 'my dev variable' | 'my prod variable'`).

I replaced 'e.g.' with 'for example' as it was not within a code reference or backticks, complying with the style guide.

- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myEnv: 'my dev variable' | 'my prod variable'`).
- If `false`, Wrangler generates generic types (e.g. `myEnv: string`). This is useful when variables change frequently, especially when working across multiple environments.
- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myVar: 'my dev variable' | 'my prod variable'`).
- If `false`, Wrangler generates generic types (e.g. `myVar: string`). This is useful when variables change frequently, especially when working across multiple environments.
Copy link
Contributor

Choose a reason for hiding this comment

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

Identified issues

  • Vale Style Guide - (cloudflare.LatinTerms-warning) Use 'for example' instead of 'e.g.', but consider rewriting the sentence.

Proposed fix

Suggested change
- If `false`, Wrangler generates generic types (e.g. `myVar: string`). This is useful when variables change frequently, especially when working across multiple environments.
- If `false`, Wrangler generates generic types (for example, `myVar: string`). This is useful when variables change frequently, especially when working across multiple environments.

I replaced 'e.g.' with 'for example' to comply with the style guide. The change was straightforward as 'e.g.' was not within any restricted formatting.

- Control the types that Wrangler generates for `vars` bindings.
- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myEnv: 'my dev variable' | 'my prod variable'`).
- If `false`, Wrangler generates generic types (e.g. `myEnv: string`). This is useful when variables change frequently, especially when working across multiple environments.
- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myVar: 'my dev variable' | 'my prod variable'`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Identified issues

  • Vale Style Guide - (cloudflare.LatinTerms-warning) Use 'for example' instead of 'e.g.', but consider rewriting the sentence.

Proposed fix

Suggested change
- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myVar: 'my dev variable' | 'my prod variable'`).
- If `true`, (the default) Wrangler generates literal and union types for bindings (for example, `myVar: 'my dev variable' | 'my prod variable'`).

I replaced 'e.g.' with 'for example' as it was not within a code reference or backticks, complying with the style guide.

- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myEnv: 'my dev variable' | 'my prod variable'`).
- If `false`, Wrangler generates generic types (e.g. `myEnv: string`). This is useful when variables change frequently, especially when working across multiple environments.
- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myVar: 'my dev variable' | 'my prod variable'`).
- If `false`, Wrangler generates generic types (e.g. `myVar: string`). This is useful when variables change frequently, especially when working across multiple environments.
Copy link
Contributor

Choose a reason for hiding this comment

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

Identified issues

  • Vale Style Guide - (cloudflare.LatinTerms-warning) Use 'for example' instead of 'e.g.', but consider rewriting the sentence.

Proposed fix

Suggested change
- If `false`, Wrangler generates generic types (e.g. `myVar: string`). This is useful when variables change frequently, especially when working across multiple environments.
- If `false`, Wrangler generates generic types (for example, `myVar: string`). This is useful when variables change frequently, especially when working across multiple environments.

I replaced 'e.g.' with 'for example' to comply with the style guide. The change was straightforward as 'e.g.' was not within any restricted formatting.

@penalosa penalosa enabled auto-merge (squash) March 13, 2025 11:06
@penalosa penalosa merged commit b4ab88e into production Mar 13, 2025
11 checks passed
@penalosa penalosa deleted the wrangler-v4-migration branch March 13, 2025 11:08
elithrar pushed a commit that referenced this pull request Mar 14, 2025
* adds migration guide draft for Wrangler v4

* Fixes typos and reorders migration docs to start with v4

* Update src/content/docs/workers/wrangler/migration/update-v3-to-v4.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>

* Update src/content/docs/workers/wrangler/migration/update-v3-to-v4.mdx

Co-authored-by: Somhairle MacLeòid <[email protected]>

* Update src/content/docs/workers/wrangler/migration/update-v3-to-v4.mdx

Co-authored-by: Somhairle MacLeòid <[email protected]>

* update `wrangler types` runtime type gen instructions

* Remove @types/node known issue

* WIP

* more docs

* typo

* Add changelog

* Apply suggestions from code review

Co-authored-by: lrapoport-cf <[email protected]>
Co-authored-by: emily-shen <[email protected]>

* more removed deprecations

* Apply suggestions from code review

Co-authored-by: lrapoport-cf <[email protected]>

* Update src/content/changelog/workers/2025-03-13-wrangler-v4.mdx

---------

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
Co-authored-by: Somhairle MacLeòid <[email protected]>
Co-authored-by: emily-shen <[email protected]>
Co-authored-by: lrapoport-cf <[email protected]>
RebeccaTamachiro pushed a commit that referenced this pull request Apr 21, 2025
* adds migration guide draft for Wrangler v4

* Fixes typos and reorders migration docs to start with v4

* Update src/content/docs/workers/wrangler/migration/update-v3-to-v4.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>

* Update src/content/docs/workers/wrangler/migration/update-v3-to-v4.mdx

Co-authored-by: Somhairle MacLeòid <[email protected]>

* Update src/content/docs/workers/wrangler/migration/update-v3-to-v4.mdx

Co-authored-by: Somhairle MacLeòid <[email protected]>

* update `wrangler types` runtime type gen instructions

* Remove @types/node known issue

* WIP

* more docs

* typo

* Add changelog

* Apply suggestions from code review

Co-authored-by: lrapoport-cf <[email protected]>
Co-authored-by: emily-shen <[email protected]>

* more removed deprecations

* Apply suggestions from code review

Co-authored-by: lrapoport-cf <[email protected]>

* Update src/content/changelog/workers/2025-03-13-wrangler-v4.mdx

---------

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
Co-authored-by: Somhairle MacLeòid <[email protected]>
Co-authored-by: emily-shen <[email protected]>
Co-authored-by: lrapoport-cf <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants