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

chore: update wrangler versions in templates #7742

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

threepointone
Copy link
Contributor

We should probably automate this, but doing it manually for now since it's so behind.

Fixes #0000


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because: no functional change
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: no functional change
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: no functional change

@threepointone threepointone requested review from a team as code owners January 12, 2025 19:44
Copy link

changeset-bot bot commented Jan 12, 2025

🦋 Changeset detected

Latest commit: 8836e90

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

This PR includes changesets to release 1 package
Name Type
create-cloudflare 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

Copy link
Contributor

github-actions bot commented Jan 12, 2025

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/12736662831/npm-package-wrangler-7742

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

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

Or you can use npx with this latest build directly:

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

cloudflare-workers-bindings-extension:

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

create-cloudflare:

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

@cloudflare/kv-asset-handler:

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

miniflare:

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

@cloudflare/pages-shared:

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

@cloudflare/unenv-preset:

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

@cloudflare/vitest-pool-workers:

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

@cloudflare/workers-editor-shared:

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

@cloudflare/workers-shared:

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

@cloudflare/workflows-shared:

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

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


wrangler@3.101.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20241230.1
workerd 1.20241230.0 1.20241230.0
workerd --version 1.20241230.0 2024-12-30

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

@threepointone threepointone force-pushed the update-template-wrangler-versions branch from d2c8281 to 8836e90 Compare January 12, 2025 20:04
@@ -14,7 +14,7 @@ import { DurableObject } from "cloudflare:workers";
*/

/** A Durable Object's behavior is defined in an exported Javascript class */
export class MyDurableObject extends DurableObject {
export class MyDurableObject extends DurableObject<Env> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also added this fix here

Copy link
Contributor

@petebacondarwin petebacondarwin Jan 13, 2025

Choose a reason for hiding this comment

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

Is this correct? In workers-types DurableObject has no type param.

Hmm... interestingly the @cloudflare/workers-types library has two files of note: index.ts and index.d.ts.
The latter contains export abstract class DurableObject<Env = unknown> while the former does not.

But in my setup it appears that VS Code is picking up the index.ts and so erroring if I provide a type param.

Copy link
Contributor

Choose a reason for hiding this comment

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

Doh! I see now. This is imported from the cloudflare:workers module, which is what brings in this class.

@@ -8,6 +8,6 @@
"start": "wrangler dev"
},
"devDependencies": {
"wrangler": "^3.60.3"
"wrangler": "^3.101.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to be clear, for my sake, I believe that updating these has no practical effect, since the ^ will cause the most recent Wrangler v3 minor version to be installed anyway. Right?

The only reason to worry about updating these would be if there was a new feature in a minor that the template relied upon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Considering it more of a cleanliness thing really. Looks bad if our own official templates don't point to the latest version. Ideally this would be automated.

@@ -14,7 +14,7 @@ import { DurableObject } from "cloudflare:workers";
*/

/** A Durable Object's behavior is defined in an exported Javascript class */
export class MyDurableObject extends DurableObject {
export class MyDurableObject extends DurableObject<Env> {
Copy link
Contributor

@petebacondarwin petebacondarwin Jan 13, 2025

Choose a reason for hiding this comment

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

Is this correct? In workers-types DurableObject has no type param.

Hmm... interestingly the @cloudflare/workers-types library has two files of note: index.ts and index.d.ts.
The latter contains export abstract class DurableObject<Env = unknown> while the former does not.

But in my setup it appears that VS Code is picking up the index.ts and so erroring if I provide a type param.

@@ -14,7 +14,7 @@ import { DurableObject } from "cloudflare:workers";
*/

/** A Durable Object's behavior is defined in an exported Javascript class */
export class MyDurableObject extends DurableObject {
export class MyDurableObject extends DurableObject<Env> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Doh! I see now. This is imported from the cloudflare:workers module, which is what brings in this class.

@threepointone threepointone merged commit 8fb0f25 into main Jan 13, 2025
29 checks passed
@threepointone threepointone deleted the update-template-wrangler-versions branch January 13, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants