What is best practice when using sinc?
My current steps are:
- I find myself creating projects to test features of my local codegen.
- So in my plasmic.json I will see projectId and projectApiToken.
- And see components ids with projectIds
- So gingerly I take a copy of the plasmic.json as I get worried
- Then I created a new simple plasmic.json with the new projectId and projectApiToken and no components
- Then sinc
Obviously I am doing something wrong, as this is time consuming, confusing and risky.
Is the answer:
- The new branching feature
- Creating New Plasmic local code to match each project.
- A combination of both
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:
- Create the project in Plasmic Studio
- In your local machine, just run
plasmic sync <project id> , this will generate the plasmic.json + install all the necessary node_modules
- Start building your components
If you need to share your plasmic projects
- Same as above
- In the Plasmic Studio project settings, import the other projects into it
- Then sync
As I have created a lot Plasmic projects myself, so below is what I have learnt
- 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
- 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.