How do you handle breaking changes in DID files

How do you handle breaking changes in DID files when using agent-js? Do you have any helpful tips to share, apart from trying to avoid breaking changes altogether?

In Juno, especially for the controllers, I recently made architectural changes that resulted in breaking changes to the types of the canisters’ endpoints. As a result, these breaking changes also propagate to the related DID files. While it’s manageable when dealing with a single version of the canisters, it becomes challenging when you need to support multiple versions within a single library.

I ended up resorting to copying and pasting the DID files and duplicating code to load the appropriate actor based on different versions. However, this approach made my code and project more verbose. I’m curious to know if anyone has any great tips or alternative solutions for handling this situation efficiently. Any insights would be greatly appreciated!