Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrangler v4 #7334

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Wrangler v4 #7334

wants to merge 23 commits into from

Conversation

penalosa
Copy link
Contributor

@penalosa penalosa commented Nov 25, 2024

Wrangler v4 is coming! We’re releasing this release candidate now as a way for you to check the upcoming version works with your projects. More detailed migration guides & documentation will be coming over the next few months as we prepare to roll this out, but a TLDR of the breaking changes to expect are:

  • Node v18 is now the minimum Node version
  • Wrangler now uses esbuild v0.24.2
  • wrangler r2 and wrangler kv are --local by default
  • All deprecated commands & config have been removed

To try it out, install and use wrangler@next.

Let us know what you think! We'd love to hear any feedback, either as comments on this PR or in the #wrangler channel on Discord.

@penalosa penalosa requested a review from a team as a code owner November 25, 2024 16:26
Copy link

changeset-bot bot commented Nov 25, 2024

🦋 Changeset detected

Latest commit: f6ca096

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
wrangler Major
miniflare Major
@cloudflare/vitest-pool-workers Minor
@cloudflare/pages-shared Patch
@cloudflare/vite-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@penalosa penalosa added skip-pr-description-validation Skip validation of the required PR description format e2e Run wrangler e2e tests on a PR labels Nov 25, 2024
Copy link
Contributor

github-actions bot commented Nov 25, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-wrangler-7334

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7334/npm-package-wrangler-7334

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-wrangler-7334 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-cloudflare-workers-bindings-extension-7334 -O ./cloudflare-workers-bindings-extension.0.0.0-ve8260e5ca.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-ve8260e5ca.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-create-cloudflare-7334 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-cloudflare-kv-asset-handler-7334

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-miniflare-7334

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-cloudflare-pages-shared-7334

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-cloudflare-unenv-preset-7334

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-cloudflare-vite-plugin-7334

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-cloudflare-vitest-pool-workers-7334

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-cloudflare-workers-editor-shared-7334

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-cloudflare-workers-shared-7334

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13418999425/npm-package-cloudflare-workflows-shared-7334

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20250214.0
workerd 1.20250214.0 1.20250214.0
workerd --version 1.20250214.0 2025-02-14

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@penalosa penalosa added the breaking change Change that will result in breaking existing behavior label Nov 29, 2024
@penalosa penalosa requested a review from a team as a code owner November 29, 2024 15:47
@penalosa penalosa requested a review from a team as a code owner December 2, 2024 12:26
@penalosa penalosa requested a review from a team as a code owner December 2, 2024 16:12
@rozenmd rozenmd requested a review from a team as a code owner December 10, 2024 22:09
@CarmenPopoviciu CarmenPopoviciu added the v4 wrangler version 4 label Dec 17, 2024
@dario-piotrowicz dario-piotrowicz linked an issue Jan 13, 2025 that may be closed by this pull request
@pmiguel pmiguel force-pushed the next branch 2 times, most recently from 86a4971 to b35265a Compare January 14, 2025 11:55
penalosa and others added 6 commits February 18, 2025 18:39
* chore: remove alpha support from `wrangler d1 migrations apply`

* chore: remove `wrangler d1 backups`

* chore: fixup tests

* chore: fixup tests

* chore: fixup tests

* chore: remove --batch-size
* Remove wrangler version

* Remove generate & strip down init

* Add changesets

* Remove deprecated --format & config

* Add changeset

* remove commands

* Fix tests

* Remove .only()

* Remove legacy assets

* clarify legacy assets -> sites naming
penalosa and others added 3 commits February 18, 2025 19:11
esbuild 0.24.2 variable naming changes
* feat(wrangler): Drop worker prefix when creating KV namespaces

* Remove crypto polyfill

---------

Co-authored-by: Samuel Macleod <[email protected]>
@penalosa penalosa requested a review from a team as a code owner February 19, 2025 11:55
Copy link
Contributor

@emily-shen emily-shen left a comment

Choose a reason for hiding this comment

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

nit: can we add a pre-requisites section to the wrangler readme that mentions this

Copy link
Contributor

@emily-shen emily-shen left a comment

Choose a reason for hiding this comment

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

the node app pages dev script in its package.json still uses the --node-compat flag

@penalosa
Copy link
Contributor Author

Remaining test failures should be resolved by cloudflare/next-on-pages#940

@@ -0,0 +1,5 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

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

--version is listed as a global command, but doesn't actually work on any command except for wrangler --version as listed here. Can we get rid of it from the global flags group as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, but if we did that I'm not sure where we'd document it?

(this also isn't a breaking change, so we could do this outside of the v4 scope)

Copy link
Contributor

@emily-shen emily-shen left a comment

Choose a reason for hiding this comment

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

a couple of places to update:

  • error message in getBindings in wrangler/src/dev.ts mentions kv:namespace create
  • workers-chat-demo fixture has [build.upload] in its config
  • legacy assets is mentioned in an error message in versions/secrets/index.ts in parseModules()


Remove `wrangler d1 backups`

BREAKING CHANGE: This change removes `wrangler d1 backups`, a set of alpha-only commands that would allow folks to interact with backups of their D1 alpha DBs.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: in context, having BREAKING CHANGE on just a couple of the breaking changes could be a bit confusing, maybe we could remove this from these changesets?

.changeset/major-remove-d1-backups.md
.changeset/major-remove-d1-deprecated-batch-size.md
.changeset/major-remove-d1-migrations-alpha.md

"wrangler": major
---

Remove legacy assets
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the --legacy-assets flag.

(and config key if there was one?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Change that will result in breaking existing behavior c3-e2e e2e Run wrangler e2e tests on a PR skip-pr-description-validation Skip validation of the required PR description format v4 wrangler version 4
Projects
Status: Other
Development

Successfully merging this pull request may close these issues.

🐛 BUG: this handling in static blocks results in undefined
7 participants