Craft 3 plugin backwards compatibility and maintenance for 2.x I've been updating a number of my plugins for Craft 3 lately; part of that process has been to create entirely separate repositories/projects to accommodate the differences between Craft 2.x &amp; 3.  

I'm curious to know how other developers maintain two plugins where the core functionality is essentially the same code.

Maybe having both plugins refer to the same dependancies via composer? (But still have two repos/projects)

Perhaps keep everything on one repo/project and simply have two versions of the plugin in there. Although that may conflict with Craft 3's plugin store; as half the files int he repo are redundant.

I'd love to know how others are dealing with their plugin upgrades and if there are any 'official' practices to resolve this.
This seems to be the common pattern emerging amongst developers in the same position...

A single repo:

craft-(pluginname)


Containing multiple branches:

v1 (your old Craft 2 version)
v2 (your new Craft 3 version)


There are a handful of variations to this, but that's it in a nutshell.

Examples:


https://github.com/craftcms/contact-form *
https://github.com/barrelstrength/craft-sprout-notes
https://github.com/doublesecretagency/craft-cpcss
https://github.com/marionnewlevant/craft-snitch
https://github.com/carlcs/craft-deleteentryversions


* P&amp;T has mentioned that they didn't prefix their own repos with craft-, since the repo is owned by craftcms. But they said they would have, if they were a 3rd party developer.

Some people have prefixed their repos with craft3-, but that has been discouraged by the folks at P&amp;T. It would force you to abandon this repo (or leave the name confusing) when Craft 4 is eventually released.