workers-sdk
workers-sdk copied to clipboard
DO NOT LAND feat: send durable object migrations with `wrangler dev`
This sends up migrations even during wrangler dev. This means features like renamed / deleted classes should work as expected even during development.
Fixes https://github.com/cloudflare/wrangler2/issues/736
There's more work to do here, but a bunch of it has to be actual live testing against the api, so I'm sending up the PR so we can use prerelease/alpha builds and have some folks try it out. We should also add additional validations for both dev/publish, but I'll send that in a subsequent PR.
🦋 Changeset detected
Latest commit: 5f86d5402d2400ea9fc7fdd8a641207e19cee582
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| wrangler | 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
A wrangler prerelease is available for testing. You can install this latest build in your project with:
npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2446826756/npm-package-wrangler-791
You can reference the automatically updated head of this PR with:
npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/791/npm-package-wrangler-791
Or you can use npx with this latest build directly:
npx https://prerelease-registry.developers.workers.dev/runs/2446826756/npm-package-wrangler-791 dev path/to/script.js
@a-robinson looks like the api does actually throw when we send migrations
![]()
Wait @a-robinson does that mean it won't ever support it, or just that it has to be implemented?
It has to be implemented. It doesn't look like it should be hard, but we need to remove the check that's firing and maybe add in a call to an existing function for handling them.
The code is kind of weird -- the handler for edge preview handles migrations existing but there's also a check in the reading of the request that rejects migrations 🤦
Cool cool, that sounds good. I'll leave this PR open till that happens, we can land it whenever.
Since we are heavily encouraging local development nowadays this issue does not seem to be affecting many (if any?) people, let's close it for now.
Can we reopen this? I'll follow up internally as well. I'm using remote mode for a couple of things and ended up needing this.
Re-opening but we need to be careful how this is implemented. Pushing migrations to a remote preview would potentially affect production migrations, right?
I'm going to close this again. With remote bindings the use cases for remote mode are shrinking, and there doesn't seem to be much interest in implementing this