workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

DO NOT LAND feat: send durable object migrations with `wrangler dev`

Open threepointone opened this issue 3 years ago • 11 comments

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.

threepointone avatar Apr 13 '22 14:04 threepointone

🦋 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

changeset-bot[bot] avatar Apr 13 '22 14:04 changeset-bot[bot]

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

github-actions[bot] avatar Apr 13 '22 14:04 github-actions[bot]

@a-robinson looks like the api does actually throw when we send migrations

image

threepointone avatar Apr 13 '22 14:04 threepointone

image

a-robinson avatar Apr 13 '22 14:04 a-robinson

Wait @a-robinson does that mean it won't ever support it, or just that it has to be implemented?

threepointone avatar Apr 13 '22 16:04 threepointone

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.

a-robinson avatar Apr 13 '22 16:04 a-robinson

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 🤦

a-robinson avatar Apr 13 '22 16:04 a-robinson

Cool cool, that sounds good. I'll leave this PR open till that happens, we can land it whenever.

threepointone avatar Apr 13 '22 16:04 threepointone

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.

petebacondarwin avatar Jan 02 '24 11:01 petebacondarwin

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.

threepointone avatar Jun 15 '24 09:06 threepointone

Re-opening but we need to be careful how this is implemented. Pushing migrations to a remote preview would potentially affect production migrations, right?

petebacondarwin avatar Jun 15 '24 10:06 petebacondarwin

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

penalosa avatar Jul 15 '25 18:07 penalosa