How to keep a Nette addon compatibility with Nette Framework 2.0, 2.1 and 2.2? Here is my fight description:
- Nette 2.0
Nette\Utils\PhpGenerator\ClassType
vs Nette 2.1+Nette\PhpGenerator\ClassType
strict errors andNette\Config\CompilerExtension
vs.Nette\DI\CompilerExtension
. This was a difficult one:
- Create abstract
BC\Extension
s like this, - and Nette version-dependent loader like this.
- A target extension will inherit one of them as
class Extension extends BC\Extension
and - the Composer will class-mapping different folder and hard load version-dependent loader like this.
-
IBarPanel
is solved in the same way as 1) -
Few nuances like this is easy to catch in code
-
Nette\Diagnostics
vs.Tracy
CSS
Nette 2.2.* solves the compatibility. It translates CSS classes from nette-...
to tracy-...
automatically. But I want to stay dev-branch compatible with a backward-direction compatbility. Just duplicate selectors like this.
Not bad.