Migrating to Wrangler 2 from a previous starter

I’ve build out my current Workers using this starter…

I was just reading the migration guide in the Wrangler docs.

I guess I have a couple questions before I go down this rabbit hole.

  1. Do you have to globally uninstall wrangler before you upgrade?

I installed Wrangler 2 in a test project just to play… and it seemed to work find. So I don’t think you do, but I wanted to ask anyway.

  1. I should be able to uninstall all of the rollup packages and files… correct? And update the build script.

I’ve never uninstalled a bundler before so that sounds like it’s going to break everything.

  1. KV stores and Durable Objects are binded to a Worker. Is there anyway to replace a Worker and keep the binding somehow?

That last question is more of a curiosity question because in this one app I’m building now… I’m using KV and Durable Objects as my primary database layer.

Thanks for any help!

I wanted to give an update.

I just did an update on a test Worker and…

  1. You don’t have uninstall the global Wrangler to use Wrangler 2.

  2. Yes you can uninstall all of the rollup packages although it still works with them. But I will probably build my own build script so I can use jest for unit testing.

  3. I saw today that Cloudflare released the ability for Workers to talk to each other. This is huge!!

I am still curious about can you “transfer” a KV namespace or DO namespace to a different Worker if you ever had to?

Tomorrow I am going to take a real project Worker and convert it and hopefully all will go well.

You can bind to a given KV namespace or Durable Object from multiple workers.

Your definition of the behavior for a given Durable Object class is just going to be in one worker though.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.