github cloudflare/workers-sdk wrangler@2.0.9

Patch Changes

  • #1192 bafa5ac Thanks @threepointone! - fix: use worker name as a script ID when generating a preview session

    When generating a preview session on the edge with wrangler dev, for a zoned worker we were using a random id as the script ID. This would make the backend not associate the dev session with any resources that were otherwise assigned to the script (specifically for secrets, but other stuff as well) The fix is simply to use the worker name (when available) as the script ID.

    Fixes #1003
    Fixes #1172

  • #1212 101342e Thanks @petebacondarwin! - fix: do not crash when not logged in and switching to remote dev mode

    Previously, if you are not logged in when running wrangler dev it will only try to log you in
    if you start in "remote" mode. In "local" mode there is no need to be logged in, so it doesn't
    bother to try to login, and then will crash if you switch to "remote" mode interactively.

    The problem was that we were only attempting to login once before creating the <Remote> component.
    Now this logic has been moved into a useEffect() inside <Remote> so that it will be run whether
    starting in "remote" or transitioning to "remote" from "local".

    The fact that the check is no longer done before creating the components is proven by removing the
    mockAccountId() and mockApiToken() calls from the dev.test.ts files.

    Fixes #18

  • #1188 b44cc26 Thanks @petebacondarwin! - fix: fallback on old zone-based API when account-based route API fails

    While we wait for changes to the CF API to support API tokens that do not have
    "All Zone" permissions, this change provides a workaround for most scenarios.

    If the bulk-route request fails with an authorization error, then we fallback
    to the Wrangler 1 approach, which sends individual route updates via a zone-based
    endpoint.

    Fixes #651

  • #1203 3b88b9f Thanks @rozenmd! - fix: differentiate between API and OAuth in whoami

    Closes #1198

  • #1199 e64812e Thanks @sidharthachatterjee! - fix: Refresh JWT in wrangler pages publish when it expires

  • #1209 2d42882 Thanks @petebacondarwin! - fix: ensure wrangler init works with older versions of git

    Rather than using the recently added --initial-branch option, we now just renamed the initial branch using git branch -m main.

    Fixes #1168

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.