What are best practices when using plasmic sync?

What is best practice when using sinc?

My current steps are:

  1. I find myself creating projects to test features of my local codegen.
  2. So in my plasmic.json I will see projectId and projectApiToken.
  3. And see components ids with projectIds
  4. So gingerly I take a copy of the plasmic.json as I get worried
  5. Then I created a new simple plasmic.json with the new projectId and projectApiToken and no components
  6. Then sinc
    Obviously I am doing something wrong, as this is time consuming, confusing and risky.
    Is the answer:
  7. The new branching feature
  8. Creating New Plasmic local code to match each project.
  9. A combination of both
    TIA
    Linc

I am just another dev who has been using Plasmic for a while. I find the steps you outline a bit too complicated so here is my workflow that I use:

  1. Create the project in Plasmic Studio
  2. In your local machine, just run plasmic sync <project id> , this will generate the plasmic.json + install all the necessary node_modules
  3. Start building your components
    If you need to share your plasmic projects
  4. Same as above
  5. In the Plasmic Studio project settings, import the other projects into it
  6. Then sync
    As I have created a lot Plasmic projects myself, so below is what I have learnt
  7. Do not be afraid of plasmic.json file (the concept is similar to yarn.lock). Most of the time, if there is issue during syncing process or the end codegen does not make sense, you can just go ahead and delete that file then sync again. Note that if your codebase has been synced before, it will ask you to override or delete certain files. If you believe your project in Plasmic Studio is correct, just select yes for everything
  8. If you feel like your plasmic.json file is out of sync with the content in Plasmic Studio. Just edit that file and delete the block of json that is wrong. In my case, I duplicate page then rename a lot and when doing so plasmic.json sometimes will keep the old name like homepage-2 instead of the new name. Simply delete that block and run sync again
    I find the tools the Plasmic team put together are very impressive and once you get used to them, they will be very easy to use. Good luck

Thanks so much @parental_bobolink for the comprehensive explanation.
This makes a lot of sense so will give it a go.

Would also like to try branching at some point.